commit b06160c76825f3036c49ad07f35a1314c36db6c7
parent 3b4574d791450f284e4696fb6ef19c3065fabd8a
Author: Joris Vink <joris@coders.se>
Date: Wed, 13 Mar 2019 15:45:55 +0100
Make sure coros are woken up on eof.
Diffstat:
src/python.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/python.c b/src/python.c
@@ -2255,7 +2255,8 @@ pysocket_evt_handle(void *arg, int eof)
struct pysocket_event *event = arg;
struct pysocket *socket = event->s;
- if ((event->evt.flags & KORE_EVENT_READ) && socket->recvop != NULL) {
+ if ((eof || (event->evt.flags & KORE_EVENT_READ)) &&
+ socket->recvop != NULL) {
if (socket->recvop->coro->request != NULL)
http_request_wakeup(socket->recvop->coro->request);
else
@@ -2263,7 +2264,8 @@ pysocket_evt_handle(void *arg, int eof)
socket->recvop->eof = eof;
}
- if ((event->evt.flags & KORE_EVENT_WRITE) && socket->sendop != NULL) {
+ if ((eof || (event->evt.flags & KORE_EVENT_WRITE)) &&
+ socket->sendop != NULL) {
if (socket->sendop->coro->request != NULL)
http_request_wakeup(socket->sendop->coro->request);
else