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
Per Bothner
f7631b7a10
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:44:36 +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
7c6e3a8aeb
http: urlarg capture fixes
2018-06-20 16:41:28 +08:00
Andy Green
e9d1782863
http: skip NULs between fragments
2018-06-20 16:41:28 +08:00
Silas Parker
b30af71ad8
client: off-by-one in redirect max length calc
...
https://libwebsockets.org/pipermail/libwebsockets/2018-June/003729.html
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
Fabio Alessandrelli
d44fe7a280
Add fix for forward declaration in BSD
2018-06-08 05:47:41 +08:00
Andy Green
6d72ef4768
client: pipelining needs ah reset at client transaction completed
2018-06-04 07:14:42 +08:00
Ecionis
794c70cdc0
windows: fix microseconds time calculation
...
https://github.com/warmcat/libwebsockets/issues/1297
2018-06-02 06:01:47 +08:00
Alfred Sawaya
37f2297b2a
fix memleak when role h1 failed to upgrade to websocket
2018-06-02 05:57:26 +08:00
emptyVoid
43bb340566
Fixed a couple of runtime issues introduced in commit 44efcd6
.
2018-06-02 05:56:19 +08:00
Andy Green
44efcd6196
windows: remove unused event array
2018-05-26 19:41:06 +08:00
qmatt
7c12b88bc2
lwsl_debug: NOP if no _DEBUG
2018-05-26 09:07:31 +08:00
Andy Green
78e6c962f8
client: fix SOCKS5 compilation
...
https://github.com/warmcat/libwebsockets/issues/1292
2018-05-25 21:43: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
0d787fa312
ws: pingpong: server wants to send pings too
...
During the role refactoring pingpong accidentally
became something only a client wsi could initiate.
https://github.com/warmcat/libwebsockets/issues/1283
2018-05-22 16:28:50 +08:00
Andy Green
621cdd7c4f
adopt: fix raw protocol binding
2018-05-21 14:43:40 +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
290e4f1e44
mbedtls: allow build with LWS_ROLE_WS=0
2018-05-11 16:41:34 +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
064c548f9b
lws_read_h1: handle LRS_RETURNED_CLOSE
2018-05-11 10:25:28 +08:00
Andy Green
f6f7c7e228
TCP_USER_TIMEOUT: make sure we include the correct header if linux
2018-05-10 19:31:05 +08:00
Andy Green
a4b44320c0
role ws: allow zero length PONG
2018-05-09 18:06:45 +08:00
Andy Green
6c1fbbf4cb
minimal-ws-client-ping
2018-05-09 17:00:37 +08:00
Andy Green
7bced4fac7
LWS_INLINE: replace all inline
2018-05-09 09:28:06 +08:00
Andy Green
2f5f1125f7
esp32: align hrtimer and avoid compiler warning
2018-05-07 13:34:14 +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
c99a99e9b4
LRS_DOING_TRANSACTION
2018-05-04 12:05:56 +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
Andy Green
a01ad0dd20
hrtimer: add support for libevent and libev
2018-05-02 19:27:33 +08:00
Andy Green
9cce1874b0
context_destroy: figure out if anything still in event loop
2018-05-02 19:27:29 +08:00
Andy Green
bce8cca042
refactor: also migrate tls to the ops struct and private.h pattern
...
Several new ops are planned for tls... so better to bite the bullet and
clean it out to the same level as roles + event-libs first.
Also adds a new travis target "mbedtls" and all the tests except
autobahn against mbedtls build.
2018-05-02 12:10:36 +08:00
Andy Green
da0be64f68
minimal-raw-netcat
...
Adapt attack.sh to use it instead of OS netcat and fox various bugs that
exposed.
2018-05-02 08:46:16 +08:00
Andy Green
f1c56bc233
alpn: allow NULL alpn in role struct when scanning for match
...
https://github.com/warmcat/libwebsockets/issues/1262
2018-05-01 18:15:52 +08:00
Andy Green
f497562a62
refactor: change event lib minimal examples to serve as the test apps
2018-04-30 19:17:32 +08:00
Andy Green
0b52d92d12
refactor: remove more test apps and replace with minimal-examples
2018-04-30 09:16:04 +08:00
Andy Green
d37b383edc
refactor: apply ops structs to event loop handlers
2018-04-29 10:44:36 +08:00