1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Fix #610 - POLLHUP should cause us to continue reading.

This commit is contained in:
Calvin Rose 2021-01-23 14:26:24 -06:00
parent 0b14e913da
commit a2801fbef9

View File

@ -1614,8 +1614,7 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
} }
break; break;
#else #else
case JANET_ASYNC_EVENT_ERR: case JANET_ASYNC_EVENT_ERR: {
case JANET_ASYNC_EVENT_HUP: {
if (state->bytes_read) { if (state->bytes_read) {
janet_schedule(s->fiber, janet_wrap_buffer(state->buf)); janet_schedule(s->fiber, janet_wrap_buffer(state->buf));
} else { } else {
@ -1623,6 +1622,7 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
} }
return JANET_ASYNC_STATUS_DONE; return JANET_ASYNC_STATUS_DONE;
} }
case JANET_ASYNC_EVENT_HUP:
case JANET_ASYNC_EVENT_READ: { case JANET_ASYNC_EVENT_READ: {
JanetBuffer *buffer = state->buf; JanetBuffer *buffer = state->buf;
int32_t bytes_left = state->bytes_left; int32_t bytes_left = state->bytes_left;