comparison mercurial/hgweb/server.py @ 12740:b86c6954ec4c

serve: fix https mode and add test The https mode failed in super because BaseRequestHandler is an old-style class. This introduces the first test of https client/server functionality - and "hghave ssl". The test is currently only run on Python 2.6.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 17 Oct 2010 04:13:35 +0200
parents 49463314c24f
children 191d0fd5c2fd
comparison
equal deleted inserted replaced
12739:8dcd3203a261 12740:b86c6954ec4c
178 self.wfile = socket._fileobject(self.request, "wb", self.wbufsize) 178 self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
179 179
180 def do_write(self): 180 def do_write(self):
181 from OpenSSL.SSL import SysCallError 181 from OpenSSL.SSL import SysCallError
182 try: 182 try:
183 super(_shgwebhandler, self).do_write() 183 _hgwebhandler.do_write(self)
184 except SysCallError, inst: 184 except SysCallError, inst:
185 if inst.args[0] != errno.EPIPE: 185 if inst.args[0] != errno.EPIPE:
186 raise 186 raise
187 187
188 def handle_one_request(self): 188 def handle_one_request(self):
189 from OpenSSL.SSL import SysCallError, ZeroReturnError 189 from OpenSSL.SSL import SysCallError, ZeroReturnError
190 try: 190 try:
191 super(_shgwebhandler, self).handle_one_request() 191 _hgwebhandler.handle_one_request(self)
192 except (SysCallError, ZeroReturnError): 192 except (SysCallError, ZeroReturnError):
193 self.close_connection = True 193 self.close_connection = True
194 pass 194 pass
195 195
196 try: 196 try: