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

317 commits

Author SHA1 Message Date
Andy Green
4f99ccd6a8 heap instrumentation 2017-10-16 17:13:49 +08:00
Andy Green
fc995df480 CMake: convert all LWS_USE_... to LWS_WITH_...
Almost all the CMake options begin with LWS_WITH_..., but many of the
symbols passed to lws are LWS_USE_... , this causes neededless confusion,
compounded by the fact that a few CMake options also begin with
LWS_USE_.

This patch globally converts all LWS_USE_... to LWS_WITH_..., so there
is only one prefix to remember in both CMake and the code.

The affected public CMake options are

LWS_USE_BORINGSSL     ->  LWS_WITH_BORINGSSL
LWS_USE_CYASSL        ->  LWS_WITH_CYASSL
LWS_USE_WOLFSSL       ->  LWS_WITH_WOLFSSL
LWS_USE_MBEDTLS       ->  LWS_WITH_MBEDTLS
LWS_USE_BUNDLED_ZLIB  ->  LWS_WITH_BUNDLED_ZLIB
2017-10-16 17:13:48 +08:00
Andy Green
7597ac3766 Plugins: add ssh-base ssh server plugin 2017-10-16 16:59:57 +08:00
Andy Green
49f8029677 coverity fixes 2017-09-27 08:24:05 +08:00
Andy Green
c52a6267ab clean 2017-09-27 08:24:05 +08:00
Andy Green
d1859ad4fd logging: move most everything during startup to info 2017-09-21 08:45:56 +08:00
Andy Green
98df6722ea LWS_WITH_PEER_LIMITS
Introduces an optional, settable restriction on the number of
simultaneous wsi connections and ah that a single peer IP can
obtain.

The default is disabled for build, and if enabled, unlimited.

However when enabled at CMake, setting info.ip_limit_ah and / or
info.ip_limit_wsi at context creation time will enforce the limits.

Connections past the info.ip_limit_wsi limit are dropped, and
connections needing an ah are forced to stay in the ah waiting list
even when ah are available, while the peer is at the number of
ah in info.ip_limit_ah.
2017-09-19 12:09:17 +08:00
Andy Green
4efc35db58 LWS_WITH_STATS: dont add latency when start point not set
Also fix lws_meta child connections to also measure their
own latency.
2017-09-19 12:09:17 +08:00
Andy Green
d38f630519 logging: reduce timeout and detach logs to info 2017-09-08 20:56:04 +08:00
Andy Green
8d63fbb6aa ACCESS_LOG: allow early rejected accesses to log 2017-09-06 09:30:32 +08:00
Andy Green
debb7aa043 LWS_WITH_ACCESS_LOG: add referrer to log format and quotes around user agent
This also forces any double-quotes in the UA or referrer to be single-quotes.

This aligns to log to the "combined log format" described here

https://httpd.apache.org/docs/1.3/logs.html#combined
2017-08-27 20:18:48 +08:00
Andy Green
5da9ce2f06 ah: reuse at end of transaction has no timeout
If we complete a transaction but end up keeping the ah, we must force
a timeout on it.  Otherwise a bad bot could keep the socket open and
exhaust the ah pool.
2017-08-15 07:58:53 +08:00
lnmx
b93c057472 send content-type when LWS_WITH_RANGES=OFF
https://github.com/warmcat/libwebsockets/pull/987

With the RANGES feature disabled, lws_serve_http_file would
not add the content-type header to the response.
2017-08-12 20:50:25 +08:00
Andy Green
855f7e8712 log: downgrade logging for ah wait 2017-07-28 07:04:47 +08:00
Andy Green
6c09952065 url cleaning: leave // after http[s]: alone 2017-07-21 20:04:02 +08:00
Andy Green
ad15082563 coverity-181580: supposedly dead code 2017-07-19 14:47:30 +08:00
Andy Green
3526fde154 coverity 181573: false positive since lws_is_ssl returns a bool 2017-07-19 14:37:04 +08:00
Andy Green
1690581cd2 coverity 181574: confirm uri_ptr non-null before deref 2017-07-19 14:19:03 +08:00
Andy Green
6f11c1361a lws-meta 2017-07-19 08:59:42 +08:00
Andy Green
faa1526b39 lws-vhost-destroy
Adds a new api lws_vhost_destroy(struct lws_vhost *) which allows dynamic removal of vhosts.

The external api calls two parts of internal helpers that get reused for context destroy.

The second part is called deferred by 5s... this is to ensure that event library objects
composed into structs owned by the vhost all have a chance to complete their close
asynchronously.  That should happen immediately, but it requires us to return to the
event loop first.

The vhost being removed is deleted from the context vhost list by the first part, and does
not block further removals or creation during the delay for the deferred freeing of the
vhost memory.

