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

58 commits

Author SHA1 Message Date
Andy Green
52b55d8be5 ws role: wsi ws may not have been allocated by time of close 2018-09-02 06:55:52 +08:00
Martin Milata
2950cf14bb Ignore unknown headers in multipart file upload 2018-08-28 06:57:41 +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
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
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
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
張俊芝
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
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
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
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
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
Andy Green
3a499dd53d client: pipelining needs ah reset at client transaction completed 2018-06-04 07:15:39 +08:00
Alfred Sawaya
3f7ffeddac fix memleak when role h1 failed to upgrade to websocket 2018-06-02 05:57:40 +08:00
Andy Green
ad078faaaf client: fix SOCKS5 compilation
https://github.com/warmcat/libwebsockets/issues/1292
2018-05-25 21:44:59 +08:00
Andy Green
34d07125e7 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:31:18 +08:00
Andy Green
82fc4756be cgi: fix QUERY_STRING 2018-05-18 14:45:43 +08:00
Andy Green
bc409bbc2e lws_read_h1: handle LRS_RETURNED_CLOSE 2018-05-11 10:26:52 +08:00
Andy Green
a77e2a7fbf role ws: allow zero length PONG 2018-05-09 18:55:26 +08:00
Andy Green
24c216fac5 minimal-ws-client-ping 2018-05-09 17:02:03 +08:00
Andy Green
2f5f1125f7 esp32: align hrtimer and avoid compiler warning 2018-05-07 13:34:14 +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
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
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
f497562a62 refactor: change event lib minimal examples to serve as the test apps 2018-04-30 19:17:32 +08:00
Andy Green
d37b383edc refactor: apply ops structs to event loop handlers 2018-04-29 10:44:36 +08:00
Andy Green
d05b408cde refactor: clean out test-apps 2018-04-29 08:35:24 +08:00
Andy Green
ac6c48d98f refactor: most preparation for -DLWS_ROLE_H1=0 2018-04-27 19:16:50 +08:00
Andy Green
16a907180c refactor: move all ah and http specific vars to http private and conditional inclusion from there 2018-04-27 15:20:56 +08:00
Andy Green
9c9ef9cea2 refactor: move everything related to HTTP_PROXY out of struct lws and private-libwebsockets.h into http role private 2018-04-27 14:36:10 +08:00
Andy Green
7c0a2ae633 smp: h2 children must go on same tsi as parent
We can't have a situation where stream wsis inside an h2 connection
are serviced by different threads than the actual parent connection.
2018-04-27 12:49:42 +08:00
Andy Green
82adc07c0a fix minimal-server-tls 2018-04-27 09:36:03 +08:00
Andy Green
7ff8f023d1 context info struct: make lws usage all const 2018-04-27 08:37:20 +08:00
Andy Green
800cd40f88 client: support pipelining / h2 multi for POST
https://github.com/warmcat/libwebsockets/issues/1256
2018-04-27 07:25:45 +08:00
Andy Green
5d06f610a9 travis: h2spec integration 2018-04-26 15:27:02 +08:00
Andy Green
2e3ddeedb6 lws_get_peer_write_allowance: return lws_fileofs_t 2018-04-26 08:30:12 +08:00
Andy Green
27e86e2641 cmake: allow setting LWS_ROLE_WS
You can build lws without support for ws, with -DLWS_ROLE_WS=0.

This is thanks to the role ops isolating all the ws-specific business
in the ws role.

Also retire more test apps replaced by minmal-examples.
2018-04-25 08:42:18 +08:00
Andy Green
8e9751e26e refactor: move out extension lws members into ws and establish role structs for vhost content 2018-04-25 06:53:30 +08:00
Andy Green
7b227eb333 autobahn fixes
This replaces the old test-app for echo with separate client and server
minimal versions.

The autobahn test script is made more autonomous and tests both
client and server.
2018-04-22 06:45:46 +08:00
Labunsky Artem
3459d4fe43 Removing rudimental n1 variable
There is no real need in n1, since it used in only at one place once.
Also it will prevent "variable ‘n1’ set but not used [-Werror=unused-but-set-variable]" error on build with -DLWS_MAX_SMP=N, where N > 1.

AG: also add LWS_MAP_SMP != 1 test to travis to catch this kind of thing sooner
2018-04-21 10:24:44 +08:00
Andy Green
658c752998 lws_add_http_common_headers: provide WSI_TOKEN_HTTP_CONTENT_TYPE helper 2018-04-20 07:13:05 +08:00
Andy Green
3f683351b3 refactor: split out private role header content
Private header stuff specific to roles should go in the
role dir and only be included if the role is enabled for
build.

Only definitions related to lws core should go in the actual
private-libwebsockets.h
2018-04-20 07:13:05 +08:00
Andy Green
1d2094996e refactor: absorb other caches into buflist
1) Remove the whole ah rxbuf and put things on to the wsi buflist

This eliminates the whole detachability thing based on ah rxbuf
state... ah can always be detached.

2) Remove h2 scratch and put it on the wsi buflist

3) Remove preamble_rx and use the wsi buflist

This was used in the case adopted sockets had already been read.


Basically there are now only three forced service scenarios

 - something in buflist (and not in state LRS_DEFERRING_ACTION)

 - tls layer has buffered rx

 - extension has buffered rx

This is a net removal of around 400 lines of special-casing.
2018-04-20 07:13:05 +08:00
Andy Green
6059c965dd minimal-http-server-basicauth 2018-04-19 16:16:48 +08:00
Andy Green
8829c2f365 selftests
This converts several of the selftests to return a status in their exit code
about whether they 'worked'.

A small bash script framework is added, with a selftest.sh in the mininmal
example dirs that support it, and a ./minimal-examples/selftests.sh script
that can be run from the build dir with no args that discovers and runs all
the selftest.sh scripts underneath.

That is also integrated into travis and the enabled tests must pass now for
travis to pass.  Travis does not have a modern libuv so it can't run a
couple of tests which are nulled out if it sees it's running in travis env.
2018-04-19 16:16:48 +08:00