--- a/mercurial/hgweb/common.py Tue Mar 08 15:36:56 2011 -0500
+++ b/mercurial/hgweb/common.py Sat Feb 06 04:27:28 2010 -0600
@@ -78,6 +78,23 @@
self.message = message
self.headers = headers
+class continuereader(object):
+ def __init__(self, f, write):
+ self.f = f
+ self._write = write
+ self.continued = False
+
+ def read(self, amt=-1):
+ if not self.continued:
+ self.continued = True
+ self._write('HTTP/1.1 100 Continue\r\n\r\n')
+ return self.f.read(amt)
+
+ def __getattr__(self, attr):
+ if attr in ('close', 'readline', 'readlines', '__iter__'):
+ return getattr(self.f, attr)
+ raise AttributeError()
+
def _statusmessage(code):
from BaseHTTPServer import BaseHTTPRequestHandler
responses = BaseHTTPRequestHandler.responses