diff options
author | Pokrovskiy <pokroa@amazon.com> | 2015-04-21 00:53:59 -0700 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2015-04-22 07:50:44 +0800 |
commit | 20636ec97090c0e6583e1a5966c95c879faded47 (patch) | |
tree | 5329dcb8c99c0862f30296f445af7b2c217ebc59 /lib/client-handshake.c | |
parent | 40d5abc2aae82daf31876eb45aa30c9e6329dfdf (diff) | |
download | libwebsockets-20636ec97090c0e6583e1a5966c95c879faded47.tar.gz libwebsockets-20636ec97090c0e6583e1a5966c95c879faded47.tar.bz2 libwebsockets-20636ec97090c0e6583e1a5966c95c879faded47.zip |
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().
Diffstat (limited to 'lib/client-handshake.c')
-rw-r--r-- | lib/client-handshake.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |