Skip to content

Commit

Permalink
Don't log OSError in transports
Browse files Browse the repository at this point in the history
Resolves #257.
  • Loading branch information
Tobotimus authored and 1st1 committed Aug 14, 2019
1 parent 1fad621 commit 10214b5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion uvloop/handles/basetransport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cdef class UVBaseTransport(UVSocketHandle):

self._force_close(exc)

if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if not isinstance(exc, OSError):

if throw or self._loop is None:
raise exc
Expand Down
2 changes: 1 addition & 1 deletion uvloop/handles/streamserver.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cdef class UVStreamServer(UVSocketHandle):

self._close()

if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if not isinstance(exc, OSError):

if throw or self._loop is None:
raise exc
Expand Down
7 changes: 0 additions & 7 deletions uvloop/includes/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ cdef int ssl_SSL_ERROR_WANT_READ = ssl.SSL_ERROR_WANT_READ
cdef int ssl_SSL_ERROR_WANT_WRITE = ssl.SSL_ERROR_WANT_WRITE
cdef int ssl_SSL_ERROR_SYSCALL = ssl.SSL_ERROR_SYSCALL

cdef FATAL_SSL_ERROR_IGNORE = (
BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError,
ssl.CertificateError,
)

cdef uint64_t MAIN_THREAD_ID = <uint64_t><int64_t>threading.main_thread().ident

cdef int subprocess_PIPE = subprocess.PIPE
Expand Down
2 changes: 1 addition & 1 deletion uvloop/sslproto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ cdef class SSLProtocol:
if self._transport:
self._transport._force_close(exc)

if isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if isinstance(exc, OSError):
if self._loop.get_debug():
aio_logger.debug("%r: %s", self, message, exc_info=True)
elif not isinstance(exc, aio_CancelledError):
Expand Down

0 comments on commit 10214b5

Please sign in to comment.