Commit graph

135 commits

Author SHA1 Message Date
Andrejs Hanins
140ac6e9cb Subject: [PATCH] Fix for close ack sending
It was forgotten in two places that pending close ack should be
processed when wsi state is WSI_STATE_RETURNED_CLOSE_ALREADY, but
not WSI_STATE_ESTABLISHED. As a result, close ack wasn't sent out
to the peer.
2015-11-07 07:04:46 +08:00
Andy Green
2488c46c9b attempt to get correct close flow banning writeable cb when closing
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-16 11:07:52 +08:00
Andy Green
940a75503c avoid changing wrong revents if connection closed
As reported by Bruce Perens

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-May/001814.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 08:34:21 +08:00
=?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?=
4c0ba02771 fix #309. Receive large messages over WSS
Read the full incoming TLS/SSL record at once in libwebsocket_service_fd().

SSL_read() is called until no more pending data for the current record is buffered in SSL.
SSL_read() is never requested more than the pending data size for the current record
to ensure that the fd is not read again for new data, which would be copied in the SSL buffer otherwise.
2015-10-12 08:07:38 +08:00
Andy Green
4bca6cd367 close also enable pollout processing for post send close state
This should solve the 100% cpu at close problem reported by Bruce Perens

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-26 06:09:13 +08:00
Andy Green
82eccf7611 close send close ack control packet type
Noticed by Andrey Pokrovskiy

Close processing reused ping processing to save and send the payload,
and sets a flag to know it's close, but forgot to change the control
packet accordingly.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-26 05:32:03 +08:00
Andy Green
40d5abc2aa close reply must use writable control reply path
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-17 20:29:58 +08:00
Andy Green
408f537975 timeout counts as pernmanently unusable close
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-12 08:17:26 +08:00
Andy Green
2fd6e6fb55 ping allow zero length PING
Part of

https://github.com/warmcat/libwebsockets/issues/256

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-03-24 21:07:01 +08:00
Bud Davis
229bfec948 win32 use hashtable for fd management
At least some win32 uses an opaque pointer for fd that is not
an ordinal like it is in unix.

Resurrect the old hashtable management for that platform to use
instead, and introduce a helper to get the wsi from the fd "somehow".

Signed-off-by: Bud Davis <bdavis9659@gmail.com>
2015-01-30 10:48:57 +08:00
Andy Green
66ecc2538d NO_EXTENSION clean out handled var in handle_POLLOUT_event
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-10 10:28:46 +08:00
Andy Green
a349367a0b NO_SERVER_fix cosmetic warning
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-10 10:24:33 +08:00
Alejandro Mery
ac3ec39bb1 Subject: [PATCH] Introduce lws_free2() helper to free and re-NULL pointers
Signed-off-by: Alejandro Mery <amery@geeks.cl>
2014-12-05 07:27:52 +08:00
Alejandro Mery
6ff28248aa Subject: [PATCH] Use custom allocator
Signed-off-by: Alejandro Mery <amery@geeks.cl>
2014-12-05 07:26:26 +08:00
Andy Green
8ab2b5af8b coverity 83664 consistently check NULL
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:10:26 +08:00
Andy Green
c5814fbaa9 coverity 83667 dead code
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:51:47 +08:00
Andy Green
2c8161c9eb coverity 83681 unused assignment
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:29:04 +08:00
Andy Green
7df53c5550 http2 alpn npn pollout
This adds npn / alpn support if your openssl can handle it.
Then, browsers that understand alpn will by default
negotiate http/1.1 and work as normal.

Clients that understand http2.0 can negotiate h2-14 and
use the basic but working http2.0 support automatically

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-22 15:38:12 +08:00
Andy Green
609ec85869 ssl optimize poll when buffered ssl read data
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-09 08:29:22 +08:00
Andy Green
1f5c9f0c31 ssl_capable_read add context param
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-09 08:14:30 +08:00
Andy Green
fe3e3e61ec ssl fix pending reads stuck in ssl layer
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:15:29 +08:00
Andy Green
095d303b49 http2 fix build when http2 disabled
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:15:29 +08:00
Andy Green
024eb6c80c http2 can keep upgraded connection up
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:00:53 +08:00
Andy Green
a54f232f07 http2 add h2c upgrade and http2 connmode
Connection upgrade handling for h2c
Establish http2 union struct and http2 connmode
No protocol code yet

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 09:43:14 +08:00
Andy Green
82bac6baec defer PONG send until no partial send buffer
Reported-by: Andrew Canaday
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-24 14:39:19 +08:00
AndyMcG
7ab4edebe3 Trac 75: fix uxexpected ssl connection close 2014-07-06 09:36:44 +08:00
Andy Green
a717df2739 refactor libev eliminate all code ifdefs
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-11 13:14:37 +08:00
Andy Green
f4ffc1e215 fixes for close flush
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 17:06:59 +08:00
Andy Green
a1a24d26a6 close should flush any truncated send before really closing
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 14:25:24 +08:00
Andy Green
fe660b5c4b inform timeout source when TIMEDOUT_WAITING
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 11:03:22 +08:00
Andy Green
8e18fe3a94 fix accept nonzero as close from WRITEABLE callback
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-06 12:40:16 +01:00
Andy Green
78f266a525 refactor use unified ssl read write functions
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-06 07:24:45 +01:00
Andy Green
b49a995a8d clean small additional ifdef reduction
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-03 10:11:04 +08:00
Andy Green
d99476b2b3 refactor move flow control to server.c
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-03 08:40:05 +08:00
Andy Green
d474135424 refactor service related functions into service.c
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-03 07:43:40 +08:00