Rename NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS with NGHTTP2_OPTMASK_NO_HTTP_MESSAGING
This commit is contained in:
parent
dec115cff3
commit
b3846d6c27
|
@ -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; }
|
int nghttp2_is_fatal(int lib_error) { return lib_error < NGHTTP2_ERR_FATAL; }
|
||||||
|
|
||||||
static int session_enforce_http_semantics(nghttp2_session *session) {
|
static int session_enforce_http_messaging(nghttp2_session *session) {
|
||||||
return (session->opt_flags & NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS) == 0;
|
return (session->opt_flags & NGHTTP2_OPTMASK_NO_HTTP_MESSAGING) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1761,7 +1761,7 @@ static int session_prep_frame(nghttp2_session *session,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session_enforce_http_semantics(session)) {
|
if (session_enforce_http_messaging(session)) {
|
||||||
nghttp2_http_record_request_method(stream, frame);
|
nghttp2_http_record_request_method(stream, frame);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -3159,7 +3159,7 @@ static int inflate_header_block(nghttp2_session *session, nghttp2_frame *frame,
|
||||||
DEBUGF(fprintf(stderr, "recv: proclen=%zd\n", proclen));
|
DEBUGF(fprintf(stderr, "recv: proclen=%zd\n", proclen));
|
||||||
|
|
||||||
if (call_header_cb && (inflate_flags & NGHTTP2_HD_INFLATE_EMIT)) {
|
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,
|
rv = nghttp2_http_on_header(session, subject_stream, frame, &nv,
|
||||||
trailer);
|
trailer);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
|
@ -3289,7 +3289,7 @@ static int session_after_header_block_received(nghttp2_session *session) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session_enforce_http_semantics(session)) {
|
if (session_enforce_http_messaging(session)) {
|
||||||
if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
|
if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
|
||||||
nghttp2_stream *subject_stream;
|
nghttp2_stream *subject_stream;
|
||||||
|
|
||||||
|
@ -4356,7 +4356,7 @@ int nghttp2_session_on_data_received(nghttp2_session *session,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session_enforce_http_semantics(session) &&
|
if (session_enforce_http_messaging(session) &&
|
||||||
(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
|
(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
|
||||||
if (nghttp2_http_on_remote_end_stream(stream) != 0) {
|
if (nghttp2_http_on_remote_end_stream(stream) != 0) {
|
||||||
call_cb = 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));
|
DEBUGF(fprintf(stderr, "recv: data_readlen=%zd\n", data_readlen));
|
||||||
|
|
||||||
if (stream && data_readlen > 0) {
|
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) {
|
if (nghttp2_http_on_data_chunk(stream, data_readlen) != 0) {
|
||||||
rv = nghttp2_session_add_rst_stream(
|
rv = nghttp2_session_add_rst_stream(
|
||||||
session, iframe->frame.hd.stream_id, NGHTTP2_PROTOCOL_ERROR);
|
session, iframe->frame.hd.stream_id, NGHTTP2_PROTOCOL_ERROR);
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE = 1 << 0,
|
NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE = 1 << 0,
|
||||||
NGHTTP2_OPTMASK_RECV_CLIENT_PREFACE = 1 << 1,
|
NGHTTP2_OPTMASK_RECV_CLIENT_PREFACE = 1 << 1,
|
||||||
NGHTTP2_OPTMASK_NO_HTTP_SEMANTICS = 1 << 2,
|
NGHTTP2_OPTMASK_NO_HTTP_MESSAGING = 1 << 2,
|
||||||
} nghttp2_optmask;
|
} nghttp2_optmask;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -1386,7 +1386,7 @@ void test_nghttp2_session_continue(void) {
|
||||||
|
|
||||||
nghttp2_session_server_new(&session, &callbacks, &user_data);
|
nghttp2_session_server_new(&session, &callbacks, &user_data);
|
||||||
/* disable strict HTTP layering checks */
|
/* 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);
|
nghttp2_hd_deflate_init(&deflater, mem);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue