Rename NGHTTP2_GOAWAY_FAIL_ON_SEND with NGHTTP2_GOAWAY_TERM_ON_FAIL
This commit is contained in:
parent
d75ba74bbd
commit
ca57c2f6b6
|
@ -128,7 +128,7 @@ static int session_terminate_session(nghttp2_session *session,
|
|||
const uint8_t *debug_data;
|
||||
size_t debug_datalen;
|
||||
|
||||
if (session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND) {
|
||||
if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ static int session_terminate_session(nghttp2_session *session,
|
|||
return rv;
|
||||
}
|
||||
|
||||
session->goaway_flags |= NGHTTP2_GOAWAY_FAIL_ON_SEND;
|
||||
session->goaway_flags |= NGHTTP2_GOAWAY_TERM_ON_SEND;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -5587,7 +5587,7 @@ int nghttp2_session_want_read(nghttp2_session *session) {
|
|||
|
||||
/* If these flags are set, we don't want to read. The application
|
||||
should drop the connection. */
|
||||
if ((session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND) &&
|
||||
if ((session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) &&
|
||||
(session->goaway_flags & NGHTTP2_GOAWAY_TERM_SENT)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -5610,7 +5610,7 @@ int nghttp2_session_want_write(nghttp2_session *session) {
|
|||
|
||||
/* If these flags are set, we don't want to write any data. The
|
||||
application should drop the connection. */
|
||||
if ((session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND) &&
|
||||
if ((session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) &&
|
||||
(session->goaway_flags & NGHTTP2_GOAWAY_TERM_SENT)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ typedef struct {
|
|||
typedef enum {
|
||||
NGHTTP2_GOAWAY_NONE = 0,
|
||||
/* Flag means that connection should be terminated after sending GOAWAY. */
|
||||
NGHTTP2_GOAWAY_FAIL_ON_SEND = 0x1,
|
||||
NGHTTP2_GOAWAY_TERM_ON_SEND = 0x1,
|
||||
/* Flag means GOAWAY to terminate session has been sent */
|
||||
NGHTTP2_GOAWAY_TERM_SENT = 0x2,
|
||||
} nghttp2_goaway_flag;
|
||||
|
|
|
@ -1716,7 +1716,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(1 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
session->local_settings.max_concurrent_streams =
|
||||
|
@ -1731,7 +1731,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(0 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -1744,7 +1744,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(1 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND);
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -1779,7 +1779,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(1 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND);
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -1795,7 +1795,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(1 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND);
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -1814,7 +1814,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(0 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -1841,7 +1841,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
|
|||
CU_ASSERT(NGHTTP2_ERR_IGN_HEADER_BLOCK ==
|
||||
nghttp2_session_on_request_headers_received(session, &frame));
|
||||
CU_ASSERT(0 == user_data.invalid_frame_recv_cb_called);
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(0 == (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
|
||||
nghttp2_frame_headers_free(&frame.headers);
|
||||
|
||||
|
@ -2589,9 +2589,9 @@ void test_nghttp2_session_on_window_update_received(void) {
|
|||
nghttp2_frame_window_update_init(&frame.window_update, NGHTTP2_FLAG_NONE, 2,
|
||||
4096);
|
||||
|
||||
CU_ASSERT(!(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(!(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
CU_ASSERT(0 == nghttp2_session_on_window_update_received(session, &frame));
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND);
|
||||
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND);
|
||||
|
||||
nghttp2_frame_window_update_free(&frame.window_update);
|
||||
|
||||
|
@ -2608,7 +2608,7 @@ void test_nghttp2_session_on_window_update_received(void) {
|
|||
4096);
|
||||
|
||||
CU_ASSERT(0 == nghttp2_session_on_window_update_received(session, &frame));
|
||||
CU_ASSERT(!(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
|
||||
CU_ASSERT(!(session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND));
|
||||
|
||||
CU_ASSERT(NGHTTP2_INITIAL_WINDOW_SIZE + 4096 == stream->remote_window_size);
|
||||
|
||||
|
|
Loading…
Reference in New Issue