Ticket #6184: 6184_v2.diff

File 6184_v2.diff, 2.1 KB (added by borko, 3 years ago)
  • twisted/conch/scripts/tkconch.py

    diff --git a/twisted/conch/scripts/tkconch.py b/twisted/conch/scripts/tkconch.py
    index eb00186..c97697b 100644
    a b class SSHClientTransport(transport.SSHClientTransport): 
    371371        elif goodKey == 2: # AAHHHHH changed
    372372            return defer.fail(error.ConchError('bad host key'))
    373373        else:
    374             if options['host'] == self.transport.getPeer()[1]:
     374            if options['host'] == self.transport.getPeer().host:
    375375                host = options['host']
    376376                khHost = options['host']
    377377            else:
    378378                host = '%s (%s)' % (options['host'],
    379                                     self.transport.getPeer()[1])
     379                                    self.transport.getPeer().host)
    380380                khHost = '%s,%s' % (options['host'],
    381                                     self.transport.getPeer()[1])
     381                                    self.transport.getPeer().host)
    382382            keyType = common.getNS(pubKey)[0]
    383383            ques = """The authenticity of host '%s' can't be established.\r
    384384%s key fingerprint is %s.""" % (host,
  • twisted/protocols/htb.py

    diff --git a/twisted/protocols/htb.py b/twisted/protocols/htb.py
    index 10008cf..468e8a2 100644
    a b class FilterByHost(HierarchicalBucketFilter): 
    192192    sweepInterval = 60 * 20
    193193
    194194    def getBucketKey(self, transport):
    195         return transport.getPeer()[1]
     195        return transport.getPeer().host
    196196
    197197
    198198class FilterByServer(HierarchicalBucketFilter):
  • twisted/protocols/policies.py

    diff --git a/twisted/protocols/policies.py b/twisted/protocols/policies.py
    index b9c0661..44f7617 100644
    a b class LimitConnectionsByPeer(WrappingFactory): 
    398398        return WrappingFactory.buildProtocol(self, addr)
    399399
    400400    def unregisterProtocol(self, p):
    401         peerHost = p.getPeer()[1]
     401        peerHost = p.getPeer().host
    402402        self.peerConnections[peerHost] -= 1
    403403        if self.peerConnections[peerHost] == 0:
    404404            del self.peerConnections[peerHost]