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

109 commits

Author SHA1 Message Date
Andy Green
39e89328b0 logs: prioritize WITH_NO_LOGS even in release
Really not having any logs makes it difficult to know what is really
happening, but if that's you're thing this will align debug and release
modes to just have ERR and USER if you give WITH_NO_LOGS
2021-03-16 08:20:03 +00:00
Andy Green
d8c56ceb69 vhost_destroy: refactor 2021-01-22 16:22:25 +00:00
Jed Lu
c05ee8f4ae ss: http: make sure we dont duplicate leading path slash if already present 2021-01-22 16:21:32 +00:00
Yichen Gu
3e69956357 sspc: double free + rx ret not checked
Change-Id: I81b67cbb28591a20842fc7d6e09b78375845aae4
2020-11-25 14:32:47 +00:00
Yichen Gu
fc3c705c90 sspc: lws_sspc_handle_t pointer in wsi used after free 2020-11-12 19:55:10 +00:00
Yichen Gu
8e876be816 ss: h2: ACK/NACK missing in H2 state flow 2020-11-02 12:17:05 +00:00
Andy Green
109677df61 ss: policy: cast uint32 lwsl_err arg to unsigned int
Some toolchains typedef uint32_t to unsigned long
2020-10-29 19:53:57 +00:00
Andy Green
427b925d19 ss: fix without server 2020-10-29 19:53:41 +00:00
Andy Green
1fdc242d98 ss: compiler may complain in release mode due to info 2020-09-29 17:06:10 +01:00
Jed Lu
64232ddc4c sspc: http map proxying fixes 2020-09-22 07:41:00 +01:00
Andy Green
82fe436fff sspc: allow 32-bit states 2020-09-21 12:47:45 +01:00
Andy Green
16963f0430 sspc: extend RXPRE_CONNSTATE to handle 8 or 32-bit states
Currently only the low 8 bits of an SS state are proxied in a total packet
length of 8 octets.  Keep that format and behaviour since all the defined
states fit in 8 bits, but also allow for 32-bit states using a packet length
of 11 octets with the same command.

This lets us proxy user states (from http mapping) which start at a user
base of 1000.
2020-09-20 07:09:41 +01:00
Andy Green
04ddc644d9 ss: server: dont allow client request_tx path even if disconnected 2020-09-13 11:15:53 +01:00
Andy Green
936e1c71ce sspc: client: call CREATING on linkup to proxy
Before this we simply proxy the CREATING state from the proxy
version of the stream to the client version of the stream.

However this can result in disordering of onward connection
attempt request happening before the client has called back its
CREATING (*state()), meaning that any metadata set in the
state handler is missed for the onward connection.

This patch suppresses the CREATING forwarded from the proxy
and instead does its own local CREATING state callback at the
time the proxy indicates that the remote stream creation
(ie, with the requested policy streamtype) succeeded.

This then guarantees that the client has seen CREATING, and
had a chance to set metadata there, before the onward connection
request goes out.  Since metadata has higher priority at the
writeable than the onward connection request it also means
any metadata set in client CREATING gets sync'd to the proxy
before the onward connection.
2020-09-04 12:59:34 +01:00
Andy Green
4ae3ef51c1 ss: improve callback return consistency
Formalize the LWSSSSRET_ enums into a type "lws_ss_state_return_t"
returned by the rx, tx and state callbacks, and some private helpers
lws_ss_backoff() and lws_ss_event_helper().

Remove LWSSSSRET_SS_HANDLE_DESTROYED concept... the two helpers that could
have destroyed the ss and returned that, now return LWSSSSRET_DESTROY_ME
to the caller to perform or pass up to their caller instead.

Handle helper returns in all the ss protocols and update the rx / tx
calls to have their returns from rx / tx / event helper and ss backoff
all handled by unified code.
2020-08-31 16:51:37 +01:00
Jed Lu
3b9e468516 ss: protect against reentry in lws_destroy 2020-08-31 16:51:37 +01:00
Andy Green
d735d96b99 sspc: extend assert length check to explicit code 2020-08-31 16:51:37 +01:00
Andy Green
62c328244c cmake: fix things ignoring LWS_WITH_TLS 2020-08-31 16:51:36 +01:00
Andy Green
7ded454d2d coverity: 62570: back up assert with unconditional NULL check 2020-08-18 14:00:54 +01:00
Andy Green
84a8ada0fd coverity: 62181: remove needless wsi check 2020-08-18 14:00:54 +01:00
Andy Green
264c98c2c9 coverity: 62494: check system blob supposed to be used in h1 at runtime 2020-08-18 14:00:54 +01:00
Andy Green
80ea883796 coverity: 62550: back up assert with runtime NULL check 2020-08-18 14:00:54 +01:00
Andy Green
260bd38d56 coverity: 62319: coverity thinks we must always check blob size 2020-08-18 14:00:54 +01:00
Andy Green
d3d8b3a74c coverity: 62370: reassure coverity static blob always exists 2020-08-18 14:00:54 +01:00
Andy Green
03ab5b5247 coverity: 62376: reassure coverity static blob always exists 2020-08-18 14:00:54 +01:00
Andy Green
80395f479f coverity: 62431: reassure coverity static blob always exists 2020-08-18 14:00:54 +01:00
Andy Green
fc9a23abeb coverity: 62581: lwa auth: handle illegal blob index 2020-08-18 14:00:54 +01:00
Andy Green
52182da689 sspc: protect wsi from NULL not cwsi 2020-08-17 16:27:05 +01:00
Andy Green
83912f40e8 sspc: proxy: extend DESTROY_ME 2020-08-17 14:36:33 +01:00
Andy Green
c6e1352e99 sspc: add translation helpers and comments about pss usage between client and proxy
Helpers remove casts and derefs.

