Mercurial > pidgin.yaz
diff libpurple/protocols/oscar/flap_connection.c @ 17671:648551e3243a
Only check for EAGAIN if send returns -1, not when it returns 0
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 03 Jun 2007 19:04:22 +0000 |
parents | f80f7e1047be |
children | a88796a81413 |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/flap_connection.c Sun Jun 03 18:36:54 2007 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Sun Jun 03 19:04:22 2007 +0000 @@ -303,7 +303,7 @@ } } - if (conn->fd != -1) + if (conn->fd >= 0) { if (conn->type == SNAC_FAMILY_LOCATE) flap_connection_send_close(od, conn); @@ -792,7 +792,7 @@ } /* If there was an error then close the connection */ - if (read == -1) + if (read < 0) { if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) /* No worries */ @@ -853,7 +853,7 @@ break; } - if (read == -1) + if (read < 0) { if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) /* No worries */ @@ -902,7 +902,7 @@ ret = send(conn->fd, conn->buffer_outgoing->outptr, writelen, 0); if (ret <= 0) { - if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) + if (ret < 0 && ((errno == EAGAIN)) || ((errno == EWOULDBLOCK))) /* No worries */ return; @@ -936,7 +936,7 @@ purple_circ_buffer_append(conn->buffer_outgoing, bs->data, count); /* If we haven't already started writing stuff, then start the cycle */ - if ((conn->watcher_outgoing == 0) && (conn->fd != -1)) + if ((conn->watcher_outgoing == 0) && (conn->fd >= 0)) { conn->watcher_outgoing = purple_input_add(conn->fd, PURPLE_INPUT_WRITE, send_cb, conn);