1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00
Commit graph

2661 commits

Author SHA1 Message Date
Andy Green
783540deaf 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
2018-09-02 19:32:23 +08:00
Andy Green
153cbf871f log client IP of well-wishers
Although getting a million of these doesn't make any trouble for lws, the
source should be logged.
2018-09-02 06:56:09 +08:00
Andy Green
52b55d8be5 ws role: wsi ws may not have been allocated by time of close 2018-09-02 06:55:52 +08:00
Andy Green
6646b8d31c genhmac: expose as VISIBLE 2018-08-30 06:03:41 +08:00
Sebastián Katzer
1fa0d496bb Fix Iphlpapi.h -> iphlpapi.h
If you cross compile for Windows you will get an error otherwise that the header cannot be found.
See here for code example from microsoft: https://docs.microsoft.com/en-us/windows/desktop/iphlp/creating-a-basic-ip-helper-application
2018-08-30 05:41:18 +08:00
Martin Milata
2950cf14bb Ignore unknown headers in multipart file upload 2018-08-28 06:57:41 +08:00
Andy Green
9d51d8e702 LWS_WITH_STATS: clean refactor dust
https://github.com/warmcat/libwebsockets/issues/1383
2018-08-25 05:45:00 +08:00
Andy Green
a0c558df11 lejp-conf: allow header value part to exceed one string chunk 2018-08-24 16:10:36 +08:00
Andy Green
290208c19e lejp: always allow an extra byte at the end of the string buffer for NUL 2018-08-24 16:08:29 +08:00
Andy Green
446c790525 h2: use vhost headers with tolower adaptation
h2 was not applying vhost headers, make it do so.

Also adapt any header names to lower-case as required by h2.
2018-08-24 16:08:18 +08:00
Frank May
1a44e20b6a windows: fix timeout between writes on Windows
After servicing a writable socket, we need to set timeout_ms
to zero. This makes WSAWaitForMultipleEvents() return immediately
after checking events.
2018-08-19 06:55:06 +08:00
Frank May
8878af39f9 windows: Remove useless code
WSASetEvent(pt->events) just makes WSAWaitForMultipleEvents()
return, it will not set LWS_POLLOUT in pfd->revents and thus
has IMHO no effect. If WSAWaitForMultipleEvents() will set
LWS_POLLOUT it will also signal the event automatically.
2018-08-19 06:53:11 +08:00
Frank May
48fe07313f windows: fix possible crash
Checking for (!wsi) does not make sense, if wsi is
dereferenced in the line above.
2018-08-19 06:49:04 +08:00
Frank May
1001d55385 windows: Ignore Visual Studio internal files 2018-08-19 06:46:15 +08:00
Andy Green
5260a49e3b libwebsockets.h: clean out some boilerplate better put in core/private.h
https://github.com/warmcat/libwebsockets/issues/1370
2018-08-16 19:11:54 +08:00
Andy Green
aa03468740 lejp: improve bogus JSON underrun detection
https://github.com/warmcat/libwebsockets/issues/1357
2018-08-01 07:04:18 +08:00
Andy Green
d9e6263323 client: use effective wsi for some callbacks 2018-07-21 09:07:58 +08:00
Andy Green
9a1462d221 client: use lws_strdup for client_hostname_copy
https://github.com/warmcat/libwebsockets/issues/1343
2018-07-19 06:16:15 +08:00
Andy Green
264583fe7d lws_get_peer_write_allowance: cope with no role callback for it
https://github.com/warmcat/libwebsockets/issues/1339
2018-07-17 18:29:25 +08:00
Dmytro Ivanov
b3cf069733 Android: Fixing missing sockaddr_in definition. 2018-07-16 09:39:04 +08:00
chrisplusplus
55e914693e Update protocol_lws_minimal_server_echo.c
This plugin will not compile as a plugin without changing
LWS_PLUGIN_PROTOCOL_MINIMAL_server_echo to
LWS_PLUGIN_PROTOCOL_MINIMAL_SERVER_ECHO
2018-07-11 15:30:18 +08:00
shinny-chengzhi
888b030bae windows: fix io hang after large deflate frame
Fix I/O hang after received a large deflate frame
2018-07-11 15:29:09 +08:00
張俊芝
8f5738299a Fixes the binding error when SMP in tandem with a Unix domain socket 2018-07-08 20:51:25 +08:00
Andy Green
6517e01258 pmd: fix stray client-only
Fix wrong loglevels on some pmd debug stuff

