Message10765
Jim pointed out that the initial diff I included breaks other tests. I modified it slightly and managed to get my example working without breaking any other tests.
diff --git a/Lib/_socket.py b/Lib/_socket.py
index 3b658e5..4b3c7df 100644
--- a/Lib/_socket.py
+++ b/Lib/_socket.py
@@ -729,6 +729,7 @@ class _realsocket(object):
self.selectors = CopyOnWriteArrayList()
self.options = {} # deferred options until bootstrap
self.peer_closed = False
+ self.channel_closed = False
# Reference count this underlying socket
self.open_lock = Lock()
@@ -875,12 +876,13 @@ class _realsocket(object):
if self.connect_handlers:
self.channel.pipeline().addLast(self.python_inbound_handler)
- def peer_closed(x):
+ def channel_closed(x):
log.debug("Peer closed channel %s", x, extra={"sock": self})
+ self.channel_closed = True
self.incoming.put(_PEER_CLOSED)
self._notify_selectors(hangup=True)
- self.channel.closeFuture().addListener(peer_closed)
+ self.channel.closeFuture().addListener(channel_closed)
def connect(self, addr):
# Unwrapped sockets can immediately perform the post-connect step
@@ -1121,7 +1123,7 @@ class _realsocket(object):
return 0
def _writable(self):
- return self.channel and self.channel.isActive() and self.channel.isWritable()
+ return self.channel_closed or (self.channel and self.channel.isActive() and self.channel.isWritable())
can_write = _writable
I'd still like the change to be vetted though. |
|
Date |
User |
Action |
Args |
2016-02-23 23:22:52 | nickmbailey | set | messageid: <1456269772.38.0.584279416225.issue2470@psf.upfronthosting.co.za> |
2016-02-23 23:22:52 | nickmbailey | set | recipients:
+ nickmbailey, zyasoft |
2016-02-23 23:22:52 | nickmbailey | link | issue2470 messages |
2016-02-23 23:22:51 | nickmbailey | create | |
|