adding an accessor for setting enable connect.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
This commit is contained in:
Alyssa Wilk 2018-09-26 10:44:34 -04:00
parent a42faf1cc2
commit 5ef5e6a381
4 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,7 @@ set(APIDOCS
nghttp2_option_set_no_auto_ping_ack.rst
nghttp2_option_set_no_auto_window_update.rst
nghttp2_option_set_no_http_messaging.rst
nghttp2_option_set_enable_connect_protocol.rst
nghttp2_option_set_no_recv_client_magic.rst
nghttp2_option_set_peer_max_concurrent_streams.rst
nghttp2_option_set_user_recv_extension_type.rst

View File

@ -64,6 +64,7 @@ APIDOCS= \
nghttp2_option_set_no_auto_window_update.rst \
nghttp2_option_set_no_closed_streams.rst \
nghttp2_option_set_no_http_messaging.rst \
nghttp2_option_set_enable_connect_protocol.rst \
nghttp2_option_set_no_recv_client_magic.rst \
nghttp2_option_set_peer_max_concurrent_streams.rst \
nghttp2_option_set_user_recv_extension_type.rst \

View File

@ -2534,6 +2534,17 @@ nghttp2_option_set_no_recv_client_magic(nghttp2_option *option, int val);
NGHTTP2_EXTERN void nghttp2_option_set_no_http_messaging(nghttp2_option *option,
int val);
/**
* @function
*
* By default, nghttp2 library does not allow the CONNECT method. For
* applications which wish to use CONNECT to allow websockets to traverse an
* HTTP/2 hop, give a nonzero |val| to enable CONNECT support.
* See `RFC 8441 <https://tools.ietf.org/html/rfc8441>`_ for details.
*/
NGHTTP2_EXTERN void nghttp2_option_set_enable_connect_protocol(nghttp2_option *option,
int val);
/**
* @function
*

View File

@ -59,6 +59,11 @@ void nghttp2_option_set_no_http_messaging(nghttp2_option *option, int val) {
option->no_http_messaging = val;
}
void nghttp2_option_set_enable_connect_protocol(nghttp2_option *option, int val) {
option->opt_set_mask |= NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL;
option->no_http_messaging = val;
}
void nghttp2_option_set_max_reserved_remote_streams(nghttp2_option *option,
uint32_t val) {
option->opt_set_mask |= NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS;