Part of bzrlib.transport.http._urllib2_wrappers View In Hierarchy
httplib prefers to decorate the returned objects, rather than using a custom object.
httplib assumes that some responses get no content and do not even attempt to read the body in that case, leaving the body in the socket, blocking the next request. Let's try to workaround that.
In some cases, the client may have left some bytes to read in the body. That will block the next request to succeed if we use a persistent connection. If we don't use a persistent connection, well, nothing will block the next request since a new connection will be issued anyway.
Returns | the number of bytes left on the socket (may be None) |