Beispiel #1
0
 def __init__(self, *args, **kwargs):
     HTTPConnection.__init__(self, *args, **kwargs)
     self._original_response_cls = self.response_class
     # We'd ideally hook into httplib's states, but they're all
     # __mangled_vars so we use our own state var.  This variable is set
     # when we receive an early response from the server.  If this value is
     # set to True, any calls to send() are noops.  This value is reset to
     # false every time _send_request is called.  This is to workaround the
     # fact that py2.6 (and only py2.6) has a separate send() call for the
     # body in _send_request, as opposed to endheaders(), which is where the
     # body is sent in all versions > 2.6.
     self._response_received = False