Commit graph

11 commits

Author SHA1 Message Date
Andy Green
917f43ab82 http2 able to send test.html to nghttp2
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-12 14:31:47 +08:00
Andy Green
ecc2e72ca1 http2 add hpack decode support
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-10 06:15:02 +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
Andrew Canaday
da55fb5208 Added HTTP OPTIONS support:
- added options to minilex.c
     - regenerated lextable.h
     - added WSI_TOKEN_OPTIONS_URI to libwebsockets.h
     - tweaked parsers.c to accommodate OPTIONS token
     - tweaked server.c to set uri_ptr and uri_len for HTTP callback on OPTIONS as well
2014-07-06 09:36:43 +08:00
Andrew Canaday
f3b6f25e6a Added comma after if-none-match... 2014-06-30 05:54:16 -04:00
Andrew Canaday
4220327520 Added new HTTP headers and WSI tokens:
- "access-control-request-headers:" <-- WSI_TOKEN_HTTP_AC_REQUEST_HEADERS
 - "if-none-match:" <-- WSI_TOKEN_HTTP_IF_NONE_MATCH
2014-06-28 20:19:57 -04: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
kapejod
ce64fb0f58 Support for HTTP POST.
Rewritten by Andy Green to use chunks, add timeout, use extra states in handshake not parser.

Signed-off-by: Andy Green <andy@warmcat.com>
2013-11-24 10:36:37 +08:00
Andy Green
909a3720c7 case insensitive http headers
Svetlin wrote on github

According to RFC2616, all header field names in both HTTP requests and HTTP responses are case-insensitive. But libwebsockets uses a case-sensitive compare.

Reproduce:
Run libwebsockets against a server that sends all of its HTTP header field names in lower-case (for example: https://github.com/extend/cowboy). libwebsockets reports an error. The expected behavior is no errors reported and a successful handshake procedure.


This changes the parser reference table in minilex to all lower case.

The code to walk the parser tables then just forces a tolower on the incoming chars.

This (and minilex tables) only applies to header names.

Reported-by: svetlin-mladnov <?@github>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-13 08:03:05 +08:00
Andy Green
cc13c6f187 improve minilex use external parsing header
Clean up minilex
Move the header output to stdout
Introduce lexfile.h as the header output
Use lexfile.h in both minilex itself and lws
Add the following header support

       "Accept:",
       "If-Modified-Since:",
       "Accept-Encoding:",
       "Accept-Language:",
       "Pragma:",
       "Cache-Control:",
       "Authorization:",
       "Cookie:",
       "Content-Type:",
       "Date:",
       "Range:",
       "Referer:"

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-09 10:09:09 +08:00
Andy Green
6d1fcb7a95 add lexical parser for headers
Profiling what happens during the ab test, one of the hotspots
was strcasecmp in a loop looking for header name matches each time.

This patch introduces a lexical parser that creates a state machine
in 276 bytes that encodes all the known header names.  The fsm is
walked bytewise as chaacters come in... most states do not need any
recursion to match or fail.

The state machine output is cut-and-pasted into parsers.c as an
unsigned char array.

The fsm generator is a bit rough and ready, included in the tree but
not built since normal mortals won't need to touch it.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-18 01:55:48 +08:00