Commit Graph

540 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 7f4c2f9ec3 Add nghttp2_check_header_value_rfc9113
Add nghttp2_check_header_value_rfc9113 which verifies the additional
rule imposed by RFC 9113, section 8.2.1, that is a field value must
not start or end with 0x20(SPC) or 0x09(HTAB).

libnghttp2 uses this new function internally.
2022-06-24 19:44:13 +09:00
Tatsuhiro Tsujikawa 41955b3878 Allow server to override RFC 9218 stream priority
Allow server to override RFC 9218 stream priority with
nghttp2_session_change_extpri_stream_priority.
2022-06-16 19:49:53 +09:00
Tatsuhiro Tsujikawa 8c2386c221 Add a server option to fallback to RFC 7540 priorities
Add nghttp2_option_set_server_fallback_rfc7540_priorities.  If it is
set to nonzero, and server submits SETTINGS_NO_RFC7540_PRIORITIES = 1,
but it does not receive SETTINGS_NO_RFC7540_PRIORITIES from client,
server falls back to RFC 7540 priorities.  Only minimal set of
features are enabled in this fallback case.
2022-06-14 23:47:42 +09:00
Tatsuhiro Tsujikawa b0fbb93022 Add PRIORITY_UPDATE frame support
This commit adds PRIORITY_UPDATE frame support.  Applying incoming
PRIORITY_UPDATE frame to server push stream is not implemented.

Client can send PRIORITY_UPDATE frame by calling
nghttp2_submit_priority_update.

Server opts to receive PRIORITY_UPDATE frame by the call
nghttp2_option_set_builtin_recv_extension_type(option,
NGHTTP2_PRIORITY_UPDATE), and passing the option to
nghttp2_session_server_new2 or nghttp2_session_server_new3.
2022-06-13 20:04:30 +09:00
Tatsuhiro Tsujikawa c10a55588b Implement RFC 9218 extensible prioritization scheme
This commit implements RFC 9218 extensible prioritization scheme.  It
is enabled when a local endpoint submits
SETTINGS_NO_RFC7540_PRIORITIES = 1.  This commit only handles priority
signal in HTTP request header field.  Priority header field in
PUSH_PROMISE is not supported.

HTTP messaging must be enabled to take advantage of this
prioritization scheme because HTTP fields are not parsed if HTTP
messaging is disabled.
2022-06-12 16:06:04 +09:00
Tatsuhiro Tsujikawa 9812a0bc81 Add SETTINGS_NO_RFC7540_PRIORITIES
Add SETTINGS_NO_RFC7540_PRIORITIES to disable RFC7540 priorities.  If
disabled, streams are served in FIFO.
2022-06-11 16:50:07 +09:00
Tatsuhiro Tsujikawa 2f941c7fb3 Update doc 2021-09-04 17:32:57 +09:00
Tatsuhiro Tsujikawa ba483b4032 Update doc 2021-09-04 17:30:06 +09:00
Michael Kaufmann 83c063346d Stricter checks for pseudo-headers :method and :path
Check the allowed characters for ":method" (see RFC 7230, section 3.2.6) and
":path". For ":path", the space and tab characters are now forbidden, but
other special characters are still allowed for compatibility reasons.

Update genvchartbl.py so that it generates the same table as in the code.

Fixes #1611
2021-08-31 21:47:35 +02:00
Jacky_Yin 8113974b26 doc: update document for nghttp2_session_mem_recv 2021-08-09 23:54:07 +08:00
Tatsuhiro Tsujikawa 3c17299a92 Update enum references 2020-12-29 17:47:57 +09:00
Tomas Krizek 5497a1dfa7
doc: nghttp2_session_send is also affected by max concurrent streams
Further clarify the function also takes into account maximum concurrent
streams.

Closes #691
Closes #817
2020-06-19 17:22:55 +02:00
Tomas Krizek f76ac19627
doc: clarify flow control behaviour for nghttp2_session_send()
The previous wording implied that if send_callback doesn't return
NGHTTP2_ERR_WOULDBLOCK, this function would always send all
submitted requests / data. This is not the case, since flow control can
cause some data to remain queued until WINDOW_UPDATE is received.
2020-06-17 17:19:30 +02:00
James M Snell 336a98feb0
Implement max settings option 2020-05-05 11:55:32 -07:00
Tatsuhiro Tsujikawa 77f5487a58 Add nghttp2_check_authority as public API 2019-11-02 00:33:59 +09:00
Tatsuhiro Tsujikawa 0a6ce87c22 Add nghttp2_option_set_max_outbound_ack 2019-08-14 11:43:55 +09:00
Tatsuhiro Tsujikawa f6644a92af make clang-format 2018-11-09 22:29:18 +09:00
Tatsuhiro Tsujikawa 48998f7239
Merge pull request #1222 from donny-dont/fix/declspec
Use __has_declspec_attribute for shared builds
2018-11-09 22:18:06 +09:00
Tatsuhiro Tsujikawa b80dfaa8a0 Adjustment for RFC 8441 2018-09-23 11:22:30 +09:00
Tatsuhiro Tsujikawa ed7fabcbc2 Add SETTINGS_ENABLE_CONNECT_PROTOCOL 2018-09-23 10:36:30 +09:00
Don d82811303b
Use __has_declspec_attribute for shared builds 2018-09-05 10:01:50 -07:00
Tatsuhiro Tsujikawa 601fbbb4ae Update doc 2018-09-02 15:24:12 +09:00
Tatsuhiro Tsujikawa 4098512b5d Tweak nghttp2_session_set_stream_user_data
nghttp2_session_set_stream_user_data now works for a stream which is
not created yet, but the request which creates the stream is queued.
2018-08-18 17:38:58 +09:00
Tatsuhiro Tsujikawa 880f948684 Enable IndentPPDirectives 2018-06-09 16:21:30 +09:00
Piotr Sikora 2ba1389993 Fix handling of SETTINGS_MAX_CONCURRENT_STREAMS.
The maximum number of outgoing concurrent streams is initially
limited to 100 to avoid issues when the local endpoint submits
lots of requests before receiving initial SETTINGS frame from
the remote endpoint, since sending them at once to the remote
endpoint could lead to rejection of some of the requests.