Add additional pointer arithmetic in client_pss_to_sspc_h() helper to
remove dependency on handle_offset being the first thing in the userdata

Make the helper names explicit for different proxy and client pss handling,
so it should be clearer that client helpers belong in a client section and
vice versa.
2020-08-17 14:32:23 +01:00
Jed Lu
80992b0ebd sspc: client: audit all deserialize *pss references and confirmed checked for NULL 2020-08-17 06:57:30 +01:00
Andy Green
e8cbfea22d lws_smd: take care about build with disabled 2020-08-16 05:35:56 +01:00
Andy Green
7c9ead211a sspc-proxy-fragmented-dsh-must-use-fragmented-flags
We compute the refragmented flags when cutting up large client serialized
payload blocks.  But we had a bug where we didn't actually apply it and
applied the original client flags on the fragments.

That causes a crisis because EOM is used to mark end of post body and
complete the transaction, that is then happening on the first fragment.

This one-liner corrects it to use the computed, refragmented flags on the
dsh fragments and eliminate the problem.
2020-08-13 16:48:26 +01:00
Andy Green
44608abce6 sspc: fix intree build for sspc examples and increase post example body
Correct a comment about payload layout and add detailed comments about
dsh handling at proxy.

Increase the post size so it shows up fragmentation issues at the proxy.
2020-08-13 16:48:16 +01:00
Andy Green
54f98aff78 sspc: make it clear we can only get RPAR_STREAMTYPE in WAIT_INITIAL_TX state
Otherwise Coverity will complain we only set up ssi in WAIT_INITIAL_TX
2020-08-13 06:40:39 +01:00
Andy Green
d51e44388c sspc: ss timeout check is onward still alive before setting 2020-08-12 19:25:34 +01:00
Andy Green
dd3bae8c71 ss: multipart without processing
Change the default to not process multipart mime at SS layer.

If it's desired, then set "http_multipart_ss_in" true in the policy on the streamtype.

To test, use lws-minimal-secure-streams-avs, which uses SS processing as it is.

To check it without the processing, change #if 1 to #if 0 around the policy for
"http_multipart_ss_in" in both places in avs.c, and also enable the hexdump in ss_avs_metadata_rx()
also in avs.c, and observe the multipart framing is passed through unchanged.
2020-08-11 11:07:13 +01:00
Andy Green
fff9ca6ee4 sspc: client: restrict forwarded bulk data to 2048 2020-08-10 15:04:10 +01:00
Andy Green
8669f6bf61 sspc: client: if not writing, make sure not to write 2020-08-10 15:04:10 +01:00
Jed Lu
793ba842fa ss: http: synthesize CONNECTED for PUT as well as POST 2020-08-10 15:04:10 +01:00
Andy Green
74c7060c62 sspc: increase client packet size to 8192
This is only used on Linux-class devices
2020-08-10 15:04:10 +01:00
Andy Green
0f218eebbd sspc: deal with huge metadata 2020-08-10 15:04:10 +01:00
Andy Green
15e6ac25a4 sspc: make sure NUL on metadata name 2020-08-10 15:04:10 +01:00
Andy Green
6eb793bbef sspc: temp ignore txcr to support h1
We want to manage the proxy txcr, but at the moment the proxy doesn't pass
back information about if it's actually h1 or h2 it found across the internet.

Temporarily defeat txcr wait so we can support h1 until that's improved.
2020-08-10 15:04:10 +01:00
Andy Green
a71cbe785e sspc: http POST: synthesize CONNECTED to provoke client body write 2020-08-10 15:04:10 +01:00
Andy Green
d1d5cf2947 sspc: improve client async close flow 2020-08-10 15:04:10 +01:00
Andy Green
1b4bf38d5e sspc: add request_tx length variant
Add in the missing request_tx length variant, serialization and proxy
handling for it
2020-08-10 15:04:10 +01:00
Andy Green
3899a416a9 sspc: segregate client and proxy states properly 2020-08-10 15:04:10 +01:00
Andy Green
a6a9f22556 sspc: LWSSSPC: track onward request status 2020-08-10 15:04:10 +01:00
Andy Green
924bd78085 clean: reduce log verbosity in various places 2020-08-10 15:04:10 +01:00