-
- Downloads
client: libuv: fix close handling during redirect
During client redirect we "reset" the wsi to the redirect address, involving closing the current fd that was told to redirect (it will usually be a completely different server or port). With libuv and its two-stage close that's not trivial. This solves the problem we will "reset" (overwrite) where the handle lives in the wsi with new a new connection / handle by having it copied out into an allocated watcher struct, which is freed in the uv close callback. To confirm it the minimal ws client example gets some new options, the original problem was replicated with this $ lws-minimal-ws-client-echo -s invalid.url.com -p 80 https://github.com/warmcat/libwebsockets/issues/1390
Showing
- lib/event-libs/libuv/libuv.c 7 additions, 3 deletionslib/event-libs/libuv/libuv.c
- lib/roles/http/client/client-handshake.c 2 additions, 2 deletionslib/roles/http/client/client-handshake.c
- minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c 15 additions, 8 deletions...ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c
Loading
Please register or sign in to comment