vpeter4 [Sun, 27 Apr 2014 11:35:28 +0000 (13:35 +0200)]
Disable compile error: statement with no effect
vpeter4 [Sun, 27 Apr 2014 11:28:22 +0000 (13:28 +0200)]
Disable compile warning: no newline at end of file
Andy Green [Sun, 20 Apr 2014 23:27:19 +0000 (08:27 +0900)]
introduce LWS_FEATURE_ tests
Help user code be compatible with multiple LWS versions by
providing #ifdef -testable flags for API changes
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 20 Apr 2014 22:59:44 +0000 (07:59 +0900)]
libev stub macros need to reflect void when disabled
Reported-by: Michael Harberler <mail17@mah.priv.at>
Signed-off-by: Andy Green <andy.green@linaro.org>
Patrick Gansterer [Tue, 15 Apr 2014 16:45:48 +0000 (18:45 +0200)]
Windows: Fix implementation of lws_plat_inet_ntop()
We need to pass a sockaddr_in6 struct to WSAAddressToString() to have a
working implementation for IPV6. Also use the WideChar version to allow
compilation on Windows CE too.
Patrick Gansterer [Tue, 15 Apr 2014 16:42:57 +0000 (18:42 +0200)]
Windows: Use gai_strerrorW() instead of gai_strerror()
This allows compilation on Windows CE too.
Patrick Gansterer [Tue, 15 Apr 2014 16:41:38 +0000 (18:41 +0200)]
Windows: Fix the passed parameter to the setsockopt function
This avoids compiler warnings about missmatched parameter types.
Patrick Gansterer [Tue, 15 Apr 2014 16:40:31 +0000 (18:40 +0200)]
Declare the lws_ssl_capable_*_no_ssl function outside the SSL #ifdef
This avoids a compiler warning about a not declared function.
Patrick Gansterer [Tue, 15 Apr 2014 16:39:26 +0000 (18:39 +0200)]
Fix compilation on Windows CE after cleanup
Patrick Gansterer [Tue, 15 Apr 2014 16:38:54 +0000 (18:38 +0200)]
Fix include statement of in6addr.h
Only include it when CMake can find it. This works with MinGW and WinCE.
Andy Green [Sat, 12 Apr 2014 03:47:25 +0000 (11:47 +0800)]
rxflow just return 0 when changing state
Nobody cares if we changed state, and callers are
increasingly taking nonzero as fail, causing us to
drop the connection when we re-enable rxflow.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 12 Apr 2014 03:10:35 +0000 (11:10 +0800)]
windows ipv6 add necessary header
Thanks to Marjan and Joakim
https://github.com/warmcat/libwebsockets/issues/108#issuecomment-
40075600
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 12 Apr 2014 02:07:02 +0000 (10:07 +0800)]
refactor move ssl server service to ssl.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 11 Apr 2014 05:14:37 +0000 (13:14 +0800)]
refactor libev eliminate all code ifdefs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 09:06:59 +0000 (17:06 +0800)]
fixes for close flush
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 07:15:13 +0000 (15:15 +0800)]
fixup no extentsion around last clean
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 06:25:24 +0000 (14:25 +0800)]
close should flush any truncated send before really closing
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 06:08:10 +0000 (14:08 +0800)]
clean=various ifdef reduction
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 03:23:18 +0000 (11:23 +0800)]
truncated send always callback on writeable
Suggested by a Windows log where leaf.jpg meets EAGAIN and after
issuing the truncated send buffer, never sends any more
https://github.com/warmcat/libwebsockets/issues/111#issuecomment-
39873129
Added note in README.coding about WRITEABLE callbacks able to
be generated by lws.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 03:11:06 +0000 (11:11 +0800)]
test server extend timeout while sending leaf
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 03:03:22 +0000 (11:03 +0800)]
inform timeout source when TIMEDOUT_WAITING
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 10 Apr 2014 02:13:43 +0000 (10:13 +0800)]
docs clarify create context comment threading not supported
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 8 Apr 2014 15:15:02 +0000 (16:15 +0100)]
move SNI temp var back one
Reported as making trouble on Windows by spayton
https://github.com/warmcat/libwebsockets/issues/109
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 8 Apr 2014 06:26:30 +0000 (07:26 +0100)]
define LWS_SSL_CAPPABLE return codes even when no SSL enabled
Reported by fuzzy
https://github.com/warmcat/libwebsockets/issues/107
Signed-off-by: Andy Green <andy.green@linaro.org>
spayton [Mon, 7 Apr 2014 17:43:58 +0000 (18:43 +0100)]
Update private-libwebsockets.h
fixes windows http file serve - macro compatible_file_read() incorrectly used 'amount' instead of '_amount'
Joakim Soderberg [Mon, 7 Apr 2014 09:28:08 +0000 (11:28 +0200)]
windows Fix build.
Andy Green [Mon, 7 Apr 2014 05:25:07 +0000 (06:25 +0100)]
windows clean out redundant inet_ntop prototype
Suggested by Joakim Soderberg https://github.com/warmcat/libwebsockets/issues/103#issuecomment-
39684559
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 6 Apr 2014 11:39:22 +0000 (12:39 +0100)]
fix ssl error reporting
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 6 Apr 2014 11:41:20 +0000 (12:41 +0100)]
allow signals during send
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 6 Apr 2014 11:40:16 +0000 (12:40 +0100)]
fix accept nonzero as close from WRITEABLE callback
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 5 Apr 2014 15:48:48 +0000 (16:48 +0100)]
refactor use unified ssl read write functions
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 6 Apr 2014 05:26:35 +0000 (06:26 +0100)]
refactor add ssl read write single implementation
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 15:34:09 +0000 (23:34 +0800)]
windows allow syslog log target to mao to stderr
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 14:38:49 +0000 (22:38 +0800)]
windows fix breakage from plat refactor
Reported-by Marjan Tomas
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 11:52:37 +0000 (19:52 +0800)]
windows fix SetFilePointer args
This restricts it to 4GB files on 32-bit Windows but it'll do for now.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 06:33:48 +0000 (14:33 +0800)]
http2 add initial alpn support
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 02:17:00 +0000 (10:17 +0800)]
refactor ssl related code into ssl.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 02:11:04 +0000 (10:11 +0800)]
clean small additional ifdef reduction
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 01:03:37 +0000 (09:03 +0800)]
refactor handshake client and server handling into client.c and server.c
Eliminate more #ifdefs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 00:40:05 +0000 (08:40 +0800)]
refactor move flow control to server.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 3 Apr 2014 00:24:29 +0000 (08:24 +0800)]
refactor migrate client and server specific context init into client.c and server.c
Eliminate some NO_CLIENT and NO_SERVER
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 23:42:50 +0000 (07:42 +0800)]
refactor pollfd related functions into pollfd.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 23:36:41 +0000 (07:36 +0800)]
refactor service related functions into service.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 23:29:50 +0000 (07:29 +0800)]
refactor context related functions into context.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 23:17:10 +0000 (07:17 +0800)]
remove libev build tag
It's told during context init if it uses libev or not in the logs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 23:16:40 +0000 (07:16 +0800)]
clean move lws_plat externs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 15:03:23 +0000 (23:03 +0800)]
ipv6 use lws_plat_ to avoid win naming collision
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 13:31:07 +0000 (21:31 +0800)]
win32 inet_top
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 13:18:11 +0000 (21:18 +0800)]
changelog add info about cmake needing clean build dir sometimes
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 13:02:54 +0000 (21:02 +0800)]
plat change to build selection by cmake
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 11:45:42 +0000 (19:45 +0800)]
refactor out most NO_EXTENSIONS
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 2 Apr 2014 06:25:10 +0000 (14:25 +0800)]
refactor out WIN32 tests from code
This gets rid of all the platform-dependent #ifdef stuff and
migrates it into the new lws-plat-xxx.c files.
These are then included in a one-time test in libwebsockets.c
according basically to Windows or not.
The idea is from now on, all Windows-specific code should go in
lws-plat-win.c, where any kind of Windows perversion like DWORD
is fine.
Any new functions going in there should be named lws_plat_...
and be defined in all the lws-plat-xxx.c file (currently just
win32 and unix platforms are supported).
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 1 Apr 2014 06:20:44 +0000 (14:20 +0800)]
truncated send issue independent of LWS_NO_EXTENSIONS 2
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 1 Apr 2014 03:24:44 +0000 (11:24 +0800)]
truncated send issue independent of LWS_NO_EXTENSIONS
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 1 Apr 2014 01:59:23 +0000 (09:59 +0800)]
only use clean buffer for failed write if sent something
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 1 Apr 2014 00:36:36 +0000 (08:36 +0800)]
libev protect when disabled at runtime in server.c
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 31 Mar 2014 14:03:09 +0000 (22:03 +0800)]
win32 clean remove leftover ifdef
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 31 Mar 2014 06:42:56 +0000 (14:42 +0800)]
fix libev build
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 31 Mar 2014 03:01:32 +0000 (11:01 +0800)]
clean libwebsockets.c
Signed-off-by: None <None>
Patrick Gansterer [Sun, 30 Mar 2014 08:19:23 +0000 (10:19 +0200)]
Cleanup header includes
Patrick Gansterer [Sun, 30 Mar 2014 08:18:51 +0000 (10:18 +0200)]
Remove useless usage of ssize_t
Patrick Gansterer [Sun, 30 Mar 2014 07:54:55 +0000 (09:54 +0200)]
Windows: Support LWS_POLLHUP socket event
Patrick Gansterer [Sun, 30 Mar 2014 07:18:05 +0000 (09:18 +0200)]
Introduce LWS_POLLIN, LWS_POLLOUT and LWS_POLLHUP
Andy Green [Sun, 30 Mar 2014 01:48:59 +0000 (09:48 +0800)]
Merge branch 'tid' of https://github.com/paroga/libwebsockets
Patrick Gansterer [Sat, 29 Mar 2014 08:34:24 +0000 (09:34 +0100)]
Add missing resetting of the service_tid on Windows
Patrick Gansterer [Sat, 29 Mar 2014 07:25:58 +0000 (08:25 +0100)]
Remove websock-w32.h
Patrick Gansterer [Sat, 29 Mar 2014 07:05:07 +0000 (08:05 +0100)]
Move #define for random() into the test applications where needed
Patrick Gansterer [Sat, 29 Mar 2014 06:52:37 +0000 (07:52 +0100)]
Remove unreferenced local variable on Windows
Patrick Gansterer [Sat, 29 Mar 2014 06:52:01 +0000 (07:52 +0100)]
Use Sleep() instead of usleep() on Windows
Patrick Gansterer [Sat, 29 Mar 2014 06:43:38 +0000 (07:43 +0100)]
Remove dummy headers for Windows
Patrick Gansterer [Sat, 29 Mar 2014 06:15:40 +0000 (07:15 +0100)]
Remove emulated_poll on Windows
Patrick Gansterer [Fri, 28 Mar 2014 14:44:56 +0000 (15:44 +0100)]
windows Use WSAWaitForMultipleEvents() instead of poll() on Windows
Patrick Gansterer [Fri, 28 Mar 2014 17:09:20 +0000 (18:09 +0100)]
Build fixes for WindowsCE
Patrick Gansterer [Fri, 28 Mar 2014 08:28:13 +0000 (09:28 +0100)]
Remove duplicated code for setting the socket options
Patrick Gansterer [Fri, 28 Mar 2014 07:28:02 +0000 (08:28 +0100)]
Fix IPv6 on non-Linux platforms
Andy Green [Fri, 28 Mar 2014 06:00:01 +0000 (14:00 +0800)]
cyassl skip setting SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
It's already the default and no "SSL_set_mode" in CYASSL
Reported by Chris Conlon <chris@wolfssl.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Patrick Gansterer [Thu, 27 Mar 2014 10:21:41 +0000 (11:21 +0100)]
Fix nonblocking connect on Windows
Use the correct value for the call to ioctlsocket() to set the socket to
nonblocking mode and check for WSAWOULDBLOCK return value of connect().
Andy Green [Tue, 25 Mar 2014 06:08:21 +0000 (14:08 +0800)]
ipv6 client fix
noticed by James Devine
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 24 Mar 2014 08:09:25 +0000 (16:09 +0800)]
ipv6 integration fixes
Disable for build using -DLWS_IPV6= on the cmake line
James Devine [Mon, 24 Mar 2014 08:09:25 +0000 (16:09 +0800)]
add ipv6 support
(changed to support runtime disable + integration by andy@warmcat.com)
Andy Green [Sun, 23 Mar 2014 07:15:54 +0000 (15:15 +0800)]
fix NO_EXTENSIONS
reported by gaby64
https://github.com/warmcat/libwebsockets/issues/89#issuecomment-
38375684
Signed-off-by: Andy Green <andy.green@linaro.org>
Andrew Canaday [Sun, 23 Mar 2014 05:25:07 +0000 (13:25 +0800)]
libev port
merged by andy@warmcat.com via https://github.com/gaby64/libwebsockets-libev
To use, you need to both
- cmake ---> -DLWS_USE_LIBEV=1
- info->options must have LWS_SERVER_OPTION_LIBEV set when creating the context
this is so a single library can be built for distros to support apps that use
normal polling and apps that use libev polling.
erauhut [Sun, 23 Mar 2014 04:24:40 +0000 (12:24 +0800)]
trac 58 ssl enable SNI per vhost certs
http://libwebsockets.org/trac/libwebsockets/ticket/58#no1
Andy Green [Sun, 23 Mar 2014 04:02:52 +0000 (12:02 +0800)]
ssl output handle want read write
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 23 Mar 2014 03:53:07 +0000 (11:53 +0800)]
ssl add SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER to server and client
gaby64 at githib found this option is necessary when using SSL with the
truncated send support
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 23 Mar 2014 03:41:15 +0000 (11:41 +0800)]
truncated send keep and grow truncation buffer
Also change from looking at wsi->truncated_send_malloc to see if we are in the middle of
dealing with a truncated send to looking for nonzero wsi->truncated_send_len
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 23 Mar 2014 03:21:51 +0000 (11:21 +0800)]
clean output.c a little
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 17 Mar 2014 10:40:08 +0000 (18:40 +0800)]
nonzero return from client parser is close
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 15 Mar 2014 02:39:29 +0000 (10:39 +0800)]
ssl client use OS CA root certs by default
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 15 Mar 2014 01:32:40 +0000 (09:32 +0800)]
client allow user callback to close on nonzero return
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 9 Mar 2014 03:49:21 +0000 (11:49 +0800)]
upgrade and improve storage efficiency of minilex
Until now minilex has done fine with providing a simple and fast header
decode state machine. But for HTTP2.0, new headers must be added and it
is already on the limit of table branching in 1 byte (already using +0xf8
of a max limit of 0xff).
This changes the minilex format to improve storage size without loss of
decode efficiency. It reduces the curent lws header table from 546 -> 403
bytes and upgrades the ability to increase table size by allowing jumps
to increase from the old limit of +255 states to +65535 states, which should
be enough for anything we ever want to do.
The max number of terminals is also increased from 128 to 2048.
Signed-off-by: Andy Green <andy.green@linaro.org>
Patrick Gansterer [Thu, 6 Mar 2014 10:57:50 +0000 (11:57 +0100)]
Add libwebsocket_cancel_service() to let a pending libwebsocket_service() return
Use poll() with a pipe instead of ppoll() to allow the stop polling
on all UNIX platforms.
John Clark [Sun, 2 Mar 2014 21:27:10 +0000 (16:27 -0500)]
openwrt: add cyassl options, update to LWS_ cmake syntax
Patrick Gansterer [Fri, 28 Feb 2014 15:29:28 +0000 (16:29 +0100)]
Fix installation into relative installation directory
This is required to make the other CPack generators like "ZIP" work.
Patrick Gansterer [Mon, 3 Mar 2014 11:21:20 +0000 (12:21 +0100)]
Define libwebsocket_write_http as a macro instead of inline
This solves two problems:
a) We do not need to use the keyword inline in the public header.
b) We avoid a possible warning about an unused static function.
Andy Green [Sun, 2 Mar 2014 23:21:30 +0000 (07:21 +0800)]
win32 provide empty declaration for inline
Signed-off-by: Andy Green <andy.green@linaro.org>
John Clark [Sun, 2 Mar 2014 21:27:10 +0000 (16:27 -0500)]
add cyassl options, update to LWS_ cmake syntax
John Clark [Sun, 2 Mar 2014 03:24:47 +0000 (22:24 -0500)]
Fix cyassl flags, update documentation
Patrick Gansterer [Fri, 28 Feb 2014 12:17:49 +0000 (13:17 +0100)]
Remove duplicated implementations for bzero()
Define bzero() in a central place if HAVE_BZERO is not set
Patrick Gansterer [Fri, 28 Feb 2014 11:37:52 +0000 (12:37 +0100)]
WSAGetLastError() instead of errno on Windows
Error codes set by Windows Sockets are not made available through the errno
variable. Checking them via WSAGetLastError() is the corret solution.