Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to keep the intended original error in the event the close_wrapper is ok #4

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/wslay_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ int wslay_event_recv(wslay_event_context_ptr ctx)
{
struct wslay_frame_iocb iocb;
ssize_t r;
ssize_t otherr;

while(ctx->read_enabled) {
memset(&iocb, 0, sizeof(iocb));
r = wslay_frame_recv(ctx->frame_ctx, &iocb);
Expand Down Expand Up @@ -733,10 +735,10 @@ int wslay_event_recv(wslay_event_context_ptr ctx)
} else {
if(r != WSLAY_ERR_WANT_READ ||
(ctx->error != WSLAY_ERR_WOULDBLOCK && ctx->error != 0)) {
if((r = wslay_event_queue_close_wrapper(ctx, 0, NULL, 0)) != 0) {
return r;
if((otherr = wslay_event_queue_close_wrapper(ctx, 0, NULL, 0)) != 0) {
return otherr;
}
return WSLAY_ERR_CALLBACK_FAILURE;
return r;
}
break;
}
Expand Down