Commit Graph

37 Commits

Author SHA1 Message Date
Igor Sysoev
0ba7cfce75 Added routing based on header fields. 2019-05-30 15:33:51 +03:00
Andrey Zelenkov
22de5fcddf Style. 2019-03-11 17:31:59 +03:00
Valentin Bartenev
11cecce114 HTTP parser: relaxed checking of fields values.
Allowing characters up to 0xFF doesn't conflict with RFC 7230.
Particularly, this make it possible to pass unencoded UTF-8 data
through HTTP headers, which can be useful.
2018-07-03 15:18:16 +03:00
Igor Sysoev
606eda045b Removed '\r' and '\n' artifact macros. 2018-06-25 16:56:45 +03:00
Valentin Bartenev
41317e37da HTTP parser: saving partial method.
This is useful for log purposes.
2018-04-10 16:51:22 +03:00
Valentin Bartenev
8d697e8004 HTTP parser: saving unsupported version.
This is useful for log purposes.
2018-04-10 16:51:22 +03:00
Valentin Bartenev
b1b9c78362 HTTP parser: correct "target" for partial or invalid request line. 2018-04-10 16:51:22 +03:00
Valentin Bartenev
d15b4ca906 Style. 2018-04-05 15:49:41 +03:00
Valentin Bartenev
0665896a55 Style: capitalized letters in hexadecimal literals. 2018-04-04 18:13:05 +03:00
Valentin Bartenev
701a54c177 HTTP parser: excluding leading and trailing tabs from field values.
As required by RFC 7230.
2018-03-15 21:08:29 +03:00
Valentin Bartenev
0b628bfe48 HTTP parser: allowing tabs in field values as per RFC 7230. 2018-03-15 21:07:57 +03:00
Valentin Bartenev
3d2f85d9ca HTTP parser: restricting allowed characters in fields values.
According to RFC 7230 only printable 7-bit ASCII characters are allowed
in field values.
2018-03-15 21:07:56 +03:00
Valentin Bartenev
5a003df1fe HTTP parser: fixed parsing of field values ending with space.
This closes #82 issue on GitHub.
2018-03-15 20:52:39 +03:00
Valentin Bartenev
7fe8f72364 HTTP parser: simplified nxt_http_parse_field_value().
There's no need in loop after 4ac474b68658.

Found by Coverity (CID 259713).
2018-01-25 10:31:22 +03:00
Valentin Bartenev
477e8177b7 HTTP parser: restricting control chars in header fields values.
This also fixes an infinite loop here (found with honggfuzz).
2018-01-24 15:02:56 +03:00
Valentin Bartenev
0c38ff0e66 Checking for major HTTP version. 2018-01-15 20:50:20 +03:00
Valentin Bartenev
a073616fc3 Improved HTTP version representation. 2018-01-15 20:50:14 +03:00
Valentin Bartenev
3fb140d6d2 HTTP parser: improved error reporting. 2018-01-15 20:49:59 +03:00
Valentin Bartenev
e8aada94de HTTP parser: allowing underscore in header field names. 2018-01-09 16:50:47 +03:00
Valentin Bartenev
45d08d5145 HTTP parser: introduced nxt_http_parse_fields(). 2017-12-27 15:45:23 +03:00
Valentin Bartenev
95a9cb94d5 HTTP parser: fixed memory overflow in the collisions test.
The level hash uses the NULL value as the indicator of a free entry in a bucket.
So, inserting a NULL value breaks the hash and can lead to a bucket overflow.

In case of the collision counter, the value wasn't initialized, since it's not
needed for the purpose of checking collisions.  As a result, it might contain
any garbage from the stack and in some rare cases the value was NULL.

Now the value is initilized.
2017-12-26 17:18:57 +03:00
Valentin Bartenev
8830d73261 HTTP parser: reworked header fields handling. 2017-12-25 17:04:22 +03:00
Valentin Bartenev
67d72d46f7 HTTP parser: improved detection of corrupted request line. 2017-12-08 19:18:00 +03:00
Valentin Bartenev
20d720dfc5 HTTP parser: slightly improved readability of code.
As suggested by Igor Sysoev.
2017-12-08 19:18:00 +03:00
Max Romanov
f3107f3896 Complex target parser copied from NGINX.
nxt_app_request_header_t fields renamed:
- 'path' renamed to 'target'.
- 'path_no_query' renamed to 'path' and contains parsed value.
2017-07-05 13:31:45 +03:00
Valentin Bartenev
dfd3cc8c0e Applied nxt_pointer_to() and nxt_value_at() where possible. 2017-06-27 17:27:18 +03:00
Valentin Bartenev
accb489492 HTTP parser: reduced memory consumption of header fields list. 2017-06-20 22:32:13 +03:00
Igor Sysoev
f888a5310c Using new memory pool implementation. 2017-06-20 19:49:17 +03:00
Valentin Bartenev
db6642f374 HTTP parser: decoupled header fields processing. 2017-06-13 20:11:29 +03:00
Valentin Bartenev
f6e7c2b6a6 HTTP parser: fixed handling header fields with missing colon. 2017-06-09 21:49:51 +03:00
Valentin Bartenev
dee819daab HTTP parser: changed style of a comment.
As requested by Igor.
2017-05-31 14:35:33 +03:00
Valentin Bartenev
ed38d86abb Added missing "fall through" comments to make GCC 7 happy. 2017-05-10 19:19:14 +03:00
Valentin Bartenev
558d1f8687 HTTP parser: fixed minimum length optimization in headers hash. 2017-04-25 16:57:14 +03:00
Valentin Bartenev
5745e48264 More optimizations of HTTP parser.
SSE 4.2 code removed, since loop unrolling gives better results.
2017-03-08 00:38:52 +03:00
Valentin Bartenev
4df646a258 HTTP parser. 2017-03-01 15:29:18 +03:00
Valentin Bartenev
fde4d18e3a Removed legacy HTTP parser. 2017-03-01 15:17:55 +03:00
Igor Sysoev
16cbf3c076 Initial version. 2017-01-17 20:00:00 +03:00