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

22 commits

Author SHA1 Message Date
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
6497220e87 plugins: add LWS_BUILD_HASH to header and require match
Also prioritize LD_LIBRARY_PATH check for plugins first

Iterate through paths in LD_LIBRARY_PATH in order

Warn on failed plugins init but continue protocol init
2021-01-28 05:52:41 +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
5c988d7714 plugins: more explicit header inclusion
32-bit Debian doesn't have these included by other includes
already and needs them explicitly.
2020-10-26 11:24:21 +00:00
Andy Green
8d88d2f4f1 plugins: use new export symbol convention 2020-10-09 21:30:49 +01:00
Andy Green
d98101d1e3 plugins: generalize and provide public api
Move the common plugin scanning dir stuff to be based on lws_dir, which
already builds for windows.  Previously this was done via dirent for unix
and libuv for windows.

Reduce the dl plat stuff to just wrap instantiation and destruction of
dynlibs, establish common code in lib/misc/dir.c for plugin scanning
itself.

Migrate the libuv windows dl stuff to windows-plugins.c, so that he's
available even if later libuv loop support becomes and event lib plugin.

Remove the existing api exports scheme for plugins, just export a const struct
now which has a fixed header type but then whatever you want afterwards depending
on the class / purpose of the plugin.  Place a "class" string in the header so
there can be different kinds of plugins implying different types exported.

Make the plugin apis public and add support for filter by class string, and
per instantation / destruction callbacks so the subclassed header type can
do its thing for the plugin class.  The user provides a linked-list base
for his class of plugins, so he can manage them completely separately and
in user code / user export types.

Rip out some last hangers-on from generic sessions / tables.

This is all aimed at making the plugins support general enough so it can
provide event lib plugins later.
2020-08-31 16:51:37 +01:00
Andy Green
0bfd39135e cleaning 2020-01-05 22:17:58 +00:00
Andy Green
f7149e90c2 cc0: align dedication to CC0 FAQ recommended format
https://libwebsockets.org/pipermail/libwebsockets/2019-April/007937.html

thanks to Bruce Perens for noting it.

This doesn't change the intention or status of the CC0 files, they were
pure CC0 before (ie, public domain) and they are pure CC0 now.  It just
gets rid of the (C) part at the top of the dedication which may be read
to be a bit contradictory since the purpose is to make it public domain.
2019-05-02 09:29:01 +01:00
Andy Green
d3bc2c3f4f fulltext search 2018-10-26 13:53:28 +08:00
Andy Green
33a6034875 codacy: minor fixes 2018-10-13 08:16:27 +08:00
Andy Green
d1f9f0ae2d libwebsockets.h: split out into a dir of sub-includes included by libwebsockets.h
This has no effect on user code or backward compatibility.

It moves the in-tree public api header libwebsockets.h from ./lib
to ./include, and introduces a dir ./include/libwebsockets/

The single public api header is split out into 31 sub-headers
in ./include/libwebsockets.  ./include/libwebsockets.h contains
some core types and platform adaptation code, but the rest of it
is now 31 #include <libwebsockets/...>

At install time, /usr/[local/]include/libwebsockets.h is installed
as before, along now with the 31 sub-headers in ...include/libwebsockets/

There's no net effect on user code.

But the api header is now much easier to maintain and study, with 31
topic-based sub headers.
2018-09-11 18:27:59 +08:00
Andy Green
d461f46a97 libwebsockets.h: clean out some boilerplate better put in core/private.h
https://github.com/warmcat/libwebsockets/issues/1370
2018-08-16 19:10:32 +08:00
Andy Green
a03dd40e62 plugins: gitws libjsongit2 support
This adds a plugin that interfaces to libjsongit2

https://warmcat.com/git/libjsongit2

to provide a per-vhost service for presenting bare git repos in a
web interface.
2018-08-14 08:00:25 +08:00
Andy Green
f2f96857d6 fd_cloexec: add and use lws_open wrapper and lws_plat_apply_FD_CLOEXEC() on cgi 2018-06-23 12:56:21 +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
e9931680c8 sshd: fixes 2018-04-06 10:44:02 +08:00
Andy Green
cb70b6e633 win32: remove snprintf mangling
Everything in lws outside esp32 was changed to use lws_snprintf() a while ago.

This fixes a couple of stragglers and removes the preprocessor mangling.
2018-03-09 08:49:59 +08:00
Andy Green
b94091130b sshd: support async exec or shell close 2017-12-27 10:02:34 +08:00
Andy Green
a798db0e2b vhost: check cert validity dates
After startup, and once per day, check the validity dates on our ssl certs,
and broadcast callbacks with the information so interested plugins can
know.

If our clock is < May 2016, we don't try to judge the certs, because clearly
we don't know what time it is.
2017-11-26 19:17:10 +08:00
Andy Green
be525cb624 appveyor: Enable 64-bit build with OpenSSL and HTTP2
Fix warnings found from that

Introduce lws_ptr_diff(head, tail) helper to normalize
pointers to char *, do the subtraction and cast the
result to int.
2017-11-26 19:16:17 +08:00
Andy Green
89cb55ea58 tls: split out common, openssl and mbedtls code
- introduce lib/tls/mbedtls lib/tls/openssl
 - move wrapper into lib/tls/mbedtls/wrapper
 - introduce private helpers to hide backend

This patch doesn't replace or remove the wrapper, it moves it
to lib/tls/mbedtls/wrapper.

But it should be now that the ONLY functions directly consuming
wrapper apis are isolated in

  - lib/tls/mbedtls/client.c (180 lines)
  - lib/tls/mbedtls/server.c (317 lines)
  - lib/tls/mbedtls/ssl.c    (325 lines)

In particular there are no uses of openssl or mbedtls-related
constants outside of ./lib/tls any more.
2017-10-25 07:17:29 +08:00
Andy Green
7597ac3766 Plugins: add ssh-base ssh server plugin 2017-10-16 16:59:57 +08:00