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.
Patrick Gansterer [Fri, 28 Feb 2014 01:32:03 +0000 (02:32 +0100)]
Check if getenv() exists
Do not call getenv() on platform which do not support it
Patrick Gansterer [Fri, 28 Feb 2014 01:31:23 +0000 (02:31 +0100)]
Allow setting the HTTP proxy via creation info
If the user provides a proxy via the info object it is used
in favor over the http_proxy environment variable.
Andy Green [Fri, 28 Feb 2014 01:09:17 +0000 (09:09 +0800)]
fix missing include for time
Signed-off-by: Andy Green <andy.green@linaro.org>
Patrick Gansterer [Fri, 28 Feb 2014 00:31:39 +0000 (01:31 +0100)]
Enable compilation on Windows CE
Add a few ifdefs to support this additional platform.
Patrick Gansterer [Fri, 28 Feb 2014 00:29:28 +0000 (01:29 +0100)]
Correctly server non-ASCII filenames on Windows
Convert the filename from UTF-8 to UTF-16 and use CreateFileW() to open the file.
Patrick Gansterer [Thu, 27 Feb 2014 23:59:53 +0000 (00:59 +0100)]
Add dummy implementation when strerror() is missing
Use a simple empty string for platforms without an implementation.
Patrick Gansterer [Thu, 27 Feb 2014 23:57:19 +0000 (00:57 +0100)]
Cleanup include statements
Remove useless includes and add some preprocessor conditions for platform specific headers.
Patrick Gansterer [Thu, 27 Feb 2014 23:42:08 +0000 (00:42 +0100)]
Fix type checks in CMake
Use CHECK_TYPE_SIZE to check existence of types.
Patrick Gansterer [Thu, 27 Feb 2014 23:37:20 +0000 (00:37 +0100)]
Add explicit cast to setsockopt() calls
Implicit cast from size_t* to const char* throws an error on some compilers.
Patrick Gansterer [Thu, 27 Feb 2014 10:42:41 +0000 (11:42 +0100)]
Fix Content-Type header of http status response
The header for setting the mime type is called ‘Content-Type’ and not ‘Mime-Type’.
Patrick Gansterer [Thu, 27 Feb 2014 02:21:50 +0000 (03:21 +0100)]
Use native file functions on Windows
Add a special implementation with CreateFile(), ReadFile() and CloseFile()
for serving HTTP file request to allow compilation on all Windows platforms.
Patrick Gansterer [Wed, 26 Feb 2014 20:56:59 +0000 (21:56 +0100)]
Rename leave to cleanup
The name ‘leave’ can not be used on some Windows CE platforms, so rename it.
Patrick Gansterer [Wed, 26 Feb 2014 20:37:31 +0000 (21:37 +0100)]
Avoid calls to gettimeofday()
Add a new function to get the current time in microseconds, since gettimeofday() does not exist on Windows.
Keep the current implementation for the test applications.
Patrick Gansterer [Wed, 26 Feb 2014 18:52:11 +0000 (19:52 +0100)]
Replace perror() with lwsl_warn()
Use the general logging function for printing error messages.
Patrick Gansterer [Wed, 26 Feb 2014 18:21:40 +0000 (19:21 +0100)]
Fix endian detection on non-linux systems
f975f736408f32e7384cf38270a7806e68d5e112 introduced inclusion of endian.h,
which is not a standard header. Only include it on Linux machines and
add similar includes for Apple and FreeBSD.
Patrick Gansterer [Wed, 26 Feb 2014 17:51:05 +0000 (18:51 +0100)]
Add missing LWS_VISIBLE to libwebsocket_set_timeout()
This aligns it with the style of all other function declarations.
Andy Green [Wed, 26 Feb 2014 23:28:45 +0000 (07:28 +0800)]
unconfuse quoting in CMakeLists.txtt
via Marjan Tomas https://github.com/warmcat/libwebsockets/issues/67
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 26 Feb 2014 23:19:21 +0000 (07:19 +0800)]
revert wrong fix visibility of return_http_status
Signed-off-by: Andy Green <andy.green@linaro.org>
Joakim Soderberg [Mon, 24 Feb 2014 17:23:00 +0000 (18:23 +0100)]
Fix windows compilation.
Gabriel Gritsch [Sat, 22 Feb 2014 10:00:28 +0000 (18:00 +0800)]
use SO_REUSEADDR on windows since supposedly ok now
Andy Green [Fri, 21 Feb 2014 10:51:38 +0000 (18:51 +0800)]
fix visibility of return_http_status
From "DevYourWorld" on github
https://github.com/warmcat/libwebsockets/issues/64#issuecomment-
35720037
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 21 Feb 2014 10:48:05 +0000 (18:48 +0800)]
fix WITHOUT_CLIENT install in CMake
Via "DevYourWorld" on github
https://github.com/warmcat/libwebsockets/issues/64#issuecomment-
35719084
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 21 Feb 2014 10:45:45 +0000 (18:45 +0800)]
update cmake opts in README.build
via "DevYourWorld" on github
https://github.com/warmcat/libwebsockets/issues/64
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 21 Feb 2014 10:43:42 +0000 (18:43 +0800)]
interface_to_sa no longer server only
Via "DevYourWorld" on github
https://github.com/warmcat/libwebsockets/issues/64
Signed-off-by: Andy Green <andy.green@linaro.org>
Craig McQueen [Wed, 19 Feb 2014 23:27:11 +0000 (10:27 +1100)]
Call libwebsocket_set_timeout() before callback LWS_CALLBACK_HTTP.
This allows the LWS_CALLBACK_HTTP callback to override the timeout
with libwebsocket_set_timeout() if it wants.
Mattias Lundberg [Tue, 18 Feb 2014 09:06:57 +0000 (10:06 +0100)]
Add support to binding client to interface.
Joakim Soderberg [Tue, 18 Feb 2014 12:38:14 +0000 (13:38 +0100)]
Fix compilation on Windows.
C89 which Microsofts compiler only support does not allow variable
declarations anywhere but at the start of a scope.
Also, only try to copy the test-server files if they actually exists. For
instance the OpenSSL cert generation fails if you run cmake under the git
bash shell on Windows (won't work with the unix method either) so that
file will be missing... This would result in a compilation error when
tests where turned on.
Craig McQueen [Tue, 18 Feb 2014 22:24:17 +0000 (09:24 +1100)]
Add LWS_VISIBLE to libwebsocket_set_timeout() so it can be used externally.
Andy Green [Sat, 15 Feb 2014 17:52:50 +0000 (01:52 +0800)]
add missing CMake pieces
Signed-off-by: Andy Green <andy.green@linaro.org>
Michael Haberler [Sat, 15 Feb 2014 12:33:46 +0000 (20:33 +0800)]
document new extpoll apis
Michael Haberler [Sat, 15 Feb 2014 12:21:02 +0000 (20:21 +0800)]
update test server for new extpoll
Michael Haberler [Sat, 15 Feb 2014 12:19:26 +0000 (20:19 +0800)]
change extpoll in lib to new way
Michael Haberler [Sat, 15 Feb 2014 12:18:24 +0000 (20:18 +0800)]
replace old extpoll callbacks with LWS_CALLBACK_CHANGE_MODE_POLL_FD
Michael Haberler [Sat, 15 Feb 2014 12:15:55 +0000 (20:15 +0800)]
define struct libwebsocket_pollargs
Andy Green [Sat, 15 Feb 2014 11:25:50 +0000 (19:25 +0800)]
add outermost wsi lifetime callbacks
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 15 Feb 2014 08:49:41 +0000 (16:49 +0800)]
LWS_CALLBACK_USER
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 15 Feb 2014 08:36:38 +0000 (16:36 +0800)]
libwebsocket_callback_all_protocol
Signed-off-by: Andy Green <andy.green@linaro.org>
Gabriel Gritsch [Sat, 15 Feb 2014 08:20:25 +0000 (16:20 +0800)]
add const http write helper
Since libwebsocket_write doesn't change the source buffer in HTTP protocol,
we can have a little helper to hide the harmless cast
Andy Green [Sat, 15 Feb 2014 08:00:37 +0000 (16:00 +0800)]
fix zero length ping pong
Signed-off-by: Andy Green <andy.green@linaro.org>
Daniel Ludwig [Thu, 13 Feb 2014 23:17:46 +0000 (00:17 +0100)]
missing endian preprocessor defines on Linux environments
Andy Green [Sat, 15 Feb 2014 06:45:14 +0000 (14:45 +0800)]
update version in libwebsockets.pc
Signed-off-by: Andy Green <andy.green@linaro.org>
arnaudviala [Sat, 15 Feb 2014 06:39:40 +0000 (14:39 +0800)]
fix memory leak
Fix a possible memory leak in
libwebsocket_context_destroy() when compiled without extension support.
Andy Green [Sat, 15 Feb 2014 06:36:02 +0000 (14:36 +0800)]
add timeout between accept and negotiation
Signed-off-by: Andy Green <andy.green@linaro.org>
Alexandre Erwin Ittner [Fri, 7 Feb 2014 01:15:51 +0000 (23:15 -0200)]
Fix documentation for LWS_CALLBACK_FILTER_NETWORK_CONNECTION
At the time callback LWS_CALLBACK_FILTER_NETWORK_CONNECTION is called,
there is no client connection information yet, so the parameter wsi
still pointing to the main server connection. Add an description of
this behavior to the documentation.
Jakob Flierl [Mon, 27 Jan 2014 11:37:47 +0000 (12:37 +0100)]
make force_exit volatile.
Instruct the compiler to always access force_exit in memory.
Joakim Soderberg [Sat, 15 Feb 2014 05:48:56 +0000 (13:48 +0800)]
cmake and other fixes
martell [Wed, 22 Jan 2014 19:01:14 +0000 (19:01 +0000)]
Removed needless VS projects now that cmake is fixed
martell [Sat, 15 Feb 2014 05:37:08 +0000 (13:37 +0800)]
additional mingw fixes
Signed-off-by: martell <martellmalone@gmail.com>
martell [Wed, 22 Jan 2014 18:17:03 +0000 (18:17 +0000)]
fixed windows build
Andy Green [Sat, 15 Feb 2014 04:46:33 +0000 (12:46 +0800)]
trac 53 mingw ssize_t redef
Signed-off-by: Andy Green <andy.green@linaro.org>
John Clark [Sun, 9 Feb 2014 23:24:29 +0000 (07:24 +0800)]
fix LWS_NO_SERVER compile
Signed-off-by: John Clark <inidev@gmail.com>
Michael Haberler [Fri, 10 Jan 2014 22:40:14 +0000 (23:40 +0100)]
Subject: [PATCH] libwebsockets.h: use _GNU_SOURCE instead of __USE_GNU
this collides with use of features.h which says '#define __USE_GNU 1'
see also second answer:
http://stackoverflow.com/questions/7296963/gnu-source-and-use-gnu?answertab=active#tab-top
nononame [Sat, 11 Jan 2014 05:12:34 +0000 (13:12 +0800)]
fix lws_lookup off by one
Signed-off-by: nononame <nononame@le-huit.fr>
Andy Green [Sat, 11 Jan 2014 04:37:07 +0000 (12:37 +0800)]
ppoll fix signal mask sense
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 25 Dec 2013 08:34:37 +0000 (16:34 +0800)]
Use ppoll to allow signals to wake service loop early on change of pollfd event
To enable this code you need to force LWS_HAS_PPOLL to de defined.
#defining it at the top of libwebsockets.c is enough.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 21 Dec 2013 03:18:34 +0000 (11:18 +0800)]
unify all pollfd lock management
This provides a single place for pollfd event changing,
external locking for that and extpoll management.
It saves about 85 lines of duplication and simplifies the callers.
Signed-off-by: Andy Green <andy.green@linaro.org>
tmu [Sat, 21 Dec 2013 02:33:33 +0000 (10:33 +0800)]
openwrt add build makefile
http://libwebsockets.org/trac/libwebsockets/ticket/50
Signed-off-by: tmu <tmu-INVALID@invalid.com>
Nikolay Dimitrov [Sat, 21 Dec 2013 02:22:17 +0000 (10:22 +0800)]
fix dropmask dereference even when NULL
Signed-off-by: Nikolay Dimitrov <ndimitrov@setelis.com>