aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Twisted/py3/twisted/internet/_win32stdio.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-08-25 12:54:32 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-08-25 13:03:33 +0300
commit4a64a813e1d34e732f35d8a65147974f76395a6f (patch)
treea8da0dede5213f85e45b95047cfbdcf5427cf0b7 /contrib/python/Twisted/py3/twisted/internet/_win32stdio.py
parente9bbee265681b79a9ef9795bdc84cf6996f9cfec (diff)
downloadydb-4a64a813e1d34e732f35d8a65147974f76395a6f.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/Twisted/py3/twisted/internet/_win32stdio.py')
-rw-r--r--contrib/python/Twisted/py3/twisted/internet/_win32stdio.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/contrib/python/Twisted/py3/twisted/internet/_win32stdio.py b/contrib/python/Twisted/py3/twisted/internet/_win32stdio.py
index 104d65f348c..f6a80403d04 100644
--- a/contrib/python/Twisted/py3/twisted/internet/_win32stdio.py
+++ b/contrib/python/Twisted/py3/twisted/internet/_win32stdio.py
@@ -20,8 +20,11 @@ from twisted.internet.interfaces import (
IPushProducer,
ITransport,
)
+from twisted.logger import Logger
from twisted.python.failure import Failure
+_log = Logger()
+
@implementer(IAddress)
class Win32PipeAddress:
@@ -66,14 +69,20 @@ class StandardIO(_pollingfile._PollingTimer):
self.proto.dataReceived(data)
def readConnectionLost(self):
- if IHalfCloseableProtocol.providedBy(self.proto):
- self.proto.readConnectionLost()
+ with _log.failuresHandled("read connection lost") as op:
+ if IHalfCloseableProtocol.providedBy(self.proto):
+ self.proto.readConnectionLost()
self.checkConnLost()
+ if not op.succeeded and not self.disconnecting:
+ self.loseConnection()
def writeConnectionLost(self):
- if IHalfCloseableProtocol.providedBy(self.proto):
- self.proto.writeConnectionLost()
+ with _log.failuresHandled("write connection lost") as op:
+ if IHalfCloseableProtocol.providedBy(self.proto):
+ self.proto.writeConnectionLost()
self.checkConnLost()
+ if not op.succeeded and not self.disconnecting:
+ self.loseConnection()
connsLost = 0