Skip to content

Commit

Permalink
Ensure we return if unable to send cached data to the socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Jul 1, 2016
1 parent 4230068 commit 6c4fa53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,9 @@ ws_respond_cache (WSClient * client)
if (bytes == -1 && errno == EPIPE)
return ws_set_status (client, WS_ERR | WS_CLOSE, bytes);

if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
return bytes;

if (chop_nchars (queue->queued, bytes, queue->qlen) == 0)
ws_clear_queue (client);
else
Expand Down

0 comments on commit 6c4fa53

Please sign in to comment.