Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3c3bbef

Browse files
udp errors should result in protocol.error_received (#601)
1 parent 4083a94 commit 3c3bbef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎uvloop/handles/udp.pyx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,15 @@ cdef class UDPTransport(UVBaseTransport):
244244
ctx.close()
245245

246246
exc = convert_error(err)
247-
self._fatal_error(exc, True)
247+
if isinstance(exc, OSError):
248+
run_in_context1(self.context.copy(), self._protocol.error_received, exc)
249+
else:
250+
self._fatal_error(exc, True)
248251
else:
249252
self._maybe_pause_protocol()
250253

251254
else:
252-
if err < 0:
253-
exc = convert_error(err)
254-
self._fatal_error(exc, True)
255-
else:
256-
self._on_sent(None, self.context.copy())
255+
self._on_sent(convert_error(err) if err < 0 else None, self.context.copy())
257256

258257
cdef _on_receive(self, bytes data, object exc, object addr):
259258
if exc is None:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /