Path: blob/master/Utilities/cmnghttp2/lib/nghttp2_option.h
3153 views
/*1* nghttp2 - HTTP/2 C Library2*3* Copyright (c) 2014 Tatsuhiro Tsujikawa4*5* Permission is hereby granted, free of charge, to any person obtaining6* a copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sublicense, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice shall be14* included in all copies or substantial portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND19* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE20* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION21* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION22* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.23*/24#ifndef NGHTTP2_OPTION_H25#define NGHTTP2_OPTION_H2627#ifdef HAVE_CONFIG_H28# include <config.h>29#endif /* HAVE_CONFIG_H */3031#include <nghttp2/nghttp2.h>3233/**34* Configuration options35*/36typedef enum {37/**38* This option prevents the library from sending WINDOW_UPDATE for a39* connection automatically. If this option is set to nonzero, the40* library won't send WINDOW_UPDATE for DATA until application calls41* nghttp2_session_consume() to indicate the amount of consumed42* DATA. By default, this option is set to zero.43*/44NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE = 1,45/**46* This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of47* remote endpoint as if it is received in SETTINGS frame. Without48* specifying this option, before the local endpoint receives49* SETTINGS_MAX_CONCURRENT_STREAMS in SETTINGS frame from remote50* endpoint, SETTINGS_MAX_CONCURRENT_STREAMS is unlimited. This may51* cause problem if local endpoint submits lots of requests52* initially and sending them at once to the remote peer may lead to53* the rejection of some requests. Specifying this option to the54* sensible value, say 100, may avoid this kind of issue. This value55* will be overwritten if the local endpoint receives56* SETTINGS_MAX_CONCURRENT_STREAMS from the remote endpoint.57*/58NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS = 1 << 1,59NGHTTP2_OPT_NO_RECV_CLIENT_MAGIC = 1 << 2,60NGHTTP2_OPT_NO_HTTP_MESSAGING = 1 << 3,61NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS = 1 << 4,62NGHTTP2_OPT_USER_RECV_EXT_TYPES = 1 << 5,63NGHTTP2_OPT_NO_AUTO_PING_ACK = 1 << 6,64NGHTTP2_OPT_BUILTIN_RECV_EXT_TYPES = 1 << 7,65NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH = 1 << 8,66NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE = 1 << 9,67NGHTTP2_OPT_NO_CLOSED_STREAMS = 1 << 10,68NGHTTP2_OPT_MAX_OUTBOUND_ACK = 1 << 11,69NGHTTP2_OPT_MAX_SETTINGS = 1 << 12,70NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES = 1 << 13,71NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION = 1 << 14,72} nghttp2_option_flag;7374/**75* Struct to store option values for nghttp2_session.76*/77struct nghttp2_option {78/**79* NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH80*/81size_t max_send_header_block_length;82/**83* NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE84*/85size_t max_deflate_dynamic_table_size;86/**87* NGHTTP2_OPT_MAX_OUTBOUND_ACK88*/89size_t max_outbound_ack;90/**91* NGHTTP2_OPT_MAX_SETTINGS92*/93size_t max_settings;94/**95* Bitwise OR of nghttp2_option_flag to determine that which fields96* are specified.97*/98uint32_t opt_set_mask;99/**100* NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS101*/102uint32_t peer_max_concurrent_streams;103/**104* NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS105*/106uint32_t max_reserved_remote_streams;107/**108* NGHTTP2_OPT_BUILTIN_RECV_EXT_TYPES109*/110uint32_t builtin_recv_ext_types;111/**112* NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE113*/114int no_auto_window_update;115/**116* NGHTTP2_OPT_NO_RECV_CLIENT_MAGIC117*/118int no_recv_client_magic;119/**120* NGHTTP2_OPT_NO_HTTP_MESSAGING121*/122int no_http_messaging;123/**124* NGHTTP2_OPT_NO_AUTO_PING_ACK125*/126int no_auto_ping_ack;127/**128* NGHTTP2_OPT_NO_CLOSED_STREAMS129*/130int no_closed_streams;131/**132* NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES133*/134int server_fallback_rfc7540_priorities;135/**136* NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION137*/138int no_rfc9113_leading_and_trailing_ws_validation;139/**140* NGHTTP2_OPT_USER_RECV_EXT_TYPES141*/142uint8_t user_recv_ext_types[32];143};144145#endif /* NGHTTP2_OPTION_H */146147148