Andy Green
43db045ff8
introduce logging api and convert all library output to use it
...
- multiple debug context calls lwsl_ err, warn, debug, parser, ext, client
- api added to set which contexts output to stderr using a bitfield log_level
- --disable-debug on configure removes all code that is not err or warn severity
- err and warn contexts always output to stderr unless disabled by log_level
- err and warn enabled by default in log_level
Signed-off-by: Andy Green <andy@warmcat.com>
2013-01-10 22:16:37 +08:00
Aaron Zinman
4550f1d7b5
compile in xcode, privatize debug macro
2013-01-10 22:14:52 +08:00
Andy Green
6cd1ea9b00
update soname and configure to v1.0
...
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-10 12:45:54 +08:00
Andy Green
988bd987af
zlib code add OOM checks remove buffer expansion on rx path
...
Here testing with the test serer and chrome 25, the buffer expansion
code on Rx was triggered by a valid no data output condition and looped
until it exhausted all memory.
This patch adds OOM check to all malloc()s and removes the buffer expansion
code on the rx path... leaving the code on tx path for now.
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-10 12:45:54 +08:00
David Galeano
ed3c840ed6
Avoid leaking a socket when SSL_accept fails.
2013-01-10 12:45:54 +08:00
David Galeano
7c8d98924b
Print error string on accept failure.
2013-01-10 12:45:54 +08:00
David Galeano
6b66791b46
Increased MAX_BROADCAST_PAYLOAD to match MAX_USER_RX_BUFFER.
2013-01-10 12:45:54 +08:00
David Galeano
96aa7e6a99
Added support for continuation frames on the server.
2013-01-10 12:45:54 +08:00
David Galeano
651544312c
Close connection if LWS_CALLBACK_HTTP returns non-zero.
2013-01-10 12:45:54 +08:00
David Galeano
7ffbe1bfca
Fixed to keep reading data until the SSL internal buffer is empty.
...
Before this fix only 2048 bytes were read,
the rest were buffered inside SSL until another message arrived!!!
2013-01-10 12:45:54 +08:00
David Galeano
4fbc40c07d
Added no-cache headers to client handshake:
...
http://www.ietf.org/mail-archive/web/hybi/current/msg09841.html
2013-01-10 12:45:54 +08:00
David Galeano
ed3bc90174
Separate compression levels for server and client,
...
increased the later one to zlib default (6).
2013-01-10 12:45:54 +08:00
David Galeano
1ed189e421
More correct handling of inflate result.
2013-01-10 12:45:54 +08:00
David Galeano
e0d0fd72b3
Fixed crash when HTTP requests method is not GET.
2013-01-10 12:45:54 +08:00
David Galeano
cc148e4029
Check if macro SSL_OP_NO_COMPRESSION is defined before trying to use it.
2013-01-10 12:45:53 +08:00
David Galeano
1aad881819
Using size_t instead of int for deflate-frame offsets and length.
2013-01-10 12:45:53 +08:00
David Galeano
f177f2a15e
Added private macro CIPHERS_LIST_STRING to define ciphers list string.
2013-01-10 12:45:53 +08:00
David Galeano
77a677c2bd
When choosing a cipher, use the server's preferences.
2013-01-10 12:45:53 +08:00
David Galeano
584b316700
Pass URI length to LWS_CALLBACK_HTTP.
2013-01-10 12:45:53 +08:00
David Galeano
c72f6f9fa0
Disable compression for SSL socket,
...
it is a waste of CPU when using compression extensions.
2013-01-10 12:45:53 +08:00
David Galeano
9b3d4b2152
Using "SSL_CTX_use_certificate_chain_file" instead of "SSL_CTX_use_certificate_file"
...
to support server certificates signed by intermediaries.
2013-01-10 12:45:53 +08:00
David Galeano
0d586c4930
Better definition of "debug" macro for Win32 builds.
2013-01-10 10:08:50 +08:00
David Galeano
7dd9bc57a5
Use __inline for Win32 builds.
2013-01-10 10:07:16 +08:00
David Galeano
a1b39732d7
Avoid checking choked pipe if no extension has more data to write.
2013-01-10 10:06:38 +08:00
David Galeano
369730921e
Set listen backlog to SOMAXCONN.
2013-01-10 09:58:24 +08:00
David Galeano
b88e096e19
Fixed operator precedence bug.
2013-01-10 09:54:10 +08:00
David Galeano
01d0256b42
Avoid deflate of small packets.
2013-01-10 09:51:15 +08:00
David Galeano
2605ffe277
Support compressed packets bigger than MAX_USER_RX_BUFFER.
...
(AG adapted style and removed logging stuff)
2013-01-10 09:41:06 +08:00
David Galeano
4c38f14527
Allow extensions when no protocol was specified.
2013-01-09 19:49:50 +08:00
David Galeano
85a092135e
Added extension "deflate-frame".
...
Using by default instead of "deflate-stream".
2013-01-09 18:21:33 +08:00
David Galeano
e2cf992571
Added support for extensions that only manipulate application data.
2013-01-09 18:17:42 +08:00
David Galeano
d58c6ab78d
Fixed deflate-stream extension.
...
When the output buffer was exhausted the input buffer was discarded
without checking if zlib had actually consumed all the input,
now we copy the remaining input data for the next call.
2013-01-09 18:17:42 +08:00
David Galeano
c9f1ff843f
Added private macro AWAITING_TIMEOUT instead of harcoded value 5.
2013-01-09 18:17:42 +08:00
David Galeano
dae2dcb09e
Fixed spacing.
2013-01-09 18:17:42 +08:00
David Galeano
2f82be89d5
Added context creation parameter for CA certificates file.
2013-01-09 16:25:54 +08:00
David Galeano
36750b84fd
Return NULL if the handshake failed to complete,
...
libwebsocket_service_fd closes and frees the websocket in that case.
2013-01-09 16:17:04 +08:00
David Galeano
a3a97d1acc
Ignoring linux build files
2013-01-09 15:46:11 +08:00
David Galeano
aa0bc86143
Changed client handshake to use "Origin" instead of "Sec-WebSocket-Origin" as defined by RFC 6455 when using version 13 of the protocol.
2013-01-09 15:31:46 +08:00
David Galeano
cb19368e14
Fixed compiler warnings on Windows.
2013-01-09 15:29:00 +08:00
David Galeano
2915a80a5f
Added new status codes from RFC 6455.
2013-01-09 15:26:08 +08:00
David Galeano
aeb574870e
Fixed compiler warning on Windows.
2013-01-09 15:25:05 +08:00
David Galeano
d3ce131a78
Static variable is now const.
2013-01-09 15:14:31 +08:00
Andy Green
788c4a8fa8
add context construction option to skip server hostname lookup
...
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-10-22 12:29:57 +01:00
Andy Green
15e31f373d
add missing docs for new context user pointer
...
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-10-19 18:36:28 +08:00
Alon Levy
dc93b7f2e7
libwebsocket_service_fd: EAGAIN is harmless, treat like EINTR
...
Only tested on linux.
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-10-19 18:27:40 +08:00
Alon Levy
0291eb3b95
libwebsocket_context: add userspace pointer for use before wsi creation
...
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-10-19 18:27:19 +08:00
Alon Levy
e1be13d8b5
lib/Makefile.am: whitespace fix
...
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-10-19 18:27:01 +08:00
Anders Brander
4e6fe90030
Add missing .h files to sources.
2012-10-17 20:10:54 +08:00
Andy Green
5e8967a54e
always taking an interest in ppid wont hurt
...
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-10-17 20:10:44 +08:00
Andy Green
fa3f405d1d
stop being so fragile on socket lifecycle
...
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-10-07 20:40:35 +08:00