Commit graph

1351 commits

Author SHA1 Message Date
Andy Green
cade614d16 base64 add back decoder now we need it.patc
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 16:35:16 +08:00
Andy Green
b08cb50e24 parser default to name parsing if unknown
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 16:33:56 +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
1ee42a5f05 add http2 settings token
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:27:29 +08:00
Andy Green
9887bdb438 test server correct header naming order
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:23:06 +08:00
Andy Green
2af585660d confirm upgrade actually for websocket
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:15:49 +08:00
Andy Green
104316eb8f internal SHA1 users all use libwebsockets_SHA1
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-26 05:56:23 +08:00
Dnyanesh Gate
759e50cdc8 android fix syslog path 2014-09-26 05:39:05 +08:00
Duncan Tebbs
54d037e177 Pass user_sapce to callback for LWS_CALLBACK_CLIENT_CONNECTION_ERROR 2014-09-26 05:36:37 +08:00
Hiroaki Sakon
c00675cafb fix required CMake version
AG also updated the machine-readable min cmake version
2014-09-23 02:35:05 +08:00
emironov
a49d084429 fix byte order for qnx 2014-09-16 22:49:10 +08:00
Stefan Schuermans
b944cc1248 also callback closed if flushing 2014-09-08 14:01:58 +08:00
Andy Green
8721f4f5f1 fix build for NO_SERVER
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-27 16:31:20 +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
Andrew Canaday
af8db35010 server.c: test **truncated_send_len** for partial
Testing against truncated_send_malloc won't work if we've already
buffered and completed a partial buffer, as truncated_send_malloc
isn't free'd until the socket is destroyed.
2014-08-24 10:03:37 +08:00
Andy Green
f012f751aa accept fail char means we are done
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-22 19:38:17 +08:00
Andy Green
727d98d9b1 fix bad cmake args example in README.build
As told here
https://github.com/warmcat/libwebsockets/issues/166

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-19 19:21:32 +08:00
Andy Green
4b812fe4aa cleanup style in parser
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-19 18:34:31 +08:00
Andy Green
fc9871ec24 fix build without ssl support
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-19 08:41:26 +08:00
Andy Green
9ffe40112b soname 5.0.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 23:21:28 +08:00
Andy Green
14425eae4e introduce lws_partial_buffered
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 22:49:39 +08:00
Andy Green
822241c2a7 deprecate no_buffer_all_partials
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 22:21:51 +08:00
Carl Stehle
66d466a1a4 http keepalive needs to reinit some header union state
AG moved the code to the keepalive loop location
2014-08-16 10:17:59 +08:00
Andy Green
b128ccccca add lws_is_ssl api
Suggested by Michael Harbler on the mailing list

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-16 09:54:27 +08:00
Karl Palsson
95a8abb030 cyassl: correct include path for 3.1.x 2014-08-15 01:54:59 +08:00
Michael Haberler
a2d3bf1e4d api: add feature test macro LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD 2014-08-11 20:49:16 +08:00
Andy Green
eabed8defe protocol struct add user controlled id member
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-11 12:11:36 +08:00
Andy Green
afa10d5a89 fix spinning on NULL protocol name
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-11 09:11:57 +08:00
Andy Green
62824f96d4 ssl fix excessive crash workaround
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-10 09:50:42 +08:00
Andy Green
a40760a2de no protocol usage inprove docs
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-07 16:52:15 +08:00
Andrew Canaday
e917345e05 Reset hdr_parsing_completed for WSI_STATE_HTTP:
This fixes a bug where a client issues two GET requests on the same connection
(keep-alive). If the second request is split into two reads, the
hdr_parsing_complete flag gets us into trouble by ending the request read two
early and giving us bogus data.
2014-08-07 12:13:28 +08:00
Andy Green
67f94599d2 trac82 consistently use CONTEXT_PORT_NO_LISTEN
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-31 09:44:00 +08:00
Oleh
faeac3c419 ssl allow passing cert passphrase
https://github.com/warmcat/libwebsockets/issues/152
2014-07-29 23:18:41 +08:00
Andy Green
c949bb3b49 avoid crash if we dont have new wsi
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-29 23:02:07 +08:00
Aurelian Pop
d07ea3bf40 Fix TCP keepalive use in UNIX systems 2014-07-29 15:36:06 +03:00
Andrew Canaday
78228ed5cb Keep-alive: disable timeout and let TCP ka kill.
This is required for streaming HTTP connections.
Not sure if there's a more graceful way to handle this
(maybe resetting the timeout in the 'send'-side code?
2014-07-19 07:01:10 +08:00
Andrew Canaday
c7dbad66ab Make sure headers are parsed before proceeding. 2014-07-19 07:00:52 +08:00
Andrew Canaday
991f1cded8 Only check for '?' URI args during URI path parse 2014-07-19 06:58:53 +08:00
Andy Green
7a8d86e048 handle client protocol lists properly
We fail to deal with lists of protocols sent by the client
by picking one from the list properly.  This fixes that and
adds protocol lists to the test client for regression testing.

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-19 06:52:39 +08:00
Andrew Canaday
3bb0650e6a Don't need 'content_remain' in libwebsocket_read 2014-07-14 20:33:07 +08:00
Andrew Canaday
afe26cf4a6 HTTP Version, Keep-alive support, No-copy POST
This is a squashed commit from https://github.com/andrew-canaday/libwebsockets,
dev/http_keepalive branch (strategies changed a few times, so the commit
history is clutteread). This branch is submitted for clarity, but the other
can be used as a reference or alternative.

 * added **enum http_version** to track HTTP/1.0 vs HTTP/1.1 requests
 * added **enum http_connection_type** to track keep-alive vs close
 * replaced content_length_seen and body_index with **content_remain**
 * removed **post_buffer** (see handshake.c modifications)

 * removed post_buffer free

 * switch state to WSI_TOKEN_SKIPPING after URI is complete to store version
 * delete *spill* label (unused)

 * add vars to track HTTP version and connection type
 * HTTP version defaults to 1.0
 * connection type defaults to 'close' for 1.0, keep-alive for 1.1
 * additional checks in **cleanup:** label:
   * if HTTP version string is present and valid, set enum val appropriately
   * override connection default with the "Connection:" header, if present
 * set state to WSI_STATE_HTTP_BODY if content_length > 0
 * return 0 on HTTP requests, unless LWS_CALLBACK_HTTP indicates otherwise

 * add vars to track remaining content_length and body chunk size
 * re-arrange switch case order to facilitate creation of jump-table
 * added new labels:
   * **read_ok**: normal location reach on break from switch; just return 0
   * **http_complete**: check for keep-alive + init state, mode, hdr table
   * **http_new**: jump location for keep-alive when http_complete sees len>0
 * after libwebsocket_parse, jump to one of those labels based on state
 * POST body handling:
   * don't bother iterating over input byte-by-byte or using memcpy
   * just pass the relevant portion of the context->service_buffer to callback
2014-07-14 20:19:43 +08:00
Andrew Canaday
7c67634fec libwebsockets_read: update 'len' after lws_handshake_server invocation 2014-07-08 06:15:25 +08:00
Andy Green
c1fdd10ff8 update changelog for 1.3
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:56:11 +08:00
Andy Green
6aa4f65620 test server dumb increment fix once per second duplicate
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:36:44 +08:00
AndyMcG
7ab4edebe3 Trac 75: fix uxexpected ssl connection close 2014-07-06 09:36:44 +08:00
Andy Green
f55b2eff0a add runtime context flag to enforce defeat of OS CA CERTS even if build option selected
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:36:44 +08:00
Cong Ma
10da117b84 fix confusion ull in latency reporting 2014-07-06 09:36:44 +08:00
kolis
981fb47f9b partial send handling 2014-07-06 09:36:44 +08:00
Andy Green
97850857b3 dont free externally allocated user_space when closing connection
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:36:43 +08:00
geq
d6827f7741 fix build on OpenBSD 2014-07-06 09:36:43 +08:00