Skip to content

Commit

Permalink
Improve handling of EAGAIN, should fix 100% cpu usage issues
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
dequis committed Sep 11, 2016
1 parent e9aff87 commit 16f914d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libyahoo-plusplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,12 @@ yahoo_socket_got_data(gpointer userdata, PurpleSslConnection *conn, PurpleInputC
return;
}
}

if ((done_some_reads == FALSE && read_len <= 0 && errno != EAGAIN && errno != EINTR)) {

if (done_some_reads == FALSE && read_len <= 0) {
if (read_len < 0 && errno == EAGAIN) {
return;
}

purple_debug_error("yahoo", "got errno %d, read_len %d from websocket thread\n", errno, read_len);

if (ya->frames_since_reconnect < 2) {
Expand Down

0 comments on commit 16f914d

Please sign in to comment.