Commit graph

466 commits

Author SHA1 Message Date
Andy Green
2e5110e731 cgi: provide constants for reason_bf 2017-08-26 12:15:40 +08:00
Andy Green
872e8d7e9d docs: swap _all_protocol_vhost cut and paste
https://github.com/warmcat/libwebsockets/issues/989
2017-08-16 15:21:22 +08:00
Andy Green
219a367a4c esp32: allow return of default vhost at init time 2017-08-06 06:53:38 +08:00
Andy Green
93a5b586a3 lws_callback_all_protocol_vhost_args 2017-08-05 10:38:59 +08:00
Andy Green
ba45f7cf9f ah: allow configurable ah hold timeout 2017-07-26 11:49:41 +08:00
Andy Green
09f3947b4c lws_intptr_t: fix ordering
https://github.com/warmcat/libwebsockets/issues/973
2017-07-21 19:25:41 +08:00
Andy Green
6f11c1361a lws-meta 2017-07-19 08:59:42 +08:00
Andy Green
3b0066cb3f close: make close notification go through writable
Until now we took the approach if just writing the close notification
broke something, we didn't care because we were closing the connection
anyway.

But with lws_meta, breaking stuff in the parent connection would be a
sticky problem outliving the closing child connection.

So this adds a new wsi state LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION
and makes the send go via the writable callback mechanism.
2017-07-19 08:55:57 +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
632a0acc99 clean: fixes for appveyor warnings 2017-07-19 04:25:20 +08:00
Andy Green
a15007269e libuv: add helper for clean valgrind with foreign loop 2017-07-19 04:10:07 +08:00
Andy Green
e2a926de2f linkedlist helpers 2017-07-09 10:11:59 +08:00
Andy Green
7262e14dc1 lws_intptr_t 2017-07-07 08:32:04 +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
3ff720ff66 support openssl info callback
https://github.com/warmcat/libwebsockets/issues/936
2017-06-20 11:46:49 +08:00
Andy Green
581b86efd0 HTTP_PROXY: make usable 2017-06-14 09:53:09 +08:00
Andy Green
449eec9b54 client: add iface in connection info, dont use vhost iface 2017-06-14 09:45:30 +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
37053b3a9c content-length api: unsigned long to lws_filepos_t 2017-06-07 08:13:11 +08:00
Leonardo Maccari Rufino
393b38aed9 Subject: Support to bind accepted socket to device on Linux
AG: move new member to end of info,
    allow info member even on nonsupporting platform,
    document requires root,
    apply only to listen skt before we drop root,
    add -k to test server to allow testing
2017-06-07 08:13:11 +08:00
Andy Green
156363f3de capabilities support 2017-06-07 06:49:20 +08:00
Andy Ning
ce2e74e5e3 Subject: lws_stats: fix compile error on VS2013
Use LWS_INLINE instead of inline in libwebsockets.h to
make it compatible on both Linux and Windows.

Signed-off-by: Andy Ning <andy.ning@windriver.com>
2017-05-31 07:44:08 +08:00
emptyVoid
348887ea53 Subject: Direct extension confirmation to the negotiated protocol's callback
Fixes #897

Notice this means if you want to globally ban an extension, you should
no longer include the extension at context creation time.
2017-05-29 08:30:26 +08:00
Andy Green
c28f436098 esp32: led network state helper 2017-05-21 07:33:09 +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 Ning
ed92b6dfe7 client: added socks5 proxy support
AG:

 - move creation info members to end of struct
 - add LWS_WITH_SOCKS5 CMake var, defaults to OFF
 - cast away some warnings about signed / unsigned in strncpy

Signed-off-by: Andy Ning <andy.ning@windriver.com>
2017-05-17 06:18:45 +08:00
Andy Green
3cf570ec52 esp32: group tracking 2017-05-16 19:35:55 +08:00
Andy Green
b778cc54ca esp32: group mdns 2017-05-14 14:55:15 +08:00
Andy Green
b2f8bc5638 esp32: multi ap slots 2017-05-13 10:26:59 +08:00
Andy Green
54236bd437 esp32: multi ap slots plus PEM certs and parallel build fixes 2017-05-11 15:02:01 +08:00
Andy Green
a7def3ce44 LWS_WITH_STATS 2017-05-09 14:19:43 +08:00
Andy Green
2790d5b28c esp32: add leds sine fade helper 2017-05-09 14:18:40 +08:00
Joel Winarske
991f6ec644 Subject: windows: fops write support 2017-04-20 07:24:09 +08:00
dspname
ca6242a1d3 windows: constify first arg of plat fops open
https://github.com/warmcat/libwebsockets/issues/871
2017-04-19 20:28:48 +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
Renyaow
4ae029c3a1 windows: _snprintf_s
https://github.com/warmcat/libwebsockets/issues/859
2017-04-05 01:55:38 +08:00
Andy Green
30195eb79d esp32: dont require factory button if no ssl certs yet 2017-04-03 11:56:33 +08:00
Andy Green
00ae90978b esp32: separate factory setup 2017-03-31 20:05:10 +08:00
paularmitt
422f56c9dc windows: need LWS_INLINE 2017-03-31 19:57:24 +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
ed27be42c9 docs: lws_callback_all_protocol: fix cut-n-paste error and explain it is probably not what you want 2017-03-15 07:28:51 +08:00
Andy Green
e769af41db windows: don't use LWS_EXTERN outside of function declarations 2017-03-15 07:25:36 +08:00
Andy Green
102d40e6b6 esp32: openssl 2017-03-11 11:51:06 +08:00
Andy Green
e0572d3bef esp32: move helper code into lws 2017-03-10 14:31:43 +08:00
Andy Green
3a09c3b7d6 esp32: align fops member name defines 2017-03-08 11:11:41 +08:00
Andy Green
4219a3281d server-name: add_server_header add LWSAHH_FLAG_NO_SERVER_NAME
Also clean up usage of status code defines in lws
2017-03-08 07:51:47 +08:00
Andy Green
205ccedf6e raw: enable server and client raw sockets 2017-03-07 16:06:05 +08:00
Andy Green
19cc7acb24 fops-zip 2017-03-05 15:32:55 +08:00
Andy Green
753f1d642c junzip: style and migrate header into private-libwebsockets.h
Also introduce CMake LWS_WITH_ZIP_FOPS defaulting to ON that builds junzip.c and
make sure this is exported in lws_config.h (included by libwebsockets.h)

Improve lws handling of stdint.h import or simulate it.
2017-03-03 09:19:14 +08:00
Per Bothner
60f4569bb8 adopt: allow binding to parent at same time
- if protocol set, allocate own user_space

   If the child wsi wants the parent wsi user_space, it can use

       lws_wsi_user(lws_get_parent(child_wsi))

 - raw file close processing handles parent-child relationship
2017-03-03 07:36:08 +08:00