Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 39060:ed8160e4fea0
util: fix signature of setsockopt in socket observer
The format string expected the result, callers all passed the result,
but we didn't actually accept the result to this function. I swear
I've looked at this code a dozen times trying to find the problem, and
it was this simple all along.
Differential Revision: https://phab.mercurial-scm.org/D4253
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 10 Aug 2018 02:30:14 -0400 |
parents | 9d49bb117dde |
children | 1af95139e5ec |
comparison
equal
deleted
inserted
replaced
39059:2e37bd614879 | 39060:ed8160e4fea0 |
---|---|
946 if not self.states: | 946 if not self.states: |
947 return | 947 return |
948 | 948 |
949 self.fh.write('%s> gettimeout() -> %f\n' % (self.name, res)) | 949 self.fh.write('%s> gettimeout() -> %f\n' % (self.name, res)) |
950 | 950 |
951 def setsockopt(self, level, optname, value): | 951 def setsockopt(self, res, level, optname, value): |
952 if not self.states: | 952 if not self.states: |
953 return | 953 return |
954 | 954 |
955 self.fh.write('%s> setsockopt(%r, %r, %r) -> %r\n' % ( | 955 self.fh.write('%s> setsockopt(%r, %r, %r) -> %r\n' % ( |
956 self.name, level, optname, value)) | 956 self.name, level, optname, value, res)) |
957 | 957 |
958 def makeloggingsocket(logh, fh, name, reads=True, writes=True, states=True, | 958 def makeloggingsocket(logh, fh, name, reads=True, writes=True, states=True, |
959 logdata=False, logdataapis=True): | 959 logdata=False, logdataapis=True): |
960 """Turn a socket into a logging socket.""" | 960 """Turn a socket into a logging socket.""" |
961 | 961 |