diff mercurial/httpclient/tests/util.py @ 14376:a75e0f4ba0ab

httpclient: import revision fc731618702a of py-nonblocking-http
author Augie Fackler <durin42@gmail.com>
date Tue, 17 May 2011 10:28:03 -0500
parents 5c3de67e7402
children 494b26ad8736
line wrap: on
line diff
--- a/mercurial/httpclient/tests/util.py	Mon May 16 16:59:45 2011 -0500
+++ b/mercurial/httpclient/tests/util.py	Tue May 17 10:28:03 2011 -0500
@@ -88,7 +88,7 @@
     def ready_for_read(self):
         return ((self.early_data and http._END_HEADERS in self.sent)
                 or (self.read_wait_sentinel in self.sent and self.data)
-                or self.closed)
+                or self.closed or self.remote_closed)
 
     def send(self, data):
         # this is a horrible mock, but nothing needs us to raise the
@@ -117,6 +117,11 @@
     def __getattr__(self, key):
         return getattr(self._sock, key)
 
+    def __setattr__(self, key, value):
+        if key not in ('_sock', '_fail_recv'):
+            return setattr(self._sock, key, value)
+        return object.__setattr__(self, key, value)
+
     def recv(self, amt=-1):
         try:
             if self._fail_recv: