##// END OF EJS Templates
Close keepalive connections to fix server traceback
Andrei Vermel -
r4132:0d94e4a3 default
parent child Browse files
Show More
@@ -127,6 +127,7 b' class httprepository(remoterepository):'
127 def __init__(self, ui, path):
127 def __init__(self, ui, path):
128 self.path = path
128 self.path = path
129 self.caps = None
129 self.caps = None
130 self.handler = None
130 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
131 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
131 if query or frag:
132 if query or frag:
132 raise util.Abort(_('unsupported URL component: "%s"') %
133 raise util.Abort(_('unsupported URL component: "%s"') %
@@ -141,7 +142,8 b' class httprepository(remoterepository):'
141
142
142 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
143 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
143 # XXX proxyauthinfo = None
144 # XXX proxyauthinfo = None
144 handlers = [httphandler()]
145 self.handler = httphandler()
146 handlers = [self.handler]
145
147
146 if proxyurl:
148 if proxyurl:
147 # proxy can be proper url or host[:port]
149 # proxy can be proper url or host[:port]
@@ -199,6 +201,11 b' class httprepository(remoterepository):'
199 # 1.0 here is the _protocol_ version
201 # 1.0 here is the _protocol_ version
200 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
202 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
201 urllib2.install_opener(opener)
203 urllib2.install_opener(opener)
204
205 def __del__(self):
206 if self.handler:
207 self.handler.close_all()
208 self.handler = None
202
209
203 def url(self):
210 def url(self):
204 return self.path
211 return self.path
General Comments 0
You need to be logged in to leave comments. Login now