comparison mercurial/hgweb/request.py @ 13598:e5d3c7083d91 stable

deal with empty Content-Length headers
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 12 Mar 2011 15:21:45 +0100
parents 8dcd3203a261
children bcc59cb3714d
comparison
equal deleted inserted replaced
13597:38c9837b1f75 13598:e5d3c7083d91
64 def read(self, count=-1): 64 def read(self, count=-1):
65 return self.inp.read(count) 65 return self.inp.read(count)
66 66
67 def drain(self): 67 def drain(self):
68 '''need to read all data from request, httplib is half-duplex''' 68 '''need to read all data from request, httplib is half-duplex'''
69 length = int(self.env.get('CONTENT_LENGTH', 0)) 69 length = int(self.env.get('CONTENT_LENGTH', 0) or 0)
70 for s in util.filechunkiter(self.inp, limit=length): 70 for s in util.filechunkiter(self.inp, limit=length):
71 pass 71 pass
72 72
73 def respond(self, status, type=None, filename=None, length=0): 73 def respond(self, status, type=None, filename=None, length=0):
74 if self._start_response is not None: 74 if self._start_response is not None: