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

525 commits

Author SHA1 Message Date
Andy Green
279fd21e73 esp-idf: update againt 2021-08-06 head 2021-08-28 07:24:00 +01:00
Andy Green
afce869758 http: date: use timegm 2021-08-13 05:46:05 +01:00
Andy Green
8a580b59b2 v4.2.1 2021-07-13 07:22:16 +01:00
caobug
85f772f2d1 OSX: Fixed can't find clock_gettime 2021-06-06 11:48:13 +01:00
Andy Green
4844ff872b cmake: LWS_WITHOUT_EVENTFD 2021-04-20 16:05:36 +01:00
Andreas Weigel
1a7f5be468 cmake: also set LWS_BUILD_HASH to unknown if no git is found 2021-04-20 16:05:27 +01:00
Andy Green
6bb28ef93c cmake: set unknown as LWS_BUILD_HASH if no git repo 2021-04-19 06:43:55 +01:00
Andy Green
1367c11e1e v4.2.0 release 2021-04-15 17:44:02 +01:00
Mykola Stryebkov
0d06d4bad2 windows: work well with vcpkg pthreads 2021-04-05 10:55:04 +01:00
Catalin
d5753b6298 tls: openssl-only: client-only: session caching 2021-04-04 05:34:11 +01:00
Andy Green
93e3aa2c4a cmake: remove crufty option 2021-03-29 19:36:26 +01:00
Pavel Otchertsov
ebe44543ee cmake: check if _GNU_SOURCE is already defined 2021-03-25 10:08:41 +00:00
Pavel Otchertsov
f84b90ba03 use gmtime_r instead of gmtime if possible
Also check tm result is not NULL before using it.
2021-03-25 10:08:40 +00:00
Pavel Otchertsov
b5ed38395e use ctime_r instead of ctime if possible 2021-03-25 10:08:38 +00:00
Pavel Otchertsov
932527a3e7 access-log: use localtime_r instead of localtime if possible
Also replace the WIN32 check to global LWS_HAVE_LOCALTIME_R in logs.c
2021-03-25 09:12:11 +00:00
Andy Green
b9ee27f3c5 unix: use getpwnam_r and friends
Figure out if the threadsafe versions are available on the platform and
use them if so
2021-03-25 08:40:52 +00:00
Andy Green
0f42f0d9ad uloop 2021-03-17 12:23:34 +00:00
Andy Green
06509e287d lws_conmon: connection monitoring and stats generation
This provides a build option LWS_WITH_CONMON that lets user code recover
detailed connection stats on client connections with the LCCSCF_CONMON
flag.

In addition to latencies for dns, socket connection, tls and first protocol
response where possible, it also provides the user code an unfiltered list
of DNS responses that the client received, and the peer it actually
succeded to connect to.
2021-03-17 07:31:49 +00:00
Andy Green
3f4623bb36 lws_metrics
There are a few build options that are trying to keep and report
various statistics

 - DETAILED_LATENCY
 - SERVER_STATUS
 - WITH_STATS

remove all those and establish a generic rplacement, lws_metrics.

lws_metrics makes its stats available via an lws_system ops function
pointer that the user code can set.

Openmetrics export is supported, for, eg, prometheus scraping.
2021-03-08 21:47:28 +00:00
Andy Green
c00ece34a1 solaris: openssl: defeat openssl deprecation of md5 2021-03-08 20:43:58 +00:00
Andy Green
3fe08ce5d8 fault injection 2021-02-20 13:54:35 +00:00
Andy Green
8e5f8491db opensslv3: handle deprecation of EC apis
openssl v3-alpha11 has marked EC_KEY pieces as deprecated... we use it in
LWS_WITH_GENCRYPTO but the related RSA etc pieces were already deprecated
for that.  We use EC_KEY pieces in vhost init...

The apis are not removed but deprecated, we should have a way to keep
trucking, but as it is the deprecation warning is promoted to an error.

Let's add LWS_SUPPRESS_DEPRECATED_API_WARNINGS option off by default.  If
enabled at cmake, external deprecated api warnings are suppressed.  This
gives a general workaround for now for opensslv3.

In addition, even if you don't do that, let's notice we are on openssl v3
and don't build the EC curve selection stuff, I don't think anyone is
actually using it anyway.
2021-02-17 11:39:15 +00:00
Andy Green
0d588b292c logs: make tag lifecycle optional default on
The elaborated tags for ls owsi, vh, and ss objects are very useful
signposts to understand what's happening in the logs.  But for busy
h1 servers, they're just a lot of noise.

