Commit graph

1441 commits

Author SHA1 Message Date
Andy Green
5266f66f50 win32 inet_top
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 21:31:07 +08:00
Andy Green
0651e500d4 changelog add info about cmake needing clean build dir sometimes
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 21:18:11 +08:00
Andy Green
e40aa9b920 plat change to build selection by cmake
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 21:04:03 +08:00
Andy Green
2c24ec0211 refactor out most NO_EXTENSIONS
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 19:45:42 +08:00
Andy Green
158e804cb7 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>
2014-04-02 14:25:10 +08:00
Andy Green
03cf1dde39 truncated send issue independent of LWS_NO_EXTENSIONS 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 14:20:44 +08:00
Andy Green
f9196dd85c truncated send issue independent of LWS_NO_EXTENSIONS
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 11:24:44 +08:00
Andy Green
5bc002e424 only use clean buffer for failed write if sent something
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 09:59:39 +08:00
Andy Green
4dd338590e libev protect when disabled at runtime in server.c
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 08:36:36 +08:00
Andy Green
8c2c92491e win32 clean remove leftover ifdef
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-31 22:03:09 +08:00
Andy Green
4e1462d890 fix libev build
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-31 14:42:56 +08:00
Andy Green
bfaea95f60 clean libwebsockets.c
Signed-off-by: None <None>
2014-03-31 11:01:32 +08:00
Patrick Gansterer
b13eed4dcc Cleanup header includes 2014-03-30 10:19:23 +02:00
Patrick Gansterer
ac49f1e97f Remove useless usage of ssize_t 2014-03-30 10:18:51 +02:00
Patrick Gansterer
c3e8337bbd Windows: Support LWS_POLLHUP socket event 2014-03-30 09:54:55 +02:00
Patrick Gansterer
b47f87b04b Introduce LWS_POLLIN, LWS_POLLOUT and LWS_POLLHUP 2014-03-30 09:18:05 +02:00
Andy Green
e85ddb4822 Merge branch 'tid' of https://github.com/paroga/libwebsockets 2014-03-30 09:48:59 +08:00
Patrick Gansterer
0bf8fe51bf Add missing resetting of the service_tid on Windows 2014-03-29 09:34:24 +01:00
Patrick Gansterer
73882e49fc Remove websock-w32.h 2014-03-29 08:25:58 +01:00
Patrick Gansterer
462c981e9c Move #define for random() into the test applications where needed 2014-03-29 08:05:07 +01:00
Patrick Gansterer
970e19ceaa Remove unreferenced local variable on Windows 2014-03-29 07:52:37 +01:00
Patrick Gansterer
60cbbac880 Use Sleep() instead of usleep() on Windows 2014-03-29 07:52:01 +01:00
Patrick Gansterer
fc5734c339 Remove dummy headers for Windows 2014-03-29 07:43:38 +01:00
Patrick Gansterer
8df031d336 Remove emulated_poll on Windows 2014-03-29 07:15:40 +01:00
Patrick Gansterer
0fc37b64f6 windows Use WSAWaitForMultipleEvents() instead of poll() on Windows 2014-03-29 09:54:40 +08:00
Patrick Gansterer
8c020f2363 Build fixes for WindowsCE 2014-03-29 09:54:05 +08:00
Patrick Gansterer
6ff04bb459 Remove duplicated code for setting the socket options 2014-03-28 19:48:35 +08:00
Patrick Gansterer
0447329414 Fix IPv6 on non-Linux platforms 2014-03-28 16:04:43 +08:00
Andy Green
145ecece10 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>
2014-03-28 14:00:01 +08:00
Patrick Gansterer
a616300091 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().
2014-03-28 10:56:23 +08:00
Andy Green
7844d04adc ipv6 client fix
noticed by James Devine

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-25 14:08:21 +08:00
Andy Green
055f2979ec ipv6 integration fixes
Disable for build using -DLWS_IPV6= on the cmake line
2014-03-24 23:08:38 +08:00
James Devine
3f13ea2264 add ipv6 support
(changed to support runtime disable + integration by andy@warmcat.com)
2014-03-24 16:09:25 +08:00
Andy Green
9ed754d46e fix NO_EXTENSIONS
reported by gaby64
https://github.com/warmcat/libwebsockets/issues/89#issuecomment-38375684

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 15:15:54 +08:00
Andrew Canaday
9769f4f293 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.
2014-03-23 13:25:07 +08:00
erauhut
03203aba93 trac 58 ssl enable SNI per vhost certs
http://libwebsockets.org/trac/libwebsockets/ticket/58#no1
2014-03-23 12:24:40 +08:00
Andy Green
28b12ad0af ssl output handle want read write
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 12:02:52 +08:00
Andy Green
35c80f9885 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>
2014-03-23 11:53:07 +08:00
Andy Green
e254d9589d 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>
2014-03-23 11:41:15 +08:00
Andy Green
27e770b0ef clean output.c a little
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 11:21:51 +08:00
Andy Green
564056d27c nonzero return from client parser is close
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-17 18:40:08 +08:00
Andy Green
d2ec7adbab ssl client use OS CA root certs by default
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-15 10:39:29 +08:00
Andy Green
5ac7e7ad5a client allow user callback to close on nonzero return
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-15 09:32:40 +08:00
Andy Green
bbc5c07054 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>
2014-03-09 11:49:21 +08:00
Patrick Gansterer
1ee57f6fe8 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.
2014-03-08 09:31:49 +08:00
John Clark
25f8b9e230 openwrt: add cyassl options, update to LWS_ cmake syntax 2014-03-07 08:29:07 +08:00
Patrick Gansterer
e04ec35a43 Fix installation into relative installation directory
This is required to make the other CPack generators like "ZIP" work.
2014-03-03 20:09:55 +08:00
Patrick Gansterer
cb6ee152d2 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.
2014-03-03 19:50:42 +08:00
Andy Green
ae1a8be61a win32 provide empty declaration for inline
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-03 07:21:30 +08:00
John Clark
71a8870fa2 add cyassl options, update to LWS_ cmake syntax 2014-03-03 07:17:52 +08:00