This initial limit is overwritten with the value advertised in
SETTINGS_MAX_CONCURRENT_STREAMS setting by the remote endpoint,
but previously, it wasn't lifted if the remote endpoint didn't
advertise that setting (implying no limits), in which case the
limit of 100 was retained, even though it was never advertised
by the remote endpoint.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2018-05-30 20:24:00 -07:00
Tatsuhiro Tsujikawa 575bc309b9 Fix typo 2018-05-12 13:07:52 +09:00
Tatsuhiro Tsujikawa 8034221525 Implement ORIGIN frame 2018-05-12 12:35:08 +09:00
Tatsuhiro Tsujikawa 17793e99dc Add nghttp2_session_set_user_data() public API function 2018-02-22 21:02:16 +09:00
Tatsuhiro Tsujikawa 53aeb2c3d7 Fix doc 2017-11-24 22:26:29 +09:00
Tatsuhiro Tsujikawa 43a2a70ae7 Add nghttp2_error_callback2
nghttp2_error_callback2 is an extended version of the existing
nghttp2_error_callback by adding error code parameter.  This
deprecates nghttp2_error_callback.
2017-11-19 16:51:52 +09:00
Tatsuhiro Tsujikawa 0d91e9c255 Update doc 2017-08-18 22:06:43 +09:00
Anna Henningsen eb306f463e
lib: add nghttp2_rcbuf_is_static()
Add a `nghttp2_rcbuf_is_static()` method to tell whether a rcbuf
is statically allocated.

This can be useful for language bindings that wish to avoid
creating duplicate strings for these buffers; concretely, I am
planning to use this in the Node HTTP/2 module that is being
introduced.
2017-08-12 17:48:14 +02:00
Benjamin Peterson b7c95be47c fix up grammar in submit_trailer docs 2017-06-18 23:55:53 -07:00
Tatsuhiro Tsujikawa d3fcbe9a02 Merge branch 'invalid-header-field-error' 2017-05-12 21:37:20 +09:00
Tatsuhiro Tsujikawa f2c539dc70 Clarify the effect of nghttp2_option_set_no_http_messaging 2017-04-29 21:00:20 +09:00
Tatsuhiro Tsujikawa 78d7160a99 Treat incoming invalid regular header field as stream error
Previously, the incoming invalid regular header field was ignored by
default.  With this commit, they are now treated as stream error, and
the stream is reset by default.  The error code used is now
PROTOCOL_ERROR, instead of INTERNAL_ERROR.
2017-04-28 23:46:06 +09:00
Tatsuhiro Tsujikawa f3a5a0a0ec Add nghttp2_option_no_closed_streams
nghttp2_option_no_closed_streams controls whether closed streams are
retained or not.  If nonzero is passed to that function's parameter
val, a session does not retain closed streams.  It may hurt the shape
of priority tree, but can save memory.
2017-02-13 22:33:29 +09:00
Tatsuhiro Tsujikawa 5f31c09410 Mention about nghttp2_data_source_read_length_callback 2017-02-08 00:40:47 +09:00
Tatsuhiro Tsujikawa 052f3a3871 Update doc 2017-01-26 23:40:12 +09:00
Tatsuhiro Tsujikawa 0cf6848646 clang-format-3.9 2016-10-15 18:36:04 +09:00
Tatsuhiro Tsujikawa a591001e7b Update doc 2016-10-15 18:18:52 +09:00
Tatsuhiro Tsujikawa bef3d47c16 Rename functions and nghttp2_debug.h to move debug macro there 2016-10-14 22:59:05 +09:00
Anders Bakken bc3dc6b765 Add set_nghttp2_debug_callback to take advantage of DEBUGF statements in
when building DEBUGBUILD.
2016-10-13 13:24:26 -07:00
Tatsuhiro Tsujikawa 743fc4a3c3 Use the similar naming scheme for table size as 392256e542 2016-09-11 22:25:01 +09:00
Tatsuhiro Tsujikawa 392256e542 Add nghttp2_option_set_max_deflate_dynamic_table_size() API function
nghttp2_option_set_max_deflate_dynamic_table_size function sets the
maximum dynamic table size for header block deflater.  The default
value is 4KiB.
2016-09-11 22:13:59 +09:00
Tatsuhiro Tsujikawa fddb019baf Merge branch 'master' into http2-debug-state-api 2016-08-28 22:20:04 +09:00
Tatsuhiro Tsujikawa 581e0938a9 Allow NGHTTP2_ERR_PAUSE from nghttp2_data_source_read_callback 2016-08-28 21:57:10 +09:00
Tatsuhiro Tsujikawa 79b07f0ce2 Update doc 2016-08-28 00:47:38 +09:00
Tatsuhiro Tsujikawa baa0f60dc8 Add API to get current HPACK dynamic table size 2016-08-26 23:02:51 +09:00
Tatsuhiro Tsujikawa e693f75670 Add nghttp2_session_get_local_settings() API function 2016-08-21 19:33:01 +09:00