Commit graph

21 commits

Author SHA1 Message Date
Andy Green
19cc7acb24 fops-zip 2017-03-05 15:32:55 +08:00
Joel Winarske
390ba34400 ssl config for http client 2017-02-22 07:17:32 +08:00
Andy Green
ce37ee9624 gcc- format strings: debug and extra plugins 2017-02-05 22:30:27 +08:00
Andy Green
58a26ebf45 lejp-conf: add timeout-secs 2017-01-02 19:57:54 +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
ee94621b40 basic-auth 2016-12-16 22:08:13 +08:00
Andy Green
7a77c0b572 just finalize startup once 2016-12-16 22:08:13 +08:00
Andy Green
3b93e344f6 Add reject service keywords list 2016-10-13 06:32:57 +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
a496700b3a lws_snprintf
Thanks to Fabrice Gilot for reporting the problem that led to uncovering this.

Due to a misunderstanding of the return value of snprintf (it is not truncated according
to the max size passed in) in several places relying on snprintf to truncate the length
overflows are possible.

This patch wraps snprintf with a new lws_snprintf() which does truncate its length to allow
the buffer limiting scheme to work properly.

All users should update with these fixes.
2016-09-15 02:22:57 +08:00
Andy Green
e35d91a860 per-vhost headers and lwsws conf support
This l;ets you add per-vhost arbitrary headers on served files, eg

     "headers": [{
        "X-Content-Type-Options": "nosniff",
        "X-XSS-Protection": "1; mode=block",
        "x-frame-options": "SAMEORIGIN"
        }],
2016-08-27 17:07:06 +08:00
Andy Green
7acf76cd3d esp8266 initial support 2016-08-10 21:20:23 +08:00
Andy Green
f32d25051c ws ping pong on idle connections
This adds a new member to the context creation info struct "ws_ping_pong_interval".

If nonzero, it sets the number of seconds that established ws connections are
allowed to be idle before a PING is forced to be sent.  If zero (the default) then
tracking of idle connection is disabled for backwards compatibility.

Timeouts cover both the period between decision to send the ping and it being
sent (because it needs the socket to become writeable), and the period between
the ping being sent and the PONG coming back.

INFO debug logs are issues when the timeout stuff is operating.

You can test the server side by running the test server hacked to set ws_ping_pong_interval
and debug log mask of 15.  Both the mirror protocol and the server-status protocol are
idle if nothing is happening and will trigger the PING / PONG testing.  (You can also
test using lwsws and /etc/lwsws/conf with "ws-pingpong-secs": "20" in the global section)

For client, run the test client with -n -P 20 for 20s interval.  -n stops the test client
writing using the mirror protocol, so it will be idle and trigger the PING / PONGs.

The timeout interval may be up to +10s late, as lws checks for affected connections every
10s.
2016-08-10 21:20:23 +08:00
Andy Green
0aa382f6fb lejp-conf: substitute _lws_ddir_ with install dir 2016-07-14 08:57:28 +08:00
Andy Green
cd6a70672b lejp_conf: pmo as alias for cgi-env
Since cgi-env only applies for cgi types, we can
re-use it for generic per-mount options (pmo)
2016-07-14 08:57:28 +08:00
Andy Green
7a2fc442b6 protocol generic sessions
Signed-off-by: Andy Green <andy@warmcat.com>
2016-06-18 06:44:31 +08:00
Andy Green
4bd5b96735 lejp conf report human readable errors
Signed-off-by: Andy Green <andy@warmcat.com>
2016-06-18 06:42:13 +08:00
Andy Green
1ec8ba893a openssl allow set clear of ssl options from info 2016-06-10 11:09:27 +08:00
Andy Green
011f915dd0 ipv6only add lejp conf and flag docs
Signed-off-by: Andy Green <andy@warmcat.com>
2016-06-04 09:01:28 +08:00
Andy Green
2dc7ddecfd ipv6 move disable to vhost option
Server ipv6 support disable is now controlled by vhost->options rather
than context->options, allowing it to be set per-vhost.



Signed-off-by: Andy Green <andy@warmcat.com>
2016-06-03 21:19:40 +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
Renamed from lwsws/conf.c (Browse further)