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

378 commits

Author SHA1 Message Date
Andy Green
0222cd25b0 lws_get_peer_write_allowance: cope with no role callback for it
https://github.com/warmcat/libwebsockets/issues/1339
2018-07-17 18:29:05 +08:00
James Chicca
6648e01072 foreach_ll_safe 2018-07-11 15:17:58 +08:00
Andy Green
5af32fe27d logging: stderr: reduce brightness of some ANSI loglevels 2018-06-30 09:54:22 +08:00
Andy Green
855114e39a smp: context lock around vhost destroy 2018-06-27 09:18:24 +08:00
Andy Green
b58fb2dae3 lws_mutex_refcount
This creates a "pthread mutex with a reference count"
using gcc / clang atomic intrinsics + pthreads.

Both pt and context locks are moved to use this,
pt already had reference counting but it's new for
context.
2018-06-27 07:15:39 +08:00
Andy Green
f2f96857d6 fd_cloexec: add and use lws_open wrapper and lws_plat_apply_FD_CLOEXEC() on cgi 2018-06-23 12:56:21 +08:00
negativekelvin
bd9c1b715f Fixes to track updates in esp-idf 2018-06-20 16:41:28 +08:00
Andy Green
4d252d847b max_http_header_pool2: migrate context ah pool limit and count to unsigned int 2018-06-20 16:41:28 +08:00
Andy Green
1eb4ac4b41 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-20 16:41:27 +08:00
Andy Green
d84aebd43a 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-20 16:41:27 +08:00
Andy Green
df1d60fc1a plat: refactor private headers and split files
Also remove LWS_VISIBLE that are not necessary from plat apis
2018-06-20 16:41:27 +08:00
Andy Green
ac3bd36c60 vhost_destroy: use vhost wsi reference counting to trigger destroy
This changes the vhost destroy flow to only hand off the listen
socket if another vhost sharing it, and mark the vhost as
being_destroyed.

Each tsi calls lws_check_deferred_free() once a second, if it sees
any vhost being_destroyed there, it closes all wsi on its tsi on
the same vhost, one time.

As the wsi on the vhost complete close (ie, after libuv async close
if on libuv event loop), they decrement a reference count for all
wsi open on the vhost.  The tsi who closes the last one then
completes the destroy flow for the vhost itself... it's random
which tsi completes the vhost destroy but since there are no
wsi left on the vhost, and it holds the context lock, nothing
can conflict.

The advantage of this is that owning tsi do the close for wsi
that are bound to the vhost under destruction, at a time when
they are guaranteed to be idle for service, and they do it with
both vhost and context locks owned, so no other service thread
can conflict for stuff protected by those either.

For the situation the user code may have allocations attached to
the vhost, this adds args to lws_vhost_destroy() to allow destroying
the user allocations just before the vhost is freed.
2018-06-18 09:11:46 +08:00
Andy Green
d2bdb60a17 cgi: fix for https git server 2018-06-16 09:35:07 +08:00
emptyVoid
43bb340566 Fixed a couple of runtime issues introduced in commit 44efcd6. 2018-06-02 05:56:19 +08:00
qmatt
7c12b88bc2 lwsl_debug: NOP if no _DEBUG 2018-05-26 09:07:31 +08:00
Andy Green
9488424b8d 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 10:49:05 +08:00
Andy Green
0f9c75f6b5 dummy: add transaction completed processing for POST 2018-05-24 12:48:05 +08:00
Andy Green
0a1d54a3c4 h2 client: no close callback for network stream 2018-05-24 11:26:09 +08:00
Andy Green
a177285b9c cgi: fix QUERY_STRING 2018-05-18 08:40:18 +08:00
Andy Green
8527764095 windows: must test socket against LWS_SOCK_INVALID 2018-05-18 08:40:15 +08:00
Andy Green
3d96df62d0 udp: cast sendto payload to be compatible with windows perversions
https://github.com/warmcat/libwebsockets/issues/1277
2018-05-16 08:13:59 +08:00
Andy Green
502130d999 refactor: split out adoption and client apis to core
- split raw role into separate skt and file

 - remove all special knowledge from the adoption
   apis and migrate to core

 - remove all special knowledge from client_connect
   stuff, and have it discovered by iterating the
   role callbacks to let those choose how to bind;
   migrate to core

 - retire the old deprecated client apis pre-
   client_connect_info
2018-05-11 10:29:08 +08:00
Andy Green
7bced4fac7 LWS_INLINE: replace all inline 2018-05-09 09:28:06 +08:00
Andy Green
412ff64be9 lws_ring: implement lagging client culling 2018-05-06 07:36:31 +08:00
Andy Green
c4dc102a0b windows: cleanup wrong and duplicated socket validity helpers
https://github.com/warmcat/libwebsockets/issues/1259
2018-05-06 07:22:25 +08:00
Andy Green
e77dafba6f win32: align hrtimer support with unix plat
Workaround last build warnings on win32.
2018-05-05 07:18:00 +08:00
Andy Green
e7673b4c1d coverity: check argv 2018-05-05 06:58:52 +08:00
Andy Green
de064fd65a refactor: core code in lib/core and private-libwebsockets.h to core/private.h
This commit is coverity-clean as tested

cmake .. -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITHOUT_EXTENSIONS=1 -DLWS_WITH_ACME=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_HTTP2=1 -DLWS_WITHOUT_CLIENT=0 -DLWS_WITHOUT_SERVER=0 -DLWS_UNIX_SOCK=1 -DLWS_WITH_TLS=0 -DLWS_WITH_MBEDTLS=0 -DLWS_WITH_CGI=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_GENERIC_SESSIONS=1 -DLWS_WITH_RANGES=1 -DLWS_ROLE_WS=1 -DLWS_MAX_SMP=16 -DLWS_ROLE_H1=1 -DLWS_WITH_WOLFSSL=0 -DLWS_WITH_LIBEV=0 -DLWS_WITH_LIBEVENT=1
2018-05-03 10:49:36 +08:00