Skip to content

Commit 1e15581

Browse files
addaleaxtargos
authored andcommitted
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: #21827 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 6b925eb commit 1e15581

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

src/node_http2.h

-52
Original file line numberDiff line numberDiff line change
@@ -326,58 +326,6 @@ enum padding_strategy_type {
326326
PADDING_STRATEGY_CALLBACK
327327
};
328328

329-
// These are the error codes provided by the underlying nghttp2 implementation.
330-
#define NGHTTP2_ERROR_CODES(V) \
331-
V(NGHTTP2_ERR_INVALID_ARGUMENT) \
332-
V(NGHTTP2_ERR_BUFFER_ERROR) \
333-
V(NGHTTP2_ERR_UNSUPPORTED_VERSION) \
334-
V(NGHTTP2_ERR_WOULDBLOCK) \
335-
V(NGHTTP2_ERR_PROTO) \
336-
V(NGHTTP2_ERR_INVALID_FRAME) \
337-
V(NGHTTP2_ERR_EOF) \
338-
V(NGHTTP2_ERR_DEFERRED) \
339-
V(NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE) \
340-
V(NGHTTP2_ERR_STREAM_CLOSED) \
341-
V(NGHTTP2_ERR_STREAM_CLOSING) \
342-
V(NGHTTP2_ERR_STREAM_SHUT_WR) \
343-
V(NGHTTP2_ERR_INVALID_STREAM_ID) \
344-
V(NGHTTP2_ERR_INVALID_STREAM_STATE) \
345-
V(NGHTTP2_ERR_DEFERRED_DATA_EXIST) \
346-
V(NGHTTP2_ERR_START_STREAM_NOT_ALLOWED) \
347-
V(NGHTTP2_ERR_GOAWAY_ALREADY_SENT) \
348-
V(NGHTTP2_ERR_INVALID_HEADER_BLOCK) \
349-
V(NGHTTP2_ERR_INVALID_STATE) \
350-
V(NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) \
351-
V(NGHTTP2_ERR_FRAME_SIZE_ERROR) \
352-
V(NGHTTP2_ERR_HEADER_COMP) \
353-
V(NGHTTP2_ERR_FLOW_CONTROL) \
354-
V(NGHTTP2_ERR_INSUFF_BUFSIZE) \
355-
V(NGHTTP2_ERR_PAUSE) \
356-
V(NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS) \
357-
V(NGHTTP2_ERR_PUSH_DISABLED) \
358-
V(NGHTTP2_ERR_DATA_EXIST) \
359-
V(NGHTTP2_ERR_SESSION_CLOSING) \
360-
V(NGHTTP2_ERR_HTTP_HEADER) \
361-
V(NGHTTP2_ERR_HTTP_MESSAGING) \
362-
V(NGHTTP2_ERR_REFUSED_STREAM) \
363-
V(NGHTTP2_ERR_INTERNAL) \
364-
V(NGHTTP2_ERR_CANCEL) \
365-
V(NGHTTP2_ERR_FATAL) \
366-
V(NGHTTP2_ERR_NOMEM) \
367-
V(NGHTTP2_ERR_CALLBACK_FAILURE) \
368-
V(NGHTTP2_ERR_BAD_CLIENT_MAGIC) \
369-
V(NGHTTP2_ERR_FLOODED)
370-
371-
const char* nghttp2_errname(int rv) {
372-
switch (rv) {
373-
#define V(code) case code: return #code;
374-
NGHTTP2_ERROR_CODES(V)
375-
#undef V
376-
default:
377-
return "NGHTTP2_UNKNOWN_ERROR";
378-
}
379-
}
380-
381329
enum session_state_flags {
382330
SESSION_STATE_NONE = 0x0,
383331
SESSION_STATE_HAS_SCOPE = 0x1,

0 commit comments

Comments
 (0)