event: set socket to wfds when sending queue is not empty
Don't sleep in select(2) when system is ready to send data.
This commit is contained in:
@@ -187,6 +187,8 @@ void xmpp_run_once(xmpp_ctx_t *ctx, const unsigned long timeout)
|
|||||||
break;
|
break;
|
||||||
case XMPP_STATE_CONNECTED:
|
case XMPP_STATE_CONNECTED:
|
||||||
FD_SET(conn->sock, &rfds);
|
FD_SET(conn->sock, &rfds);
|
||||||
|
if (conn->send_queue_len > 0)
|
||||||
|
FD_SET(conn->sock, &wfds);
|
||||||
break;
|
break;
|
||||||
case XMPP_STATE_DISCONNECTED:
|
case XMPP_STATE_DISCONNECTED:
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
|
|||||||
Reference in New Issue
Block a user