Skip to content

Commit

Permalink
Fix #610 - POLLHUP should cause us to continue reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Jan 23, 2021
1 parent 0b14e91 commit a2801fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/ev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,15 +1614,15 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
}
break;
#else
case JANET_ASYNC_EVENT_ERR:
case JANET_ASYNC_EVENT_HUP: {
case JANET_ASYNC_EVENT_ERR: {
if (state->bytes_read) {
janet_schedule(s->fiber, janet_wrap_buffer(state->buf));
} else {
janet_schedule(s->fiber, janet_wrap_nil());
}
return JANET_ASYNC_STATUS_DONE;
}
case JANET_ASYNC_EVENT_HUP:
case JANET_ASYNC_EVENT_READ: {
JanetBuffer *buffer = state->buf;
int32_t bytes_left = state->bytes_left;
Expand Down

0 comments on commit a2801fb

Please sign in to comment.