diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h index bd5e6c28723232..8dfe536dec9ade 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.67.1" +#define NGHTTP2_VERSION "1.68.0" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x014301 +#define NGHTTP2_VERSION_NUM 0x014400 #endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/nghttp2_alpn.h b/deps/nghttp2/lib/nghttp2_alpn.h index 09810fd821490a..ecc9ed204e9d0a 100644 --- a/deps/nghttp2/lib/nghttp2_alpn.h +++ b/deps/nghttp2/lib/nghttp2_alpn.h @@ -27,8 +27,8 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include -#endif /* NGHTTP2_ALPN_H */ +#endif /* !defined(NGHTTP2_ALPN_H) */ diff --git a/deps/nghttp2/lib/nghttp2_buf.h b/deps/nghttp2/lib/nghttp2_buf.h index 95ff3706a232a3..636aa619cb69c2 100644 --- a/deps/nghttp2/lib/nghttp2_buf.h +++ b/deps/nghttp2/lib/nghttp2_buf.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -409,4 +409,4 @@ int nghttp2_bufs_next_present(nghttp2_bufs *bufs); */ size_t nghttp2_bufs_len(nghttp2_bufs *bufs); -#endif /* NGHTTP2_BUF_H */ +#endif /* !defined(NGHTTP2_BUF_H) */ diff --git a/deps/nghttp2/lib/nghttp2_callbacks.h b/deps/nghttp2/lib/nghttp2_callbacks.h index ad515970c48a36..4b45e57849b646 100644 --- a/deps/nghttp2/lib/nghttp2_callbacks.h +++ b/deps/nghttp2/lib/nghttp2_callbacks.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -154,4 +154,4 @@ struct nghttp2_session_callbacks { nghttp2_rand_callback rand_callback; }; -#endif /* NGHTTP2_CALLBACKS_H */ +#endif /* !defined(NGHTTP2_CALLBACKS_H) */ diff --git a/deps/nghttp2/lib/nghttp2_debug.c b/deps/nghttp2/lib/nghttp2_debug.c index 09dd2b28587af5..b5f33ef3a6d1a9 100644 --- a/deps/nghttp2/lib/nghttp2_debug.c +++ b/deps/nghttp2/lib/nghttp2_debug.c @@ -50,11 +50,11 @@ void nghttp2_set_debug_vprintf_callback( static_debug_vprintf_callback = debug_vprintf_callback; } -#else /* !DEBUGBUILD */ +#else /* !defined(DEBUGBUILD) */ void nghttp2_set_debug_vprintf_callback( nghttp2_debug_vprintf_callback debug_vprintf_callback) { (void)debug_vprintf_callback; } -#endif /* !DEBUGBUILD */ +#endif /* !defined(DEBUGBUILD) */ diff --git a/deps/nghttp2/lib/nghttp2_debug.h b/deps/nghttp2/lib/nghttp2_debug.h index cbb4dd57547234..26566a622dba85 100644 --- a/deps/nghttp2/lib/nghttp2_debug.h +++ b/deps/nghttp2/lib/nghttp2_debug.h @@ -27,17 +27,17 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #ifdef DEBUGBUILD # define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__) void nghttp2_debug_vprintf(const char *format, ...); -#else +#else /* !defined(DEBUGBUILD) */ # define DEBUGF(...) \ do { \ } while (0) -#endif +#endif /* !defined(DEBUGBUILD) */ -#endif /* NGHTTP2_DEBUG_H */ +#endif /* !defined(NGHTTP2_DEBUG_H) */ diff --git a/deps/nghttp2/lib/nghttp2_extpri.h b/deps/nghttp2/lib/nghttp2_extpri.h index db911972084c72..2e0391653b2c3e 100644 --- a/deps/nghttp2/lib/nghttp2_extpri.h +++ b/deps/nghttp2/lib/nghttp2_extpri.h @@ -28,7 +28,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -62,4 +62,4 @@ void nghttp2_extpri_from_uint8(nghttp2_extpri *extpri, uint8_t u8extpri); */ #define nghttp2_extpri_uint8_inc(PRI) (((PRI) & NGHTTP2_EXTPRI_INC_MASK) != 0) -#endif /* NGHTTP2_EXTPRI_H */ +#endif /* !defined(NGHTTP2_EXTPRI_H) */ diff --git a/deps/nghttp2/lib/nghttp2_frame.h b/deps/nghttp2/lib/nghttp2_frame.h index d58668806c432a..ed4ab2c6842e71 100644 --- a/deps/nghttp2/lib/nghttp2_frame.h +++ b/deps/nghttp2/lib/nghttp2_frame.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_hd.h" @@ -634,4 +634,4 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv); void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, size_t padlen, int framehd_only); -#endif /* NGHTTP2_FRAME_H */ +#endif /* !defined(NGHTTP2_FRAME_H) */ diff --git a/deps/nghttp2/lib/nghttp2_hd.h b/deps/nghttp2/lib/nghttp2_hd.h index 38a31a83c3891d..bdc7fad5c2b50e 100644 --- a/deps/nghttp2/lib/nghttp2_hd.h +++ b/deps/nghttp2/lib/nghttp2_hd.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -439,4 +439,4 @@ nghttp2_ssize nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx, */ int nghttp2_hd_huff_decode_failure_state(nghttp2_hd_huff_decode_context *ctx); -#endif /* NGHTTP2_HD_H */ +#endif /* !defined(NGHTTP2_HD_H) */ diff --git a/deps/nghttp2/lib/nghttp2_hd_huffman.h b/deps/nghttp2/lib/nghttp2_hd_huffman.h index 2bfd5318165f28..df037a8b20efc3 100644 --- a/deps/nghttp2/lib/nghttp2_hd_huffman.h +++ b/deps/nghttp2/lib/nghttp2_hd_huffman.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -69,4 +69,4 @@ typedef struct { extern const nghttp2_huff_sym huff_sym_table[]; extern const nghttp2_huff_decode huff_decode_table[][16]; -#endif /* NGHTTP2_HD_HUFFMAN_H */ +#endif /* !defined(NGHTTP2_HD_HUFFMAN_H) */ diff --git a/deps/nghttp2/lib/nghttp2_helper.h b/deps/nghttp2/lib/nghttp2_helper.h index f5de6290dab0e1..7d64076140ce88 100644 --- a/deps/nghttp2/lib/nghttp2_helper.h +++ b/deps/nghttp2/lib/nghttp2_helper.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include @@ -142,4 +142,4 @@ int nghttp2_should_send_window_update(int32_t local_window_size, */ uint8_t *nghttp2_cpymem(uint8_t *dest, const void *src, size_t len); -#endif /* NGHTTP2_HELPER_H */ +#endif /* !defined(NGHTTP2_HELPER_H) */ diff --git a/deps/nghttp2/lib/nghttp2_http.h b/deps/nghttp2/lib/nghttp2_http.h index d9992fe690830b..2925334c0b64e8 100644 --- a/deps/nghttp2/lib/nghttp2_http.h +++ b/deps/nghttp2/lib/nghttp2_http.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_session.h" @@ -97,4 +97,4 @@ void nghttp2_http_record_request_method(nghttp2_stream *stream, int nghttp2_http_parse_priority(nghttp2_extpri *dest, const uint8_t *value, size_t valuelen); -#endif /* NGHTTP2_HTTP_H */ +#endif /* !defined(NGHTTP2_HTTP_H) */ diff --git a/deps/nghttp2/lib/nghttp2_int.h b/deps/nghttp2/lib/nghttp2_int.h index b23585ccb27da2..4e3b26860daf07 100644 --- a/deps/nghttp2/lib/nghttp2_int.h +++ b/deps/nghttp2/lib/nghttp2_int.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -55,4 +55,4 @@ typedef enum { NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106 } nghttp2_internal_error; -#endif /* NGHTTP2_INT_H */ +#endif /* !defined(NGHTTP2_INT_H) */ diff --git a/deps/nghttp2/lib/nghttp2_mem.h b/deps/nghttp2/lib/nghttp2_mem.h index f83dbcb8f9a588..10af7c695ef81f 100644 --- a/deps/nghttp2/lib/nghttp2_mem.h +++ b/deps/nghttp2/lib/nghttp2_mem.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -42,4 +42,4 @@ void nghttp2_mem_free2(nghttp2_free free_func, void *ptr, void *mem_user_data); void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size); void *nghttp2_mem_realloc(nghttp2_mem *mem, void *ptr, size_t size); -#endif /* NGHTTP2_MEM_H */ +#endif /* !defined(NGHTTP2_MEM_H) */ diff --git a/deps/nghttp2/lib/nghttp2_net.h b/deps/nghttp2/lib/nghttp2_net.h index 521f98143e4765..0c57d947964460 100644 --- a/deps/nghttp2/lib/nghttp2_net.h +++ b/deps/nghttp2/lib/nghttp2_net.h @@ -27,28 +27,28 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #ifdef HAVE_ARPA_INET_H # include -#endif /* HAVE_ARPA_INET_H */ +#endif /* defined(HAVE_ARPA_INET_H) */ #ifdef HAVE_NETINET_IN_H # include -#endif /* HAVE_NETINET_IN_H */ +#endif /* defined(HAVE_NETINET_IN_H) */ #include -#if defined(WIN32) +#ifdef WIN32 /* Windows requires ws2_32 library for ntonl family functions. We define inline functions for those function so that we don't have dependency on that lib. */ # ifdef _MSC_VER # define STIN static __inline -# else +# else /* !defined(_MSC_VER) */ # define STIN static inline -# endif +# endif /* !defined(_MSC_VER) */ STIN uint32_t htonl(uint32_t hostlong) { uint32_t res; @@ -86,6 +86,6 @@ STIN uint16_t ntohs(uint16_t netshort) { return res; } -#endif /* WIN32 */ +#endif /* defined(WIN32) */ -#endif /* NGHTTP2_NET_H */ +#endif /* !defined(NGHTTP2_NET_H) */ diff --git a/deps/nghttp2/lib/nghttp2_option.h b/deps/nghttp2/lib/nghttp2_option.h index 78fa21e4a77ac8..711185ba2f8e82 100644 --- a/deps/nghttp2/lib/nghttp2_option.h +++ b/deps/nghttp2/lib/nghttp2_option.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -160,4 +160,4 @@ struct nghttp2_option { uint8_t user_recv_ext_types[32]; }; -#endif /* NGHTTP2_OPTION_H */ +#endif /* !defined(NGHTTP2_OPTION_H) */ diff --git a/deps/nghttp2/lib/nghttp2_outbound_item.h b/deps/nghttp2/lib/nghttp2_outbound_item.h index 4e91750088f809..6e8e310cc475dd 100644 --- a/deps/nghttp2/lib/nghttp2_outbound_item.h +++ b/deps/nghttp2/lib/nghttp2_outbound_item.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_frame.h" @@ -186,4 +186,4 @@ void nghttp2_outbound_queue_pop(nghttp2_outbound_queue *q); /* Returns the size of the queue */ #define nghttp2_outbound_queue_size(Q) ((Q)->n) -#endif /* NGHTTP2_OUTBOUND_ITEM_H */ +#endif /* !defined(NGHTTP2_OUTBOUND_ITEM_H) */ diff --git a/deps/nghttp2/lib/nghttp2_pq.h b/deps/nghttp2/lib/nghttp2_pq.h index c8d90ef2cc8f33..5dd863f86ae956 100644 --- a/deps/nghttp2/lib/nghttp2_pq.h +++ b/deps/nghttp2/lib/nghttp2_pq.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_int.h" @@ -121,4 +121,4 @@ int nghttp2_pq_each(nghttp2_pq *pq, nghttp2_pq_item_cb fun, void *arg); */ void nghttp2_pq_remove(nghttp2_pq *pq, nghttp2_pq_entry *item); -#endif /* NGHTTP2_PQ_H */ +#endif /* !defined(NGHTTP2_PQ_H) */ diff --git a/deps/nghttp2/lib/nghttp2_priority_spec.h b/deps/nghttp2/lib/nghttp2_priority_spec.h index 92ece822a8f257..158e0dcdbe6c0a 100644 --- a/deps/nghttp2/lib/nghttp2_priority_spec.h +++ b/deps/nghttp2/lib/nghttp2_priority_spec.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -39,4 +39,4 @@ */ void nghttp2_priority_spec_normalize_weight(nghttp2_priority_spec *pri_spec); -#endif /* NGHTTP2_PRIORITY_SPEC_H */ +#endif /* !defined(NGHTTP2_PRIORITY_SPEC_H) */ diff --git a/deps/nghttp2/lib/nghttp2_queue.h b/deps/nghttp2/lib/nghttp2_queue.h index a06fa6c7a46fc7..c63897c04bef7e 100644 --- a/deps/nghttp2/lib/nghttp2_queue.h +++ b/deps/nghttp2/lib/nghttp2_queue.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -48,4 +48,4 @@ void *nghttp2_queue_front(nghttp2_queue *queue); void *nghttp2_queue_back(nghttp2_queue *queue); int nghttp2_queue_empty(nghttp2_queue *queue); -#endif /* NGHTTP2_QUEUE_H */ +#endif /* !defined(NGHTTP2_QUEUE_H) */ diff --git a/deps/nghttp2/lib/nghttp2_ratelim.h b/deps/nghttp2/lib/nghttp2_ratelim.h index 866ed3f00aed4c..d1097f2f81c406 100644 --- a/deps/nghttp2/lib/nghttp2_ratelim.h +++ b/deps/nghttp2/lib/nghttp2_ratelim.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -54,4 +54,4 @@ void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp); succeeds, or -1. */ int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n); -#endif /* NGHTTP2_RATELIM_H */ +#endif /* !defined(NGHTTP2_RATELIM_H) */ diff --git a/deps/nghttp2/lib/nghttp2_rcbuf.h b/deps/nghttp2/lib/nghttp2_rcbuf.h index 6814e709fb4148..ef82e1b3abd744 100644 --- a/deps/nghttp2/lib/nghttp2_rcbuf.h +++ b/deps/nghttp2/lib/nghttp2_rcbuf.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -77,4 +77,4 @@ int nghttp2_rcbuf_new2(nghttp2_rcbuf **rcbuf_ptr, const uint8_t *src, */ void nghttp2_rcbuf_del(nghttp2_rcbuf *rcbuf); -#endif /* NGHTTP2_RCBUF_H */ +#endif /* !defined(NGHTTP2_RCBUF_H) */ diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c index a53c7420b36952..97d7fda1d295d5 100644 --- a/deps/nghttp2/lib/nghttp2_session.c +++ b/deps/nghttp2/lib/nghttp2_session.c @@ -5657,7 +5657,7 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, DEBUGF("recv: WINDOW_UPDATE\n"); break; } -#endif /* DEBUGBUILD */ +#endif /* defined(DEBUGBUILD) */ iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; @@ -5841,6 +5841,16 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, case NGHTTP2_ALTSVC: if ((session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ALTSVC) == 0) { + /* Receiving too frequent unknown frames is suspicious. */ + rv = session_update_glitch_ratelim(session); + if (rv != 0) { + return rv; + } + + if (iframe->state == NGHTTP2_IB_IGN_ALL) { + return (nghttp2_ssize)inlen; + } + busy = 1; iframe->state = NGHTTP2_IB_IGN_PAYLOAD; break; @@ -5852,6 +5862,17 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, iframe->frame.ext.payload = &iframe->ext_frame_payload.altsvc; if (session->server) { + /* Receiving too frequent ALTSVC from client is + suspicious. */ + rv = session_update_glitch_ratelim(session); + if (rv != 0) { + return rv; + } + + if (iframe->state == NGHTTP2_IB_IGN_ALL) { + return (nghttp2_ssize)inlen; + } + busy = 1; iframe->state = NGHTTP2_IB_IGN_PAYLOAD; break; @@ -5871,6 +5892,16 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, break; case NGHTTP2_ORIGIN: if (!(session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ORIGIN)) { + /* Receiving too frequent unknown frames is suspicious. */ + rv = session_update_glitch_ratelim(session); + if (rv != 0) { + return rv; + } + + if (iframe->state == NGHTTP2_IB_IGN_ALL) { + return (nghttp2_ssize)inlen; + } + busy = 1; iframe->state = NGHTTP2_IB_IGN_PAYLOAD; break; @@ -5882,6 +5913,17 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, if (session->server || iframe->frame.hd.stream_id || (iframe->frame.hd.flags & 0xf0)) { + /* Receiving too frequent invalid frames is + suspicious. */ + rv = session_update_glitch_ratelim(session); + if (rv != 0) { + return rv; + } + + if (iframe->state == NGHTTP2_IB_IGN_ALL) { + return (nghttp2_ssize)inlen; + } + busy = 1; iframe->state = NGHTTP2_IB_IGN_PAYLOAD; break; @@ -5908,6 +5950,16 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, case NGHTTP2_PRIORITY_UPDATE: if ((session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_PRIORITY_UPDATE) == 0) { + /* Receiving too frequent unknown frames is suspicious. */ + rv = session_update_glitch_ratelim(session); + if (rv != 0) { + return rv; + } + + if (iframe->state == NGHTTP2_IB_IGN_ALL) { + return (nghttp2_ssize)inlen; + } + busy = 1; iframe->state = NGHTTP2_IB_IGN_PAYLOAD; break; @@ -6266,7 +6318,7 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, } else { DEBUGF("recv: [IB_IGN_HEADER_BLOCK]\n"); } -#endif /* DEBUGBUILD */ +#endif /* defined(DEBUGBUILD) */ readlen = inbound_frame_payload_readlen(iframe, in, last); @@ -6494,7 +6546,7 @@ nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, } else { fprintf(stderr, "recv: [IB_IGN_CONTINUATION]\n"); } -#endif /* DEBUGBUILD */ +#endif /* defined(DEBUGBUILD) */ if (++session->num_continuations > session->max_continuations) { return NGHTTP2_ERR_TOO_MANY_CONTINUATIONS; diff --git a/deps/nghttp2/lib/nghttp2_session.h b/deps/nghttp2/lib/nghttp2_session.h index 25f300d23f131c..edbef80d397123 100644 --- a/deps/nghttp2/lib/nghttp2_session.h +++ b/deps/nghttp2/lib/nghttp2_session.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_map.h" @@ -892,4 +892,4 @@ int nghttp2_session_update_recv_stream_window_size(nghttp2_session *session, size_t delta_size, int send_window_update); -#endif /* NGHTTP2_SESSION_H */ +#endif /* !defined(NGHTTP2_SESSION_H) */ diff --git a/deps/nghttp2/lib/nghttp2_stream.h b/deps/nghttp2/lib/nghttp2_stream.h index e73cd283b1dca4..603209ec645f30 100644 --- a/deps/nghttp2/lib/nghttp2_stream.h +++ b/deps/nghttp2/lib/nghttp2_stream.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include #include "nghttp2_outbound_item.h" @@ -294,4 +294,4 @@ void nghttp2_stream_attach_item(nghttp2_stream *stream, */ void nghttp2_stream_detach_item(nghttp2_stream *stream); -#endif /* NGHTTP2_STREAM */ +#endif /* !defined(NGHTTP2_STREAM_H) */ diff --git a/deps/nghttp2/lib/nghttp2_submit.h b/deps/nghttp2/lib/nghttp2_submit.h index 350ee02275902a..decf803db27c0d 100644 --- a/deps/nghttp2/lib/nghttp2_submit.h +++ b/deps/nghttp2/lib/nghttp2_submit.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -37,4 +37,4 @@ int nghttp2_submit_data_shared(nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_data_provider_wrap *dpw); -#endif /* NGHTTP2_SUBMIT_H */ +#endif /* !defined(NGHTTP2_SUBMIT_H) */ diff --git a/deps/nghttp2/lib/nghttp2_time.c b/deps/nghttp2/lib/nghttp2_time.c index 148ccfdce81c12..18fd7bcac3771c 100644 --- a/deps/nghttp2/lib/nghttp2_time.c +++ b/deps/nghttp2/lib/nghttp2_time.c @@ -26,7 +26,7 @@ #ifdef HAVE_WINDOWS_H # include -#endif /* HAVE_WINDOWS_H */ +#endif /* defined(HAVE_WINDOWS_H) */ #include @@ -40,12 +40,11 @@ static uint64_t time_now_sec(void) { return (uint64_t)t; } -#endif /* !HAVE_GETTICKCOUNT64 || __CYGWIN__ */ +#endif /* !defined(HAVE_GETTICKCOUNT64) || defined(__CYGWIN__) */ #if defined(HAVE_GETTICKCOUNT64) && !defined(__CYGWIN__) uint64_t nghttp2_time_now_sec(void) { return GetTickCount64() / 1000; } -#elif defined(HAVE_CLOCK_GETTIME) && defined(HAVE_DECL_CLOCK_MONOTONIC) && \ - HAVE_DECL_CLOCK_MONOTONIC +#elif defined(HAVE_CLOCK_GETTIME) && HAVE_DECL_CLOCK_MONOTONIC uint64_t nghttp2_time_now_sec(void) { struct timespec tp; int rv = clock_gettime(CLOCK_MONOTONIC, &tp); @@ -56,8 +55,8 @@ uint64_t nghttp2_time_now_sec(void) { return (uint64_t)tp.tv_sec; } -#else /* (!HAVE_CLOCK_GETTIME || !HAVE_DECL_CLOCK_MONOTONIC) && \ - (!HAVE_GETTICKCOUNT64 || __CYGWIN__)) */ +#else /* (!defined(HAVE_GETTICKCOUNT64) || !defined(__CYGWIN__)) && \ + (!defined(HAVE_CLOCK_GETTIME) || !HAVE_DECL_CLOCK_MONOTONIC) */ uint64_t nghttp2_time_now_sec(void) { return time_now_sec(); } -#endif /* (!HAVE_CLOCK_GETTIME || !HAVE_DECL_CLOCK_MONOTONIC) && \ - (!HAVE_GETTICKCOUNT64 || __CYGWIN__)) */ +#endif /* (!defined(HAVE_GETTICKCOUNT64) || !defined(__CYGWIN__)) && \ + (!defined(HAVE_CLOCK_GETTIME) || !HAVE_DECL_CLOCK_MONOTONIC) */ diff --git a/deps/nghttp2/lib/nghttp2_time.h b/deps/nghttp2/lib/nghttp2_time.h index 03c0bbe944ee3b..a91e62ada35e7a 100644 --- a/deps/nghttp2/lib/nghttp2_time.h +++ b/deps/nghttp2/lib/nghttp2_time.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include @@ -35,4 +35,4 @@ timepoint. If it is unable to get seconds, it returns 0. */ uint64_t nghttp2_time_now_sec(void); -#endif /* NGHTTP2_TIME_H */ +#endif /* !defined(NGHTTP2_TIME_H) */ diff --git a/deps/nghttp2/lib/nghttp2_version.c b/deps/nghttp2/lib/nghttp2_version.c index 4211f2cf8f624d..39a49ff351b9ed 100644 --- a/deps/nghttp2/lib/nghttp2_version.c +++ b/deps/nghttp2/lib/nghttp2_version.c @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif /* defined(HAVE_CONFIG_H) */ #include