8000 Deal with BrokenPipeError since openssl 3.4.x. by pmgdeb · Pull Request #2103 · gevent/gevent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deal with BrokenPipeError since openssl 3.4.x. #2103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/greentest/3.10/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,6 @@ def wrap_conn(self):
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
self.running = False
self.server.stop()
self.close()
return False
else:
Expand Down Expand Up @@ -2620,9 +2619,6 @@ def run(self):
self.close()
self.running = False

# normally, we'd just stop here, but for the test
# harness, we want to stop the server
self.server.stop()

def __init__(self, certificate=None, ssl_version=None,
certreqs=None, cacerts=None,
Expand Down Expand Up @@ -2657,21 +2653,33 @@ def __init__(self, certificate=None, ssl_version=None,
self.conn_errors = []
threading.Thread.__init__(self)
self.daemon = True
self._in_context = False

def __enter__(self):
if self._in_context:
raise ValueError('Re-entering ThreadedEchoServer context')
self._in_context = True
self.start(threading.Event())
self.flag.wait()
return self

def __exit__(self, *args):
assert self._in_context
self._in_context = False
self.stop()
self.join()

def start(self, flag=None):
if not self._in_context:
raise ValueError(
'ThreadedEchoServer must be used as a context manager')
self.flag = flag
threading.Thread.start(self)

def run(self):
if not self._in_context:
raise Val 10000 ueError(
'ThreadedEchoServer must be used as a context manager')
self.sock.settimeout(1.0)
self.sock.listen(5)
self.active = True
Expand Down
17 changes: 12 additions & 5 deletions src/greentest/3.11/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,6 @@ def wrap_conn(self):
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
self.running = False
self.server.stop()
self.close()
return False
else:
Expand Down Expand Up @@ -2627,10 +2626,6 @@ def run(self):
self.close()
self.running = False

# normally, we'd just stop here, but for the test
# harness, we want to stop the server
self.server.stop()

def __init__(self, certificate=None, ssl_version=None,
certreqs=None, cacerts=None,
chatty=True, connectionchatty=False, starttls_server=False,
Expand Down Expand Up @@ -2664,21 +2659,33 @@ def __init__(self, certificate=None, ssl_version=None,
self.conn_errors = []
threading.Thread.__init__(self)
self.daemon = True
self._in_context = False

def __enter__(self):
if self._in_context:
raise ValueError('Re-entering ThreadedEchoServer context')
self._in_context = True
self.start(threading.Event())
self.flag.wait()
return self

def __exit__(self, *args):
assert self._in_context
self._in_context = False
self.stop()
self.join()

def start(self, flag=None):
if not self._in_context:
raise ValueError(
'ThreadedEchoServer must be used as a context manager')
self.flag = flag
threading.Thread.start(self)

def run(self):
if not self._in_context:
raise ValueError(
'ThreadedEchoServer must be used as a context manager')
self.sock.settimeout(1.0)
self.sock.listen(5)
self.active = True
Expand Down
17 changes: 12 additions & 5 deletions src/greentest/3.12/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,6 @@ def wrap_conn(self):
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
self.running = False
self.server.stop()
self.close()
return False
else:
Expand Down Expand Up @@ -2435,10 +2434,6 @@ def run(self):
self.close()
self.running = False

# normally, we'd just stop here, but for the test
# harness, we want to stop the server
self.server.stop()

def __init__(self, certificate=None, ssl_version=None,
certreqs=None, cacerts=None,
chatty=True, connectionchatty=False, starttls_server=False,
Expand Down Expand Up @@ -2472,21 +2467,33 @@ def __init__(self, certificate=None, ssl_version=None,
self.conn_errors = []
threading.Thread.__init__(self)
self.daemon = True
self._in_context = False

def __enter__(self):
if self._in_context:
raise ValueError('Re-entering ThreadedEchoServer context')
self._in_context = True
self.start(threading.Event())
self.flag.wait()
return self

def __exit__(self, *args):
assert self._in_context
self._in_context = False
self.stop()
self.join()

def start(self, flag=None):
if not self._in_context:
raise ValueError(
'ThreadedEchoServer must be used as a context manager')
self.flag = flag
threading.Thread.start(self)

def run(self):
if not self._in_context:
raise ValueError(
'ThreadedEchoServer must be used as a context manager')
self.sock.settimeout(1.0)
self.sock.listen(5)
self.active = True
Expand Down
0