kill recv() timer if we have data.

also reset any exception that is set when we have successfully
read data from a socket.
This commit is contained in:
Joris Vink 2019-03-04 16:37:25 +01:00
parent a0c203f507
commit 61863bfd3a
1 changed files with 8 additions and 0 deletions

View File

@ -2117,6 +2117,14 @@ pysocket_async_recv(struct pysocket_op *op)
break;
}
op->data.coro->exception = NULL;
op->data.coro->exception_msg = NULL;
if (op->data.timer != NULL) {
kore_timer_remove(op->data.timer);
op->data.timer = NULL;
}
if (op->data.type == PYSOCKET_TYPE_RECV && ret == 0) {
PyErr_SetNone(PyExc_StopIteration);
return (NULL);