Commit graph

1643 commits

Author SHA1 Message Date
Andy Green
2e11efa84b file_ops: add compression flags and convert open flags to pointer
ihttps://libwebsockets.org/pipermail/libwebsockets/2017-February/003127.html
2017-02-12 18:15:15 +08:00
Andy Green
21faff3deb file_ops: use wrappers for names 2017-02-12 18:11:11 +08:00
Andy Green
0b3e9e62cb client redirect: make sure there is a leading / on path 2017-02-10 11:00:38 +08:00
Andy Green
31c5130802 client: fix redirects and allow ssl / non-ssl redirects 2017-02-09 15:25:01 +08:00
Andy Green
5e25dc07c8 chunked http client: support in test-client and document
This improves the test client to

 - dump http content if INFO log level enabled
 - handle chunked content correctly
 - document lws_http_client_read()
2017-02-09 09:17:23 +08:00
Andy Green
c8b20910ec lwsl_visible 2017-02-09 09:11:17 +08:00
Andy Green
73f5e58682 gcc-format-strings: LWS_PLAT_OPTEE 2017-02-07 00:51:25 +08:00
Andy Green
9395eb62ce LWS_PLAT_OPTEE: Convert to use TEE_Malloc
OPTEE TAs should allocate via TEE_Malloc
2017-02-07 00:51:25 +08:00
Andy Green
066f4156d6 coverity 175437: forgot to add name to array for new USER log level 2017-02-07 00:51:25 +08:00
Andy Green
af9ddec2f7 coverity 175435: seems bogus 2017-02-07 00:51:25 +08:00
Andy Green
a17992b638 coverity 175436: dead cruft 2017-02-07 00:51:25 +08:00
Andy Green
fdb25fcd6e gcc format strings: http2 2017-02-07 00:51:25 +08:00
andSpace
7df395695b LWS_FALLBACK_GETHOSTBYNAME
Adapted by AG to not use-after-free and have LWS_FALLBACK_GETHOSTBYNAME
2017-02-05 22:30:27 +08:00
Andy Green
ce37ee9624 gcc- format strings: debug and extra plugins 2017-02-05 22:30:27 +08:00
Martin Milata
be1f0a3a92 Subject: gcc format strings: Make GCC check format strings, fix found problems 2017-02-05 21:32:30 +08:00
Martin Milata
e96b69887f docs: Correct string 2017-02-05 21:31:16 +08:00
Sven Hoffmann
b5ebd599b2 post processing: fix problem where hex cant straddle block correctly 2017-02-05 21:25:39 +08:00
Andy Green
24e77a04ab remove dump getaddrinfo result 2017-02-03 20:55:56 +08:00
Andy Green
ad945976f7 client: decruft extensions
https://github.com/warmcat/libwebsockets/issues/770
2017-02-03 10:39:37 +08:00
Andy Green
c2208640dd logging: cleanup and introduce LLL_USER 2017-01-31 10:50:15 +08:00
Andy Green
71bb400805 http_proxy: deal with redundant protocol leader
https://github.com/warmcat/libwebsockets/issues/764
2017-01-26 07:27:11 +08:00
Denis Osvald
76985f256d wsi remove unused 'upgraded' boolean field
It was introduced in 7df53c5550
but was never used...

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2017-01-23 20:04:06 +08:00
Andy Green
716aaeeb8b context new option LWS_SERVER_OPTION_JUST_USE_RAW_ORIGIN
https://github.com/warmcat/libwebsockets/issues/757
2017-01-23 19:52:27 +08:00
Denis Osvald
cc806bb77e ssl pass real wsi to verify cert cb
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2017-01-23 19:35:00 +08:00
Denis Osvald
bcce73201f ssl expose public wsi->ssl getter
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2017-01-23 19:34:46 +08:00
Andy Green
1bc025cfa7 windows: reduce C99isms to something MS compiler can understand 2017-01-18 07:20:09 +08:00
Andy Green
51c96d8c2a plat-optee and boringssl adaptations 2017-01-17 07:01:02 +08:00
Andy Green
e680fb9193 win32 fixes
https://github.com/warmcat/libwebsockets/issues/750
2017-01-17 06:51:11 +08:00
Tobias
3f55e5e964 ignore leading spaces when checking for a suitable subprotocol
My Browsers send as Subprotocols e.g. chat, superchat, mySubprotocol (with spaces after the ,). Libwebsockets now checked if ' mySubprotocol' was equal to 'mySubprotocol' which failed. With this fix the leading space is ignored and uses 'mySubprotocol' for comparision.
2017-01-17 06:22:58 +08:00
Namowen
b837f93dcf ssl: add LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION 2017-01-10 09:31:23 +08:00
Andy Green
9e562fcf1b ssl: wolfssl doesn't have clear options
https://github.com/warmcat/libwebsockets/issues/741
2017-01-10 09:14:44 +08:00
Hai Vu
8b7704f1b3 ssl-correct-option-clear-availability-version
https://github.com/warmcat/libwebsockets/issues/744
2017-01-10 09:10:49 +08:00
Andy Green
a7bf178606 ssl: correct version detection 2017-01-07 11:29:32 +08:00
Andy Green
1e22719f5e polarssl: turn off missing tlsext 2017-01-07 10:24:16 +08:00
Andy Green
c001a15973 openssl: deal with missing OPENSSL_NO_TLSEXT on ancient versions 2017-01-06 09:49:28 +08:00
Andy Green
b3c2427cfd client: MORE_SERVICE is not an error 2017-01-04 19:59:38 +08:00
Andy Green
a0c4a0e253 cgi: 5s grace to send buffered if chunked 2017-01-03 08:18:37 +08:00
Denis Osvald
9b129c137a server: check listen(2) return value
The `listen` call can fail with EADDRINUSE after bind() succeeds, for
example because another process called listen on that port in the
meantime, or under some circumstances with IPv6-mapped-IPv4. This was
causing EINVAL on accept, with an infinite loop in case of libuv.