Small cosmetic cleaning
2018-06-30 09:55:07 +08:00
Andy Green
f85b2e978b logging: stderr: reduce brightness of some ANSI loglevels 2018-06-30 09:55:07 +08:00
Rosen Penev
578ac00a3a openssl: Fix compile with 1.1.0 - deprecated APIs
These function have been deprecated. Keep compatibility with OpenSSL 1.0.2 as it is still supported.
2018-06-30 09:43:27 +08:00
Dominyk Tiller
c708bda0f4 libwebsockets.h: include new libuv header 2018-06-24 10:57:51 +08:00
Dominyk Tiller
ff39794eb7 CMakeLists: add check for new libuv header 2018-06-24 10:57:48 +08:00
Andy Green
aea3ef2a5a fd_cloexec: add and use lws_open wrapper and lws_plat_apply_FD_CLOEXEC() on cgi
This adds lws_open() like master, but unlike master, it can't add it as a
public api.  Instead it's used internally only.
2018-06-23 13:02:12 +08:00
Per Bothner
dfb4dde763 sockets: FD_CLOEXEC
If the user code forks, it inherits open copies of all
lws sockets, which conflict if lws later decides to
close them.
2018-06-23 05:47:01 +08:00
Andy Green
b49ef8b6d1 http: urlarg capture fixes 2018-06-19 13:32:27 +08:00
Andy Green
635ecb450c http: skip NULs between fragments 2018-06-19 13:32:15 +08:00
Andy Green
bdedd1a910 max_http_header_pool2: migrate context ah pool limit and count to unsigned int 2018-06-19 13:30:50 +08:00
Silas Parker
f42c1064ce client: off-by-one in redirect max length calc
https://libwebsockets.org/pipermail/libwebsockets/2018-June/003729.html
2018-06-18 18:41:46 +08:00
Andy Green
f195550972 minimal-http-server-dynamic: add tls vhost as well 2018-06-16 13:49:39 +08:00
Andy Green
f256fdea05 LWS_ILLEGAL_HTTP_CONTENT_LEN implies connection:close
If no content-length is coming, we just can't do
http/1.1 keep-alive.
2018-06-16 13:49:39 +08:00
Andy Green
d1ca974b9f http: defer transaction completed if partial pending
This is only helpful for http/1... the real solution is cut up
sending large things.
2018-06-16 13:24:26 +08:00
Fabio Alessandrelli
80e1c85258 Add fix for forward declaration in BSD 2018-06-08 05:48:35 +08:00
Andy Green
08f47c84d2 sshd: make sure no aliases on last_alloc 2018-06-07 09:44:35 +08:00
Andy Green
3a499dd53d client: pipelining needs ah reset at client transaction completed 2018-06-04 07:15:39 +08:00
Andy Green
b63ffd9184 minimal ring: keep coverity happy for NULL pointer possibility 2018-06-03 17:11:21 +08:00
Ecionis
6b9306d165 windows: fix microseconds time calculation
https://github.com/warmcat/libwebsockets/issues/1297
2018-06-02 05:59:30 +08:00
Alfred Sawaya
3f7ffeddac fix memleak when role h1 failed to upgrade to websocket 2018-06-02 05:57:40 +08:00
d2b47b458b rpm: add missing build-time dependencies 2018-05-26 09:17:42 +08:00
9ba68a64c0 rpm: do parallel compilation during rpm builds 2018-05-26 09:17:36 +08:00
4b539e3b0f rpm: add missing test-apps to spec file 2018-05-26 09:17:29 +08:00
13f70dde2b rpm: fix bogus date in changelog 2018-05-26 09:17:23 +08:00
3e25edf1ee cmake: CPACK_SOURCE_IGNORE_FILES is a list of regular expressions 2018-05-26 09:17:15 +08:00
qmatt
0425d962e5 lwsl_debug: NOP if no _DEBUG 2018-05-26 09:07:08 +08:00
Andy Green
49c7e8238b cancel pipes: treat nonzero return code from platform only as indication not to use dummy_pipe_fds
https://github.com/warmcat/libwebsockets/issues/1291
2018-05-25 21:45:36 +08:00