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

14 commits

Author SHA1 Message Date
Andy Green
c9731c5f17 type comparisons: fixes
This is a huge patch that should be a global NOP.

For unix type platforms it enables -Wconversion to issue warnings (-> error)
for all automatic casts that seem less than ideal but are normally concealed
by the toolchain.

This is things like passing an int to a size_t argument.  Once enabled, I
went through all args on my default build (which build most things) and
tried to make the removed default cast explicit.

With that approach it neither change nor bloat the code, since it compiles
to whatever it was doing before, just with the casts made explicit... in a
few cases I changed some length args from int to size_t but largely left
the causes alone.

From now on, new code that is relying on less than ideal casting
will complain and nudge me to improve it by warnings.
2021-01-05 10:56:38 +00:00
Andy Green
0d31b7a154 buflist: additional helpers 2020-11-09 07:40:40 +00:00
Andy Green
157acfc906 windows: clean type warnings
There are some minor public api type improvements rather than cast everywhere
inside lws and user code to work around them... these changed from int to
size_t

 - lws_buflist_use_segment() return
 - lws_tokenize_t .len and .token_len
 - lws_tokenize_cstr() length
 - lws_get_peer_simple() namelen
 - lws_get_peer_simple_fd() namelen, int fd -> lws_sockfd_type fd
 - lws_write_numeric_address() len
 - lws_sa46_write_numeric_address() len

These changes are typically a NOP for user code
2020-01-11 14:04:50 +00:00
Andy Green
fc2e659864 buflist: linear copy must account for LWS_PRE 2020-01-05 22:17:58 +00:00
Andy Green
1c09e6e822 buflist: overallocate by 1
We overallocate at the start by LWS_PRE so we can use
buflist content directly with lws_write, this has us also
overallocate by 1 at the end.  There's a corner case with
cgi where it's receiving bulk POST data to pass on to cgi
stdin and wants to make sure there's a NUL just past the
end... this makes sure we have space for it.
2019-10-13 07:17:03 +01:00
Andy Green
f9e9977534 lws_buflist: extra apis for in-place use 2019-10-12 12:41:14 +01:00
Andy Green
6710279e21 client: use block parse and buflist
With http, the protocol doesn't indicate where the headers end and the
next transaction or body begin.  Until now, we handled that for client
header response parsing by reading from the tls buffer bytewise.

This modernizes the code to read in up to 256-byte chunks and parse
the chunks in one hit (the parse API is already set up for doing this
elsewhere).

Now we have a generic input buflist, adapt the parser loop to go through
that and arrange that any leftovers are placed on there.
2019-09-22 03:08:36 -07:00
Andy Green
78c7b0651e buflist: add static reason logging to internal aware apis 2019-09-22 03:08:36 -07:00
Andy Green
32a35d0c4b fixes: various small fixes 2019-09-22 03:08:36 -07:00
Andy Green
d7f0521aeb private.h: rename to contain dir
Having unique private header names is a requirement of a particular
platform build system it's desirable to work with
2019-08-15 10:49:52 +01:00
Andy Green
26319663f7 license: switch LGPLv2.1+SLE parts to MIT 2019-08-14 10:44:38 +01:00
Andy Green
20923db2b5 COVA14455: unused var init 2019-08-08 09:45:09 +01:00
Andy Green
4692c1a7ee rtos: clean warnings where uint32_t is an unsigned long 2019-06-07 11:11:46 +01:00
Andy Green
38fb0e31da lws_struct
lws_struct JSON + sqlite3 serializer and deserializer


See READMEs/README.lws_struct.md
2019-04-06 06:08:47 +08:00