Show More
@@ -1023,7 +1023,7 b' def unbundle(repo, proto, heads):' | |||||
1023 | hint=bundle2requiredhint) |
|
1023 | hint=bundle2requiredhint) | |
1024 |
|
1024 | |||
1025 | r = exchange.unbundle(repo, gen, their_heads, 'serve', |
|
1025 | r = exchange.unbundle(repo, gen, their_heads, 'serve', | |
1026 |
proto. |
|
1026 | proto.client()) | |
1027 | if util.safehasattr(r, 'addpart'): |
|
1027 | if util.safehasattr(r, 'addpart'): | |
1028 | # The return looks streamable, we are in the bundle2 case |
|
1028 | # The return looks streamable, we are in the bundle2 case | |
1029 | # and should return a stream. |
|
1029 | # and should return a stream. |
@@ -88,6 +88,10 b' class baseprotocolhandler(object):' | |||||
88 | won't be captured. |
|
88 | won't be captured. | |
89 | """ |
|
89 | """ | |
90 |
|
90 | |||
|
91 | @abc.abstractmethod | |||
|
92 | def client(self): | |||
|
93 | """Returns a string representation of this client (as bytes).""" | |||
|
94 | ||||
91 | def decodevaluefromheaders(req, headerprefix): |
|
95 | def decodevaluefromheaders(req, headerprefix): | |
92 | """Decode a long value from multiple HTTP request headers. |
|
96 | """Decode a long value from multiple HTTP request headers. | |
93 |
|
97 | |||
@@ -164,7 +168,7 b' class webproto(baseprotocolhandler):' | |||||
164 | self._ui.fout = oldout |
|
168 | self._ui.fout = oldout | |
165 | self._ui.ferr = olderr |
|
169 | self._ui.ferr = olderr | |
166 |
|
170 | |||
167 |
def |
|
171 | def client(self): | |
168 | return 'remote:%s:%s:%s' % ( |
|
172 | return 'remote:%s:%s:%s' % ( | |
169 | self._req.env.get('wsgi.url_scheme') or 'http', |
|
173 | self._req.env.get('wsgi.url_scheme') or 'http', | |
170 | urlreq.quote(self._req.env.get('REMOTE_HOST', '')), |
|
174 | urlreq.quote(self._req.env.get('REMOTE_HOST', '')), | |
@@ -399,7 +403,7 b' class sshv1protocolhandler(baseprotocolh' | |||||
399 | def mayberedirectstdio(self): |
|
403 | def mayberedirectstdio(self): | |
400 | yield None |
|
404 | yield None | |
401 |
|
405 | |||
402 |
def |
|
406 | def client(self): | |
403 | client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] |
|
407 | client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] | |
404 | return 'remote:ssh:' + client |
|
408 | return 'remote:ssh:' + client | |
405 |
|
409 |
General Comments 0
You need to be logged in to leave comments.
Login now