A reproducible example was to run nc -l -p 5555 ( OpenBSD netcat (Debian
patchlevel 1)) before starting test-server

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2017-01-03 01:56:20 +08:00
Andy Green
58a26ebf45 lejp-conf: add timeout-secs 2017-01-02 19:57:54 +08:00
Andy Green
714f66f5b7 windows: remove preprocessor business for [v]snprintf
https://github.com/warmcat/libwebsockets/issues/731
2016-12-28 15:23:34 +08:00
namowen
85f0c283dd lws_plat_service_tsi: accessing context before checking for NULL
https://github.com/warmcat/libwebsockets/issues/730
2016-12-24 07:57:34 +08:00
Andy Green
dd0dfaecb7 ESP8266: LWS_POSIX fixes for basic auth and deprecated context 2016-12-22 11:32:34 +08:00
Alan Conway
f3ad9540fa ssl-server: Add CONTEXT_PORT_NO_LISTEN_SERVER
Special port setting to disable listening for a server using socket adoption.
This contrasts with CONTEXT_PORT_NO_LISTEN which does the same for a client.

In particular, server-side SSL is not disabled by CONTEXT_PORT_NO_LISTEN_SERVER
as it is by CONTEXT_PORT_NO_LISTEN.
2016-12-21 09:32:44 +08:00
Alan Conway
63627e7e86 ssl: improved error reporting for SSL_accept.
The return value from SSL_get_error() is an integer switch value, not an error
code that can be interpreted by ERR_error_string()

Report the error code name, plus errno information if available for
SSL_ERROR_SYSCALL as per man page for SSL_get_error().
2016-12-21 09:32:25 +08:00
Alan Conway
acdf0c7066 server: expose lws_adopt_socket_vhost() as public API
Allows a socket to be adopted and associated with an existing vhost.
Also added corresponding  lws_adopt_socket_vhost_readbuf()
2016-12-21 09:32:16 +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
0a3859f623 uv: dont try to touch watcher until after loop initialized 2016-12-20 14:37:07 +08:00
Andy Green
5bc0343a85 client ssl hostname check: trim any port on host header 2016-12-20 14:37:07 +08:00
Andy Green
e0bed8da33 ipv6-allow-binding-to-ipv6-address-in-iface
ipv4 and ipv6 binding to a named interface works OK.  ipv4 binding to an IP also
works, but we need some extra ipv6 magic to identify the ipv6 interface from an
ipv6 address.

This patch based on code from "user3546716" at
http://stackoverflow.com/questions/13504934/binding-sockets-to-ipv6-addresses

adds the necessary magic.

https://github.com/warmcat/libwebsockets/issues/717
2016-12-20 14:37:07 +08:00
Andy Green
ad99232f8c client: if NULL protocol vhost same linked list entry
Lws maintains a linked-list of wsi that are on the same vhost protocol...
it walks it to perform ..._all_protocol() type apis.

Client connections also participate in this list, but in the case the
selected protocol is not given during negotation (a legal case where
the server default protocol is selected) we missed adding the new
ws negotiated client wsi to the list.

This patch makes sure we add the wsi to the vhost protocols[0] list
in that case.

https://github.com/warmcat/libwebsockets/issues/716
2016-12-20 14:37:07 +08:00