From 20636ec97090c0e6583e1a5966c95c879faded47 Mon Sep 17 00:00:00 2001 From: Pokrovskiy Date: Tue, 21 Apr 2015 00:53:59 -0700 Subject: Fix broken libev support in client mode Maybe it will be better to move all lws_libev_io() inside lws_change_pollfd() to avoid similar problems in future. The same for lws_libev_accept() and insert_wsi_socket_into_fds(). --- lib/client-handshake.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/client-handshake.c') diff --git a/lib/client-handshake.c b/lib/client-handshake.c index cff93fab..ebb0dafc 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -151,6 +151,7 @@ struct libwebsocket *libwebsocket_client_connect_2( wsi->mode = LWS_CONNMODE_WS_CLIENT_WAITING_CONNECT; + lws_libev_accept(context, wsi, wsi->sock); insert_wsi_socket_into_fds(context, wsi); libwebsocket_set_timeout(wsi, @@ -212,6 +213,7 @@ struct libwebsocket *libwebsocket_client_connect_2( */ if (lws_change_pollfd(wsi, 0, LWS_POLLOUT)) goto oom4; + lws_libev_io(context, wsi, LWS_EV_START | LWS_EV_WRITE); return wsi; } -- cgit v1.2.3