This lets you stop the logging of tagged object lifecycle by cmake
-DLWS_LOG_TAG_LIFECYCLE=0
2021-02-01 10:46:40 +00:00
Andy Green
0e6df74409 plugins: add option LWS_WITH_PLUGINS_BUILTIN
Add the ability to just build plugins into the main library.
They are already designed to have a pinhole export for when
they are used as dynamic lib plugins so their namespace
does not conflict.
2021-01-31 20:24:29 +00:00
Andy Green
fd24392cd3 tls: add cmake options to dump tls 2021-01-23 20:58:36 +00:00
Christian Fuchs
b961e5f351 eventlib: add sd-event support 2021-01-11 08:12:46 +00:00
Jed Lu
c82910d30c ss: auth: sigv4
Add SS pieces for Sigv4 auth support
2021-01-05 10:56:38 +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
Rogonov Stepan
31435c9f70 cmake: move LWS__INCLUDE_DIRS def to after REL_INCLIDE_DIR def
Generate the config file for the installation tree
fix wrong LWS__INCLUDE_DIRS definition
2020-12-27 08:42:13 +00:00
Andy Green
8b82560014 cmake: netbsd: no libdl 2020-12-06 19:39:35 +00:00
Andy Green
60b995b8ce esp32: update build arrangements 2020-12-06 19:06:11 +00:00
Andy Green
962e9ee345 wip: ss c++ classes
C++ APIs wrapping SS client


These are intended to provide an experimental protocol-independent c++
api even more abstracted than secure streams, along the lines of
"wget -Omyfile https://example.com/thing"

WIP
2020-12-02 10:15:50 +00:00
Andy Green
43f9af2f55 cmake: windows: try to auto include LwsCheckRequirements 2020-12-01 15:38:20 +00:00
Andy Green
9eb4c4fac2 client: rfc6724 dns results sorting
RFC6724 defines an ipv6-centric DNS result sorting algorithm, that
takes route and source address route information for the results
given by the DNS resolution, and sorts them in order of preferability,
which defines the order they should be tried in.

If LWS_WITH_NETLINK, then lws takes care about collecting and monitoring
the interface, route and source address information, and uses it to
perform the RFC6724 sorting to re-sort the DNS before trying to make
the connections.
2020-11-28 10:58:07 +00:00
Pino Toscano
c623ebfe87 context: properly check for sys/resource.h
Instead of hardcoding where sys/resource.h is available, check for it
using cmake.
2020-11-01 12:14:19 +00:00
owent
dddc68ec2d netlink: check for RTA_PREF before use
Old kernels like v3.10 don't have it

 [#2079](https://github.com/warmcat/libwebsockets/issues/2079)
2020-10-19 16:35:03 +01:00
Andy Green
643a001ed8 roles: netlink
This creates a role for RFC3549 Netlink monitoring.

If the OS supports it (currently, linux) then each pt creates a wsi
with the netlink role and dumps the current routing table at pt init.
It then maintains a cache of the routing table in each pt.

Upon routing table changes an SMD message is issued as an event, and
Captive Portal Detection is triggered.

All of the pt's current connections are reassessed for routability under
the changed routing table, those that no longer have a valid route or
gateway are closed.
2020-10-19 16:35:03 +01:00
Andy Green
bdc3a1102d cmake: remove fixed -g 2020-09-29 16:58:33 +01:00
Andy Green
c75654c3f6 sequencer: disable by default 2020-09-29 09:29:59 +01:00
Andy Green
90496da82e cmake: bump minimum version
Next release of cmake will choke by default if minimum version < 2.8.12
2020-09-28 07:35:27 +01:00
Orgad Shaneh
891126988c cmake: remove dead code
Since 425da070e3 LWS_PTHR_FLAGS is no longer
used, so just remove it.
2020-09-18 11:37:21 +01:00
Orgad Shaneh
aa149e492b cmake: mingw: fix build with default options
afunix.h doesn't exist on mingw.
2020-09-18 11:37:17 +01:00
Orgad Shaneh
3ef33627b5 cmake: use -Wuninitialized only for GCC >= 4.4
It doesn't work with 4.3.3
2020-09-16 08:04:44 +01:00
Andy Green
3be4725388 cmake: set version v4.1.99 for development 2020-09-04 14:12:39 +01:00
Andy Green
63e9699bda v4.1.0 2020-09-04 13:42:57 +01:00
SCRockz
ad7b17f437 cmake: qnx adaptations
https://github.com/warmcat/libwebsockets/issues/2034
2020-09-03 08:18:52 +01:00
Andy Green
16e8fc2042 cmake: plugins: make sure about dl 2020-08-31 16:51:37 +01:00
Orgad Shaneh
0938607af8 cmake: gcc: allow build with GCC < 4.4
Prior to 4.4, -Wuninitialized could only be used with -O.
2020-08-31 16:51:37 +01:00
Andy Green
1d05f429dc lws_plugins 2020-08-31 16:51:37 +01:00
Andy Green
c6c7ab2b44 event libs: default to building as dynamically loaded plugins
Event lib support as it has been isn't scaling well, at the low level
libevent and libev headers have a namespace conflict so they can't
both be built into the same image, and at the distro level, binding
all the event libs to libwebsockets.so makes a bloaty situation for
packaging, lws will drag in all the event libs every time.

This patch implements the plan discussed here

https://github.com/warmcat/libwebsockets/issues/1980

and refactors the event lib support so they are built into isolated
plugins and bound at runtime according to what the application says
it wants to use.  The event lib plugins can be packaged individually
so that only the needed sets of support are installed (perhaps none
of them if the user code is OK with the default poll() loop).  And
dependent user code can mark the specific event loop plugin package
as required so pieces are added as needed.

The eventlib-foreign example is also refactored to build the selected
lib support isolated.

A readme is added detailing the changes and how to use them.

https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.event-libs.md
2020-08-31 16:51:37 +01:00