From 83952ef0af4e68ab5657316549970b0aab171042 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 20 Feb 2015 19:30:34 +0900 Subject: [PATCH] Insert '_' before header name nghttp2_http_flag to consistent with token --- lib/nghttp2_http.c | 18 +++++++++--------- lib/nghttp2_stream.h | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/nghttp2_http.c b/lib/nghttp2_http.c index 2b06556c..d75615aa 100644 --- a/lib/nghttp2_http.c +++ b/lib/nghttp2_http.c @@ -238,12 +238,12 @@ static int http_request_on_header(nghttp2_stream *stream, nghttp2_nv *nv, switch (token) { case NGHTTP2_TOKEN__AUTHORITY: - if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_AUTHORITY)) { + if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__AUTHORITY)) { return -1; } break; case NGHTTP2_TOKEN__METHOD: - if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_METHOD)) { + if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__METHOD)) { return -1; } if (streq("HEAD", nv->value, nv->valuelen)) { @@ -255,7 +255,7 @@ static int http_request_on_header(nghttp2_stream *stream, nghttp2_nv *nv, } stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT; if (stream->http_flags & - (NGHTTP2_HTTP_FLAG_PATH | NGHTTP2_HTTP_FLAG_SCHEME)) { + (NGHTTP2_HTTP_FLAG__PATH | NGHTTP2_HTTP_FLAG__SCHEME)) { return -1; } } @@ -264,7 +264,7 @@ static int http_request_on_header(nghttp2_stream *stream, nghttp2_nv *nv, if (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT) { return -1; } - if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_PATH)) { + if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__PATH)) { return -1; } break; @@ -272,7 +272,7 @@ static int http_request_on_header(nghttp2_stream *stream, nghttp2_nv *nv, if (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT) { return -1; } - if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_SCHEME)) { + if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__SCHEME)) { return -1; } break; @@ -331,7 +331,7 @@ static int http_response_on_header(nghttp2_stream *stream, nghttp2_nv *nv, switch (token) { case NGHTTP2_TOKEN__STATUS: { - if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_STATUS)) { + if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__STATUS)) { return -1; } if (nv->valuelen != 3) { @@ -395,14 +395,14 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream, int nghttp2_http_on_request_headers(nghttp2_stream *stream, nghttp2_frame *frame) { if (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT) { - if ((stream->http_flags & NGHTTP2_HTTP_FLAG_AUTHORITY) == 0) { + if ((stream->http_flags & NGHTTP2_HTTP_FLAG__AUTHORITY) == 0) { return -1; } stream->content_length = -1; } else if ((stream->http_flags & NGHTTP2_HTTP_FLAG_REQ_HEADERS) != NGHTTP2_HTTP_FLAG_REQ_HEADERS || (stream->http_flags & - (NGHTTP2_HTTP_FLAG_AUTHORITY | NGHTTP2_HTTP_FLAG_HOST)) == 0) { + (NGHTTP2_HTTP_FLAG__AUTHORITY | NGHTTP2_HTTP_FLAG_HOST)) == 0) { return -1; } @@ -417,7 +417,7 @@ int nghttp2_http_on_request_headers(nghttp2_stream *stream, } int nghttp2_http_on_response_headers(nghttp2_stream *stream) { - if ((stream->http_flags & NGHTTP2_HTTP_FLAG_STATUS) == 0) { + if ((stream->http_flags & NGHTTP2_HTTP_FLAG__STATUS) == 0) { return -1; } diff --git a/lib/nghttp2_stream.h b/lib/nghttp2_stream.h index 6fd6046d..c47d8df4 100644 --- a/lib/nghttp2_stream.h +++ b/lib/nghttp2_stream.h @@ -103,19 +103,19 @@ typedef enum { typedef enum { NGHTTP2_HTTP_FLAG_NONE = 0, /* header field seen so far */ - NGHTTP2_HTTP_FLAG_AUTHORITY = 1, - NGHTTP2_HTTP_FLAG_PATH = 1 << 1, - NGHTTP2_HTTP_FLAG_METHOD = 1 << 2, - NGHTTP2_HTTP_FLAG_SCHEME = 1 << 3, + NGHTTP2_HTTP_FLAG__AUTHORITY = 1, + NGHTTP2_HTTP_FLAG__PATH = 1 << 1, + NGHTTP2_HTTP_FLAG__METHOD = 1 << 2, + NGHTTP2_HTTP_FLAG__SCHEME = 1 << 3, /* host is not pseudo header, but we require either host or :authority */ NGHTTP2_HTTP_FLAG_HOST = 1 << 4, - NGHTTP2_HTTP_FLAG_STATUS = 1 << 5, + NGHTTP2_HTTP_FLAG__STATUS = 1 << 5, /* required header fields for HTTP request except for CONNECT method. */ - NGHTTP2_HTTP_FLAG_REQ_HEADERS = NGHTTP2_HTTP_FLAG_METHOD | - NGHTTP2_HTTP_FLAG_PATH | - NGHTTP2_HTTP_FLAG_SCHEME, + NGHTTP2_HTTP_FLAG_REQ_HEADERS = NGHTTP2_HTTP_FLAG__METHOD | + NGHTTP2_HTTP_FLAG__PATH | + NGHTTP2_HTTP_FLAG__SCHEME, NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED = 1 << 6, /* HTTP method flags */ NGHTTP2_HTTP_FLAG_METH_CONNECT = 1 << 7,