Revision f088165d
b/lib/http/__init__.py | ||
---|---|---|
652 | 652 |
buf = "" |
653 | 653 |
eof = False |
654 | 654 |
while self.parser_status != self.PS_COMPLETE: |
655 |
# TODO: Don't read more than necessary (Content-Length), otherwise |
|
656 |
# data might be lost and/or an error could occur |
|
655 | 657 |
data = SocketOperation(self.poller, sock, SOCKOP_RECV, SOCK_BUF_SIZE, |
656 | 658 |
read_timeout) |
657 | 659 |
|
... | ... | |
698 | 700 |
@return: Updated receive buffer |
699 | 701 |
|
700 | 702 |
""" |
703 |
# TODO: Use offset instead of slicing when possible |
|
701 | 704 |
if self.parser_status == self.PS_START_LINE: |
702 | 705 |
# Expect start line |
703 | 706 |
while True: |
... | ... | |
763 | 766 |
# [...] 5. By the server closing the connection. (Closing the connection |
764 | 767 |
# cannot be used to indicate the end of a request body, since that would |
765 | 768 |
# leave no possibility for the server to send back a response.)" |
769 |
# |
|
770 |
# TODO: Error when buffer length > Content-Length header |
|
766 | 771 |
if (eof or |
767 | 772 |
self.content_length is None or |
768 | 773 |
(self.content_length is not None and |
Also available in: Unified diff