Rev 6184: Merge _close => _disconnect_client. in http://bazaar.launchpad.net/~jameinel/bzr/2.5-soft-hangup-795025
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 23 13:01:21 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/2.5-soft-hangup-795025
------------------------------------------------------------
revno: 6184 [merge]
revision-id: john at arbash-meinel.com-20110923130112-do88k6x35e2vtj2t
parent: john at arbash-meinel.com-20110923125740-bistyq17nlwp53gw
parent: john at arbash-meinel.com-20110923130004-30sc1g5p6x2mb00b
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-soft-hangup-795025
timestamp: Fri 2011-09-23 15:01:12 +0200
message:
Merge _close => _disconnect_client.
modified:
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
-------------- next part --------------
=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py 2011-09-22 15:18:52 +0000
+++ b/bzrlib/smart/medium.py 2011-09-23 13:01:12 +0000
@@ -247,7 +247,7 @@
except errors.ConnectionTimeout, e:
trace.note('%s' % (e,))
trace.log_exception_quietly()
- self._close()
+ self._disconnect_client()
# We reported it, no reason to make a big fuss.
return
except Exception, e:
@@ -261,7 +261,7 @@
trace.mutter('Stopping %s' % (self,))
self.finished = True
- def _close(self):
+ def _disconnect_client(self):
"""Close the current connection. We stopped due to a timeout/etc."""
# The default implementation is a no-op, because that is all we used to
# do when disconnecting from a client. I suppose we never had the
@@ -382,7 +382,7 @@
self._push_back(protocol.unused_data)
- def _close(self):
+ def _disconnect_client(self):
"""Close the current connection. We stopped due to a timeout/etc."""
self.socket.close()
@@ -457,7 +457,7 @@
return
protocol.accept_bytes(bytes)
- def _close(self):
+ def _disconnect_client(self):
self._in.close()
self._out.close()
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py 2011-09-23 12:57:40 +0000
+++ b/bzrlib/tests/test_smart_transport.py 2011-09-23 13:01:12 +0000
@@ -729,7 +729,7 @@
sample_protocol = SampleRequest(expected_bytes=sample_request_bytes)
client_sock.sendall(sample_request_bytes)
server._serve_one_request(sample_protocol)
- server._close()
+ server._disconnect_client()
self.assertEqual('', client_sock.recv(1))
self.assertEqual(sample_request_bytes, sample_protocol.accepted_bytes)
self.assertFalse(server.finished)
@@ -763,7 +763,7 @@
server_protocol = server._build_protocol()
client_sock.sendall(rest_of_request_bytes)
server._serve_one_request(server_protocol)
- server._close()
+ server._disconnect_client()
self.assertEqual(expected_response, osutils.recv_all(client_sock, 50),
"Not a version 2 response to 'hello' request.")
self.assertEqual('', client_sock.recv(1))
@@ -842,7 +842,7 @@
stream_still_open = server._serve_one_request(second_protocol)
self.assertEqual(sample_request_bytes, second_protocol.accepted_bytes)
self.assertFalse(server.finished)
- server._close()
+ server._disconnect_client()
self.assertEqual('', client_sock.recv(1))
def test_pipe_like_stream_error_handling(self):
@@ -884,7 +884,7 @@
fake_protocol = ErrorRaisingProtocol(KeyboardInterrupt('boom'))
self.assertRaises(
KeyboardInterrupt, server._serve_one_request, fake_protocol)
- server._close()
+ server._disconnect_client()
self.assertEqual('', client_sock.recv(1))
def build_protocol_pipe_like(self, bytes):
More information about the bazaar-commits
mailing list