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

17 commits

Author SHA1 Message Date
Andy Green
7bed5b0d0c peer-limits: only run clean up sul if any entries 2021-01-17 19:23:48 +00:00
Andy Green
c6d172c2ed ss: server mode fixes 2021-01-13 04:33:17 +00:00
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
0ceba15d9c lws_lifecycle
This adds some new objects and helpers for keeping and logging
info on grouped allocations, a group is, eg, SS handles or client
wsis.

Allocated objects get a context-unique "tag" string intended to replace
%p / wsi pointers etc.  Pointers quickly become confusing when
allocations are freed and reused, the tag string won't repeat
until you produce 2^64 objects in a context.

In addition the tag string documents the object group, with prefixes
like "wsi-" or "vh-" and contain object-specific additional
information like the vhost name, address / port  or the role of the wsi.
At creation time the lws code can use a format string and args
to add whatever group-specific info makes sense, eg, a wsi bound
to a secure stream can also append the guid of the secure stream,
it's copied into the new object tag and so is still available
cleanly after the stream is destroyed if the wsi outlives it.
2021-01-04 05:26:50 +00:00
Andy Green
90c7e789eb PEER_LIMITS: modernize to sa46 and add notification cb
There are a bunch of sa46-aware lws apis for formatting, etc sa46
in ./include/libwebsockets/lws-network-helper.h
2020-06-02 08:37:10 +01:00
Andy Green
72a5993deb clean: explicitly include libwebsockets.h in internal c now we use stddint types earlier
Some toolchains don't bring it in soon enough by reference from
other headers
2020-01-15 12:07:20 +00: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
eda102e397 jwe 2018-12-27 06:45:32 +08:00
Andy Green
9bed6d6fc6 clean: general whitespace cleanup 2018-11-23 08:47:56 +08:00
Andy Green
f44e38f148 unix socket: fixes and improvements
Auto-remove any unix socket file already there.

Correctly identify if it's in use per-vhost.

Make the peer-limits stuff ignore it.
2018-08-14 08:00:30 +08:00
Andy Green
b58fb2dae3 lws_mutex_refcount
This creates a "pthread mutex with a reference count"
using gcc / clang atomic intrinsics + pthreads.

Both pt and context locks are moved to use this,
pt already had reference counting but it's new for
context.
2018-06-27 07:15:39 +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
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
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
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
126be3ccf3 refactor role ops
This only refactors internal architecture and representations, the user
api is unaffected.
2018-04-11 13:39:42 +08:00
Renamed from lib/server/peer-limits.c (Browse further)