Part 1:

 - if the vhost owned a listen socket needed by other vhosts listening on same iface + port, the listen
   socket is first handed off to another vhost so it stays alive

 - all wsi still open on the vhost are forcibly closed (including any listen socket still attached)

 - inform all active protocols on the vhost they should destroy themselves

 - remove vhost from context vhost list (can no longer be found by incoming connections)

 - add to a "being destroyed" context list and schedule the second part to be called in 5s

Part 2:

 - remove us from the being destroyed list

 - free all allocations owned by the vhost

 - zero down the vhost and free the vhost itself


In libwebsockets-test-server, you can send it a SIGUSR1 to have it toggle the creation and destruction of
a second vhost on port + 1.
2017-07-19 08:51:43 +08:00
Andy Green
7262e14dc1 lws_intptr_t 2017-07-07 08:32:04 +08:00
Andy Green
ff9a24de1c parsing: if we ended on a set of headers and read a new buffer mark as more_rx_waiting to avoid dropping the ah 2017-06-29 10:13:29 +08:00
Andy Green
a637d8f41f file serve: defer transaction completed to HTTP_FILE_COMPLETION 2017-06-28 14:27:09 +08:00
Andy Green
8f4f692945 ah: require parsing complete before detach
Introduce helpers to force to detachable state and to test the ah is
in a detachable state.

Require not only the ah rx buffer is all used, but that the
wsi has completed a full set of headers.
2017-06-28 12:13:13 +08:00
Andy Green
bd23a401f6 transaction_completed: ignore if parsing not complete 2017-06-28 10:04:57 +08:00
Andy Green
34ef9743d2 serving: protect file sending from downgrading to waiting pipelined headers
https://github.com/warmcat/libwebsockets/issues/946
2017-06-28 10:04:57 +08:00
Andy Green
abc2a5cd2e windows: SO_EXCLUSIVEADDRUSE
https://github.com/warmcat/libwebsockets/issues/942
2017-06-26 08:36:49 +08:00
Andy Green
581b86efd0 HTTP_PROXY: make usable 2017-06-14 09:53:09 +08:00
WebsocketUser
0be9e98aae win32: enable 64-bit file lengths
https://github.com/warmcat/libwebsockets/issues/916

AG added more appveyor warning cleaning and stitched in cmake tests
2017-06-09 20:20:42 +08:00
Andy Green
02638f6758 large files: convert content-length to use lws_filepos_t 2017-06-07 08:20:18 +08:00
Leonardo Maccari Rufino
2ce39fe26c Subject: Support to IPv6 on Windows 2017-06-01 06:55:50 +08:00
Andy Green
a4f88d543e NULL protocol: make sure vhost same protocol linklist gets correct protocol index 2017-05-31 09:45:28 +08:00
Andy Green
49769a7c24 esp32: otf and use group-role as hostname if present 2017-05-22 14:01:08 +08:00
Andy Green
de12c860db cgi: allow time travelling headers to decide response code
https://github.com/warmcat/libwebsockets/issues/899
2017-05-18 21:19:57 +08:00
Andy Green
3198446d3c adoption: close socket manually if fails before add fds 2017-05-15 08:10:08 +08:00
Andy Green
fbc1ff6e7b stats: ah and ssl restriction stats 2017-05-15 07:30:06 +08:00
Andy Green
a7def3ce44 LWS_WITH_STATS 2017-05-09 14:19:43 +08:00
Andy Green
ba9d639792 ssl: only apply restriction if nonzero for vhost 2017-04-07 20:51:44 +08:00
Andy Green
47bbb044ad raw: defer creation callback until after fds inserted 2017-04-07 11:25:55 +08:00
Andy Green
19242db55b raw: take care about same vh protocol linked list 2017-04-06 13:49:17 +08:00
Andy Green
54c22623ab adopt: use default protocol in given vhost 2017-04-06 12:47:42 +08:00
Andy Green
6cae994750 adopt: LWS_SERVER_OPTION_ONLY_RAW to indicate a vhost only serves raw 2017-04-06 07:57:45 +08:00
Andy Green
34822f190d esp32: enforce ssl nonblocking 2017-04-03 14:09:37 +08:00
Andy Green
7faa71637f logs: reduce ah err to info 2017-04-02 13:01:07 +08:00
Andy Green
00ae90978b esp32: separate factory setup 2017-03-31 20:05:10 +08:00
Andy Green
311e3a585d spa: reject junk after finalization 2017-03-23 19:30:29 +08:00
Aditya Tirumala
ec50ebac12 Subject: Libevent: Initial Support
* Added libevent support functionality into lib/libevent.c
* Added test-server-libevent for testing
2017-03-22 05:36:25 +08:00
Andy Green
9287f7d1b3 ext: pmd: improve dealing with partial input usage with drain
https://github.com/warmcat/libwebsockets/issues/841
2017-03-20 19:07:19 +08:00
Andy Green
2e874dea50 windows: cannot use fstat 2017-03-17 11:43:45 +08:00
Andy Green
3a09c3b7d6 esp32: align fops member name defines 2017-03-08 11:11:41 +08:00