mirror of https://github.com/MagicStack/uvloop.git
udp errors should result in protocol.error_received (#601)
This commit is contained in:
parent
4083a94e5c
commit
3c3bbeff34
|
@ -244,16 +244,15 @@ cdef class UDPTransport(UVBaseTransport):
|
||||||
ctx.close()
|
ctx.close()
|
||||||
|
|
||||||
exc = convert_error(err)
|
exc = convert_error(err)
|
||||||
self._fatal_error(exc, True)
|
if isinstance(exc, OSError):
|
||||||
|
run_in_context1(self.context.copy(), self._protocol.error_received, exc)
|
||||||
|
else:
|
||||||
|
self._fatal_error(exc, True)
|
||||||
else:
|
else:
|
||||||
self._maybe_pause_protocol()
|
self._maybe_pause_protocol()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if err < 0:
|
self._on_sent(convert_error(err) if err < 0 else None, self.context.copy())
|
||||||
exc = convert_error(err)
|
|
||||||
self._fatal_error(exc, True)
|
|
||||||
else:
|
|
||||||
self._on_sent(None, self.context.copy())
|
|
||||||
|
|
||||||
cdef _on_receive(self, bytes data, object exc, object addr):
|
cdef _on_receive(self, bytes data, object exc, object addr):
|
||||||
if exc is None:
|
if exc is None:
|
||||||
|
|
Loading…
Reference in New Issue