Andy Green [Fri, 3 Mar 2017 01:19:14 +0000 (09:19 +0800)]
junzip: style and migrate header into private-libwebsockets.h
Also introduce CMake LWS_WITH_ZIP_FOPS defaulting to ON that builds junzip.c and
make sure this is exported in lws_config.h (included by libwebsockets.h)
Improve lws handling of stdint.h import or simulate it.
Andy Green [Fri, 3 Mar 2017 00:44:04 +0000 (08:44 +0800)]
junzip: import from DomTerm
912add15f3d0aec
From https://github.com/PerBothner/DomTerm.git
Andy Green [Fri, 3 Mar 2017 00:18:16 +0000 (08:18 +0800)]
ev: fix build
Per Bothner [Thu, 2 Mar 2017 23:36:08 +0000 (07:36 +0800)]
adopt: allow binding to parent at same time
- if protocol set, allocate own user_space
If the child wsi wants the parent wsi user_space, it can use
lws_wsi_user(lws_get_parent(child_wsi))
- raw file close processing handles parent-child relationship
Michael Behrns-Miller [case-ubuntu] [Thu, 2 Mar 2017 14:46:41 +0000 (09:46 -0500)]
Subject: Buffer index protection in the case where client does not
receive content length from HTTP server
Whisperbyte [Wed, 1 Mar 2017 09:57:38 +0000 (17:57 +0800)]
docs: mac: add info from github
Andy Green [Wed, 1 Mar 2017 06:28:56 +0000 (14:28 +0800)]
fops: allow setting from context creation and introduce lws_select_fops_by_vfs_path
1) There's now a .fops pointer that can be set in the context creation info. If set, the array of
fops it points to (terminated by an entry with .open = NULL) is walked to find out the best vfs filesystem
path match (comparing the vfs path to fops.path_prefix) for which fops to use.
If none given (.fops is NULL in info) then behaviour is as before, fops are the platform-provided one only.
2) The built in fileserving now walks any array of fops looking for the best fops match automatically.
3) lws_plat_file_... apis are renamed to lws_vfs_file_...
Andy Green [Mon, 27 Feb 2017 04:55:56 +0000 (12:55 +0800)]
adoption: make union for socket and file fds
This lets lws support adopting raw file FDs and raw socket fds.
A test plugin creates a FIFO and prints data sent on it, using
the lws event loop.
Andy Green [Wed, 1 Mar 2017 00:56:25 +0000 (08:56 +0800)]
fops: add path_prefix member
Lukas Geyer [Tue, 28 Feb 2017 13:17:25 +0000 (21:17 +0800)]
client: allow change externally-defined wsi user_data
https://github.com/warmcat/libwebsockets/issues/819
AG: add explanation in doxygen comment and check user_space was externally set
Andy Green [Mon, 27 Feb 2017 04:54:58 +0000 (12:54 +0800)]
docs: remove in-tree version
It's a nice idea having them in-tree, but it leaves too much jumk
in the patches.
The up-to-date api for master will continue to be here
https://libwebsockets.org/lws-api-doc-master/html/index.html
Silas Parker [Tue, 28 Feb 2017 10:29:57 +0000 (18:29 +0800)]
cosmetic fix trailing newline on log
Andy Green [Mon, 27 Feb 2017 23:51:56 +0000 (07:51 +0800)]
cmake: create build/include
Andy Green [Mon, 27 Feb 2017 20:03:26 +0000 (04:03 +0800)]
client: take care of rx close during pending partial same as server does
https://github.com/warmcat/libwebsockets/issues/816
Andy Green [Sat, 25 Feb 2017 04:42:45 +0000 (12:42 +0800)]
fops: refactor around lws_fops_fd_t
Namowen [Sat, 25 Feb 2017 20:24:40 +0000 (04:24 +0800)]
ssl: avoid EVP errors
Silas Parker [Wed, 22 Feb 2017 11:25:47 +0000 (11:25 +0000)]
Prevent SSL downgrade during redirect
Silas Parker [Wed, 22 Feb 2017 09:25:24 +0000 (09:25 +0000)]
Add client support for relative reference redirects
Andy Green [Wed, 22 Feb 2017 02:26:42 +0000 (10:26 +0800)]
docs: catch up with decruft
Andy Green [Wed, 22 Feb 2017 01:54:47 +0000 (09:54 +0800)]
mbedtls: remove abortive attempt to avoid confusing people
Basically we support openssl api compatibles only.
If we ever try something different we need a shim making it openssl api or a proper abstraction layer added first.
Andy Green [Wed, 22 Feb 2017 01:50:11 +0000 (09:50 +0800)]
mbed3: sayonara
The port was technically worthwhile and laid the groundwork for ESP support.
But now it is just useless cruft like mbed3 itself...
Joel Winarske [Tue, 21 Feb 2017 23:28:13 +0000 (07:28 +0800)]
client: allow setting client ssl certs from lwsws and connection info separate from server ssl certs
Joel Winarske [Tue, 21 Feb 2017 04:53:58 +0000 (20:53 -0800)]
ssl config for http client
Martin Milata [Tue, 21 Feb 2017 22:39:59 +0000 (23:39 +0100)]
gcc format strings: couple more
Found on MIPS
Andy Green [Tue, 21 Feb 2017 22:55:12 +0000 (06:55 +0800)]
client: move redirects and c_port out of union
https://github.com/warmcat/libwebsockets/issues/810
Andy Green [Tue, 21 Feb 2017 15:38:40 +0000 (23:38 +0800)]
client connect: oom4 clean up timeout list
https://github.com/warmcat/libwebsockets/issues/810
Andy Green [Tue, 21 Feb 2017 14:59:00 +0000 (22:59 +0800)]
client redirect: choose correct error path after resetting client connection
https://github.com/warmcat/libwebsockets/issues/810
Silas Parker [Tue, 21 Feb 2017 11:27:47 +0000 (19:27 +0800)]
ssl close improvement
Andy Green [Sun, 12 Feb 2017 12:32:49 +0000 (20:32 +0800)]
raw: adoption and processing
Silas Parker [Mon, 20 Feb 2017 23:27:07 +0000 (07:27 +0800)]
url-parser: handle ipv6 [] addresses
Namowen [Sun, 19 Feb 2017 22:20:56 +0000 (06:20 +0800)]
vhost: also free per-vhost protocols list even when no PLUGINS
Andy Green [Sun, 19 Feb 2017 21:44:56 +0000 (05:44 +0800)]
ssl close: do explicit ssl shutdown instead of socket shutdown if ssl mode
Namowen [Sat, 18 Feb 2017 21:35:55 +0000 (05:35 +0800)]
cosmetic CR missing on some errs
Andy Green [Sat, 18 Feb 2017 09:26:40 +0000 (17:26 +0800)]
ESP32 platform
This is enough for all the test app features to work on ESP32 without
SSL.
Yuchen Xie [Sat, 18 Feb 2017 07:51:34 +0000 (15:51 +0800)]
Fix typo
Namowen [Fri, 17 Feb 2017 23:51:27 +0000 (07:51 +0800)]
client: fix X509_V_ERR_CERT_HAS_EXPIRED
Joel Winarske [Thu, 16 Feb 2017 07:29:08 +0000 (15:29 +0800)]
client: direct _APPEND_HANDSHAKE_HEADER at wsi protocol
Yongwen Zhuang [Wed, 15 Feb 2017 09:58:39 +0000 (17:58 +0800)]
Correct Cross compiling commandline
Andy Green [Wed, 15 Feb 2017 01:12:39 +0000 (09:12 +0800)]
client: allow http[s] to select targeted protocol name in vhost
Joel Winarske [Tue, 14 Feb 2017 19:17:09 +0000 (11:17 -0800)]
windows: changes to build with VS2015
Silas Parker [Tue, 14 Feb 2017 15:14:09 +0000 (23:14 +0800)]
fix close packet index coding
https://github.com/warmcat/libwebsockets/issues/792
Silas Parker [Tue, 14 Feb 2017 09:55:13 +0000 (17:55 +0800)]
gcc-format-strings: ipv6
Per Bothner [Tue, 14 Feb 2017 01:44:57 +0000 (09:44 +0800)]
gzip fixes
Andy Green [Tue, 14 Feb 2017 01:26:53 +0000 (09:26 +0800)]
client: close without spinning
https://github.com/warmcat/libwebsockets/issues/789
Andy Green [Sun, 12 Feb 2017 10:15:15 +0000 (18:15 +0800)]
file_ops: add compression flags and convert open flags to pointer
ihttps://libwebsockets.org/pipermail/libwebsockets/2017-February/003127.html
Andy Green [Sun, 12 Feb 2017 10:11:11 +0000 (18:11 +0800)]
file_ops: use wrappers for names
Andy Green [Fri, 10 Feb 2017 03:00:38 +0000 (11:00 +0800)]
client redirect: make sure there is a leading / on path
Andy Green [Thu, 9 Feb 2017 23:37:35 +0000 (07:37 +0800)]
appveyor: make zip artifact
Andy Green [Thu, 9 Feb 2017 07:25:01 +0000 (15:25 +0800)]
client: fix redirects and allow ssl / non-ssl redirects
Andy Green [Thu, 9 Feb 2017 01:10:57 +0000 (09:10 +0800)]
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()
Andy Green [Thu, 9 Feb 2017 01:11:17 +0000 (09:11 +0800)]
lwsl_visible
Johnny [Tue, 7 Feb 2017 19:09:34 +0000 (20:09 +0100)]
test client: some compilers dont accept void * as const char *
This fixes a conversion error from a void pointer to a string.
Andy Green [Mon, 6 Feb 2017 06:35:30 +0000 (14:35 +0800)]
gcc-format-strings: LWS_PLAT_OPTEE
Andy Green [Mon, 30 Jan 2017 07:02:54 +0000 (15:02 +0800)]
LWS_PLAT_OPTEE: Convert to use TEE_Malloc
OPTEE TAs should allocate via TEE_Malloc
Andy Green [Mon, 6 Feb 2017 02:16:45 +0000 (10:16 +0800)]
coverity 175437: forgot to add name to array for new USER log level
Andy Green [Mon, 6 Feb 2017 02:14:47 +0000 (10:14 +0800)]
coverity 175438: server status plugin: off-by-one if you generate 32KB of content
Andy Green [Mon, 6 Feb 2017 02:10:41 +0000 (10:10 +0800)]
coverity 175435: seems bogus
Andy Green [Mon, 6 Feb 2017 02:04:04 +0000 (10:04 +0800)]
coverity 175436: dead cruft
Andy Green [Sun, 5 Feb 2017 14:48:12 +0000 (22:48 +0800)]
gcc format strings: http2
andSpace [Sun, 5 Feb 2017 13:47:08 +0000 (21:47 +0800)]
LWS_FALLBACK_GETHOSTBYNAME
Adapted by AG to not use-after-free and have LWS_FALLBACK_GETHOSTBYNAME
Andy Green [Sun, 5 Feb 2017 14:07:34 +0000 (22:07 +0800)]
gcc- format strings: debug and extra plugins
Martin Milata [Sat, 4 Feb 2017 12:09:00 +0000 (13:09 +0100)]
Subject: gcc format strings: Make GCC check format strings, fix found problems
Martin Milata [Sat, 4 Feb 2017 12:03:26 +0000 (13:03 +0100)]
docs: Correct string
Sven Hoffmann [Sun, 5 Feb 2017 13:25:39 +0000 (21:25 +0800)]
post processing: fix problem where hex cant straddle block correctly
Andy Green [Fri, 3 Feb 2017 12:55:56 +0000 (20:55 +0800)]
remove dump getaddrinfo result
Andy Green [Fri, 3 Feb 2017 02:39:37 +0000 (10:39 +0800)]
client: decruft extensions
https://github.com/warmcat/libwebsockets/issues/770
Andy Green [Tue, 31 Jan 2017 02:50:15 +0000 (10:50 +0800)]
logging: cleanup and introduce LLL_USER
Andy Green [Wed, 25 Jan 2017 23:27:11 +0000 (07:27 +0800)]
http_proxy: deal with redundant protocol leader
https://github.com/warmcat/libwebsockets/issues/764
Denis Osvald [Mon, 23 Jan 2017 11:36:56 +0000 (12:36 +0100)]
wsi remove unused 'upgraded' boolean field
It was introduced in
7df53c555009d599c0474e49c58d3f8a46792382
but was never used...
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Andy Green [Mon, 23 Jan 2017 11:52:27 +0000 (19:52 +0800)]
context new option LWS_SERVER_OPTION_JUST_USE_RAW_ORIGIN
https://github.com/warmcat/libwebsockets/issues/757
Denis Osvald [Mon, 23 Jan 2017 11:35:00 +0000 (19:35 +0800)]
ssl pass real wsi to verify cert cb
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Denis Osvald [Mon, 23 Jan 2017 11:34:46 +0000 (19:34 +0800)]
ssl expose public wsi->ssl getter
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Andy Green [Tue, 17 Jan 2017 23:20:09 +0000 (07:20 +0800)]
windows: reduce C99isms to something MS compiler can understand
Andy Green [Mon, 16 Jan 2017 23:01:02 +0000 (07:01 +0800)]
plat-optee and boringssl adaptations
Andy Green [Mon, 16 Jan 2017 22:51:11 +0000 (06:51 +0800)]
win32 fixes
https://github.com/warmcat/libwebsockets/issues/750
Tobias [Mon, 16 Jan 2017 11:01:25 +0000 (12:01 +0100)]
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.
Namowen [Tue, 10 Jan 2017 01:31:23 +0000 (09:31 +0800)]
ssl: add LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION
Andy Green [Tue, 10 Jan 2017 01:14:44 +0000 (09:14 +0800)]
ssl: wolfssl doesn't have clear options
https://github.com/warmcat/libwebsockets/issues/741
Hai Vu [Tue, 10 Jan 2017 01:10:49 +0000 (09:10 +0800)]
ssl-correct-option-clear-availability-version
https://github.com/warmcat/libwebsockets/issues/744
Andy Green [Sat, 7 Jan 2017 03:29:32 +0000 (11:29 +0800)]
ssl: correct version detection
Andy Green [Sat, 7 Jan 2017 02:24:16 +0000 (10:24 +0800)]
polarssl: turn off missing tlsext
Andy Green [Fri, 6 Jan 2017 01:49:28 +0000 (09:49 +0800)]
openssl: deal with missing OPENSSL_NO_TLSEXT on ancient versions
Andy Green [Wed, 4 Jan 2017 12:23:10 +0000 (20:23 +0800)]
cmake: boringssl helper
Andy Green [Wed, 4 Jan 2017 11:59:38 +0000 (19:59 +0800)]
client: MORE_SERVICE is not an error
Andy Green [Tue, 3 Jan 2017 00:18:37 +0000 (08:18 +0800)]
cgi: 5s grace to send buffered if chunked
Denis Osvald [Mon, 2 Jan 2017 16:33:26 +0000 (17:33 +0100)]
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>
Andy Green [Mon, 2 Jan 2017 11:57:54 +0000 (19:57 +0800)]
lejp-conf: add timeout-secs
Andy Green [Wed, 28 Dec 2016 07:23:34 +0000 (15:23 +0800)]
windows: remove preprocessor business for [v]snprintf
https://github.com/warmcat/libwebsockets/issues/731
namowen [Fri, 23 Dec 2016 23:57:34 +0000 (07:57 +0800)]
lws_plat_service_tsi: accessing context before checking for NULL
https://github.com/warmcat/libwebsockets/issues/730
Andy Green [Fri, 23 Dec 2016 23:37:40 +0000 (07:37 +0800)]
test server: add -P secs to allow pingpong test
Andy Green [Thu, 22 Dec 2016 03:32:34 +0000 (11:32 +0800)]
ESP8266: LWS_POSIX fixes for basic auth and deprecated context
Alan Conway [Wed, 21 Dec 2016 01:32:44 +0000 (09:32 +0800)]
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.
Alan Conway [Wed, 21 Dec 2016 01:32:25 +0000 (09:32 +0800)]
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().
Alan Conway [Wed, 21 Dec 2016 01:32:16 +0000 (09:32 +0800)]
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()
Andy Green [Thu, 15 Dec 2016 23:37:43 +0000 (07:37 +0800)]
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.
Andy Green [Fri, 16 Dec 2016 00:41:16 +0000 (08:41 +0800)]
uv: dont try to touch watcher until after loop initialized
Namowen [Thu, 15 Dec 2016 23:02:59 +0000 (07:02 +0800)]
echo: fix debug build
https://github.com/warmcat/libwebsockets/issues/716#issuecomment-
267377856
Andy Green [Thu, 15 Dec 2016 05:22:40 +0000 (13:22 +0800)]
client ssl hostname check: trim any port on host header
Andy Green [Thu, 15 Dec 2016 05:25:25 +0000 (13:25 +0800)]
test-client: fix broken protocol names
Andy Green [Thu, 15 Dec 2016 01:58:20 +0000 (09:58 +0800)]
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