Commit graph

15 commits

Author SHA1 Message Date
Andy Green
ffbefebc24 lwsws: remove no longer extant D option from help string
https://github.com/warmcat/libwebsockets/issues/986
2017-08-09 07:44:19 +08:00
Andy Green
786e6dbf35 mingw: updates 2017-04-28 07:51:34 +08:00
Joel Winarske
238766be6b windows: changes to build with VS2015 2017-02-18 17:27:22 +08:00
Andy Green
be9fb919d1 context deprecation
1) This makes lwsws run a parent process with the original permissions.
But this process is only able to respond to SIGHUP, it doesn't do anything
else.

2) You can send this parent process a SIGHUP now to cause it to

 - close listening sockets in existing lwsws processes

 - mark those processes as to exit when the number of active connections
   on the falls to zero

 - spawn a fresh child process from scratch, using latest configuration
   file content, latest plugins, etc.  It can now reopen listening sockets
   if it chooses to, or open different listen ports or whatever.

Notes:

1) lws_context_destroy() has been split into two pieces... the reason for
the split is the first part closes the per-vhost protocols, but since
they may have created libuv objects in the per-vhost protocol storage,
these cannot be freed until after the loop has been run.

That's the purpose of the second part of the context destruction,
lws_context_destroy2().

For compatibility, if you are not using libuv, the first part calls the
second part.  However if you are using libuv, you must now call the
second part from your own main.c after the first part.
2016-12-20 14:37:07 +08:00
Andy Green
69c88d9f0c context: external_baggage_free_on_destroy
This adds a context creation-time member that points to something
that should be freed when the context is destroyed.

It's in preparation for context deprecation, when a context might
be destroyed asynchronously... a related external with the
lifetime of thee context should also be freed at that time.

Adapt lwsws to use it with the context "strings" (also used for
aligned structs created by the config) allocation.
2016-12-20 14:37:07 +08:00
Andy Green
0c984014f0 lwsws license to cc0
https://github.com/warmcat/libwebsockets/issues/629
2016-09-19 19:16:47 +08:00
Andy Green
3358c53445 lwsws conf.c migrate to lib
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-26 21:12:11 +08:00
Andy Green
92b0d8a614 lwsws fix settable conf dir and error paths
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-22 07:01:35 +08:00
Andy Green
0a4da2c71f lwsws remove all protocols use lws default http
Actually lwsws doesn't need his own protocol handler even for http
any more.  The default http handler in lws should do everything.

Move the cgi routing into lws default http protocol handler, and
delete lwsws one.  Remove all protocols from lwsws so the lws
default one gets used.

With this, and the earlier move of lejp into lws, lwsws itself
becomes 15.5KB of x86_64 (mainly conf parsing).

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 11:28:30 +08:00
Andy Green
677d6c1516 lwsws cleanup and allocate config strings dynamically
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 10:42:19 +08:00
Andy Green
f530de84ac lwsws remove non libuv SIGINT handler
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 10:31:16 +08:00
Andy Green
cae57ad98d plugins_dir convert to array
If OOT lws plugins will be packaged as separate projects,
they're going to want to install their plugins somewhere
that makes sense for the package instead of one big lws
plugin dir.

This patch changes info to have a const char ** to a NULL
terminated array of directories it should search for
plugins.  lwsws knows about this and you can add to the
dir array using config fragments like

{
  "global": {
   "plugin-dir": "/usr/local/share/coherent-timeline/plugins"
  }
}

if the config fragment in /etc/lwsws/conf.d/ is also managed by the
package with the plugin, it can very cleanly add and remove itself
from lwsws based on package install status.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-02 10:03:25 +08:00
Andy Green
22d6f39e7f http2 update integration
https://github.com/warmcat/libwebsockets/issues/489

This

1) fixes the vhost changes on master

2) works around the ah pool changes

3) fixes some other build problems that appeared

4) hacks out physical flow control for internal streams

5) updates the advertised protocol to h2 needed by, eg, chrome 51

That gets it able to serve small (<4K, ie, one packet) files over http2

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
020770566e plugins
This adds support for dynamically loaded plugins at runtime, which
can expose their own protocols or extensions transparently.

With these changes lwsws defaults to OFF in cmake, and if enabled it
automatically enables plugins and libuv support.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-07 09:38:08 +08:00
Andy Green
cd0c696a0d lwsws Libwebsockets Web Server
This makes a start on the LibWebSockets WebServer.

The app cmake build support and JSON config parsing are implemented and
the app can start, create the vhosts, listen and serve file:// mounts on
them.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-28 10:49:57 +08:00