From f3c9f5a6be0b60b30fb964ab604faddb299789d5 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 15 Jul 2018 23:58:13 +0200 Subject: [PATCH] http2: remove unused nghttp2 error list Remove a list of HTTP2 errors as well as `nghttp2_errname()` that converted an integer nghttp2 error code to a string representation. We already use `nghttp2_strerror()` for this, which is provided by nghttp2 returns a better error string anyway. PR-URL: https://github.com/nodejs/node/pull/21827 Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- src/node_http2.h | 52 ------------------------------------------------ 1 file changed, 52 deletions(-) diff --git a/src/node_http2.h b/src/node_http2.h index 09771862f53bae..219d1d02527088 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -377,58 +377,6 @@ enum padding_strategy_type { PADDING_STRATEGY_CALLBACK }; -// These are the error codes provided by the underlying nghttp2 implementation. -#define NGHTTP2_ERROR_CODES(V) \ - V(NGHTTP2_ERR_INVALID_ARGUMENT) \ - V(NGHTTP2_ERR_BUFFER_ERROR) \ - V(NGHTTP2_ERR_UNSUPPORTED_VERSION) \ - V(NGHTTP2_ERR_WOULDBLOCK) \ - V(NGHTTP2_ERR_PROTO) \ - V(NGHTTP2_ERR_INVALID_FRAME) \ - V(NGHTTP2_ERR_EOF) \ - V(NGHTTP2_ERR_DEFERRED) \ - V(NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE) \ - V(NGHTTP2_ERR_STREAM_CLOSED) \ - V(NGHTTP2_ERR_STREAM_CLOSING) \ - V(NGHTTP2_ERR_STREAM_SHUT_WR) \ - V(NGHTTP2_ERR_INVALID_STREAM_ID) \ - V(NGHTTP2_ERR_INVALID_STREAM_STATE) \ - V(NGHTTP2_ERR_DEFERRED_DATA_EXIST) \ - V(NGHTTP2_ERR_START_STREAM_NOT_ALLOWED) \ - V(NGHTTP2_ERR_GOAWAY_ALREADY_SENT) \ - V(NGHTTP2_ERR_INVALID_HEADER_BLOCK) \ - V(NGHTTP2_ERR_INVALID_STATE) \ - V(NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) \ - V(NGHTTP2_ERR_FRAME_SIZE_ERROR) \ - V(NGHTTP2_ERR_HEADER_COMP) \ - V(NGHTTP2_ERR_FLOW_CONTROL) \ - V(NGHTTP2_ERR_INSUFF_BUFSIZE) \ - V(NGHTTP2_ERR_PAUSE) \ - V(NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS) \ - V(NGHTTP2_ERR_PUSH_DISABLED) \ - V(NGHTTP2_ERR_DATA_EXIST) \ - V(NGHTTP2_ERR_SESSION_CLOSING) \ - V(NGHTTP2_ERR_HTTP_HEADER) \ - V(NGHTTP2_ERR_HTTP_MESSAGING) \ - V(NGHTTP2_ERR_REFUSED_STREAM) \ - V(NGHTTP2_ERR_INTERNAL) \ - V(NGHTTP2_ERR_CANCEL) \ - V(NGHTTP2_ERR_FATAL) \ - V(NGHTTP2_ERR_NOMEM) \ - V(NGHTTP2_ERR_CALLBACK_FAILURE) \ - V(NGHTTP2_ERR_BAD_CLIENT_MAGIC) \ - V(NGHTTP2_ERR_FLOODED) - -const char* nghttp2_errname(int rv) { - switch (rv) { -#define V(code) case code: return #code; - NGHTTP2_ERROR_CODES(V) -#undef V - default: - return "NGHTTP2_UNKNOWN_ERROR"; - } -} - enum session_state_flags { SESSION_STATE_NONE = 0x0, SESSION_STATE_HAS_SCOPE = 0x1,