diff --git a/lib/http/__init__.py b/lib/http/__init__.py index ce2243a64bcd41188c9e9b111143f924229de506..b39866a81016fa331f72b7992aafb91cb9b28dff 100644 --- a/lib/http/__init__.py +++ b/lib/http/__init__.py @@ -401,9 +401,9 @@ def SocketOperation(sock, op, arg1, timeout): if event is None: raise HttpSocketTimeout() - if (op == SOCKOP_RECV and - event & (select.POLLNVAL | select.POLLHUP | select.POLLERR)): - return "" + if event & (select.POLLNVAL | select.POLLHUP | select.POLLERR): + # Let the socket functions handle these + break if not event & wait_for_event: continue @@ -845,7 +845,7 @@ class HttpMessageReader(object): # the CRLF." if idx == 0: # TODO: Limit number of CRLFs/empty lines for safety? - buf = buf[:2] + buf = buf[2:] continue if idx > 0: