From bab03e9d5305dd14d7284ea6d6f1223a35261fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dvo=C5=99=C3=A1k=20V=C3=A1clav?= Date: Wed, 4 Nov 2020 16:28:27 +0100 Subject: [PATCH] undo sendall() change unrelated to the bug fix --- cheroot/ssl/pyopenssl.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cheroot/ssl/pyopenssl.py b/cheroot/ssl/pyopenssl.py index a18d0150da..a4e3920e55 100644 --- a/cheroot/ssl/pyopenssl.py +++ b/cheroot/ssl/pyopenssl.py @@ -146,7 +146,7 @@ def readline(self, size=-1): ) def read(self, *args, **kwargs): - """Read from the wrapped socket, with retry.""" + """Read from the wrapped socket.""" return self._safe_call( True, super(SSLFileobjectMixin, self).read, @@ -154,14 +154,12 @@ def read(self, *args, **kwargs): ) def sendall(self, *args, **kwargs): - """Send whole message to the socket. Unsupported, do not use.""" - # Not supported due to https://github.com/pyca/pyopenssl/issues/176. - # Until that bug is fixed, sendall() may throw SSL.WantWriteError, but - # there is no correct way to retry the call because we don't know how - # many bytes were already transmitted. We could work around this by - # reimplementing sendall() using send(), but we don't actually use - # sendall() anywhere. - raise NotImplementedError('sendall() is unsupported by pyOpenSSL') + """Send whole message to the socket.""" + return self._safe_call( + False, + super(SSLFileobjectMixin, self).sendall, + *args, **kwargs + ) def send(self, *args, **kwargs): """Send some part of message to the socket."""