From b3846d6c272c7b33c0c366f5578dbd5bf0e40d5d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 20 Feb 2015 23:07:48 +0900 Subject: [PATCH] Rename NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS with NGHTTP2_OPTMASK_NO_HTTP_MESSAGING --- lib/nghttp2_session.c | 14 +++++++------- lib/nghttp2_session.h | 2 +- tests/nghttp2_session_test.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 8f0be930..de06c5a4 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -77,8 +77,8 @@ static int is_non_fatal(int lib_error) { int nghttp2_is_fatal(int lib_error) { return lib_error < NGHTTP2_ERR_FATAL; } -static int session_enforce_http_semantics(nghttp2_session *session) { - return (session->opt_flags & NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS) == 0; +static int session_enforce_http_messaging(nghttp2_session *session) { + return (session->opt_flags & NGHTTP2_OPTMASK_NO_HTTP_MESSAGING) == 0; } /* @@ -1761,7 +1761,7 @@ static int session_prep_frame(nghttp2_session *session, return rv; } - if (session_enforce_http_semantics(session)) { + if (session_enforce_http_messaging(session)) { nghttp2_http_record_request_method(stream, frame); } } else { @@ -3159,7 +3159,7 @@ static int inflate_header_block(nghttp2_session *session, nghttp2_frame *frame, DEBUGF(fprintf(stderr, "recv: proclen=%zd\n", proclen)); if (call_header_cb && (inflate_flags & NGHTTP2_HD_INFLATE_EMIT)) { - if (subject_stream && session_enforce_http_semantics(session)) { + if (subject_stream && session_enforce_http_messaging(session)) { rv = nghttp2_http_on_header(session, subject_stream, frame, &nv, trailer); if (rv != 0) { @@ -3289,7 +3289,7 @@ static int session_after_header_block_received(nghttp2_session *session) { return 0; } - if (session_enforce_http_semantics(session)) { + if (session_enforce_http_messaging(session)) { if (frame->hd.type == NGHTTP2_PUSH_PROMISE) { nghttp2_stream *subject_stream; @@ -4356,7 +4356,7 @@ int nghttp2_session_on_data_received(nghttp2_session *session, return 0; } - if (session_enforce_http_semantics(session) && + if (session_enforce_http_messaging(session) && (frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) { if (nghttp2_http_on_remote_end_stream(stream) != 0) { call_cb = 0; @@ -5707,7 +5707,7 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, DEBUGF(fprintf(stderr, "recv: data_readlen=%zd\n", data_readlen)); if (stream && data_readlen > 0) { - if (session_enforce_http_semantics(session)) { + if (session_enforce_http_messaging(session)) { if (nghttp2_http_on_data_chunk(stream, data_readlen) != 0) { rv = nghttp2_session_add_rst_stream( session, iframe->frame.hd.stream_id, NGHTTP2_PROTOCOL_ERROR); diff --git a/lib/nghttp2_session.h b/lib/nghttp2_session.h index 721a7a0a..36939c16 100644 --- a/lib/nghttp2_session.h +++ b/lib/nghttp2_session.h @@ -47,7 +47,7 @@ typedef enum { NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE = 1 << 0, NGHTTP2_OPTMASK_RECV_CLIENT_PREFACE = 1 << 1, - NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS = 1 << 2, + NGHTTP2_OPTMASK_NO_HTTP_MESSAGING = 1 << 2, } nghttp2_optmask; typedef enum { diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index f9f9eec5..ac09cb14 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -1386,7 +1386,7 @@ void test_nghttp2_session_continue(void) { nghttp2_session_server_new(&session, &callbacks, &user_data); /* disable strict HTTP layering checks */ - session->opt_flags |= NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS; + session->opt_flags |= NGHTTP2_OPTMASK_NO_HTTP_MESSAGING; nghttp2_hd_deflate_init(&deflater, mem);