Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
ca57c2f6
Commit
ca57c2f6
authored
Nov 29, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename NGHTTP2_GOAWAY_FAIL_ON_SEND with NGHTTP2_GOAWAY_TERM_ON_FAIL
parent
d75ba74b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
lib/nghttp2_session.c
lib/nghttp2_session.c
+4
-4
lib/nghttp2_session.h
lib/nghttp2_session.h
+1
-1
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+10
-10
No files found.
lib/nghttp2_session.c
View file @
ca57c2f6
...
@@ -128,7 +128,7 @@ static int session_terminate_session(nghttp2_session *session,
...
@@ -128,7 +128,7 @@ static int session_terminate_session(nghttp2_session *session,
const
uint8_t
*
debug_data
;
const
uint8_t
*
debug_data
;
size_t
debug_datalen
;
size_t
debug_datalen
;
if
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_
FAIL
_ON_SEND
)
{
if
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_
TERM
_ON_SEND
)
{
return
0
;
return
0
;
}
}
...
@@ -147,7 +147,7 @@ static int session_terminate_session(nghttp2_session *session,
...
@@ -147,7 +147,7 @@ static int session_terminate_session(nghttp2_session *session,
return
rv
;
return
rv
;
}
}
session
->
goaway_flags
|=
NGHTTP2_GOAWAY_
FAIL
_ON_SEND
;
session
->
goaway_flags
|=
NGHTTP2_GOAWAY_
TERM
_ON_SEND
;
return
0
;
return
0
;
}
}
...
@@ -5587,7 +5587,7 @@ int nghttp2_session_want_read(nghttp2_session *session) {
...
@@ -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
/* If these flags are set, we don't want to read. The application
should drop the connection. */
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
))
{
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_TERM_SENT
))
{
return
0
;
return
0
;
}
}
...
@@ -5610,7 +5610,7 @@ int nghttp2_session_want_write(nghttp2_session *session) {
...
@@ -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
/* If these flags are set, we don't want to write any data. The
application should drop the connection. */
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
))
{
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_TERM_SENT
))
{
return
0
;
return
0
;
}
}
...
...
lib/nghttp2_session.h
View file @
ca57c2f6
...
@@ -127,7 +127,7 @@ typedef struct {
...
@@ -127,7 +127,7 @@ typedef struct {
typedef
enum
{
typedef
enum
{
NGHTTP2_GOAWAY_NONE
=
0
,
NGHTTP2_GOAWAY_NONE
=
0
,
/* Flag means that connection should be terminated after sending GOAWAY. */
/* 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 */
/* Flag means GOAWAY to terminate session has been sent */
NGHTTP2_GOAWAY_TERM_SENT
=
0x2
,
NGHTTP2_GOAWAY_TERM_SENT
=
0x2
,
}
nghttp2_goaway_flag
;
}
nghttp2_goaway_flag
;
...
...
tests/nghttp2_session_test.c
View file @
ca57c2f6
...
@@ -1716,7 +1716,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1716,7 +1716,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
1
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
session
->
local_settings
.
max_concurrent_streams
=
session
->
local_settings
.
max_concurrent_streams
=
...
@@ -1731,7 +1731,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1731,7 +1731,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
0
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -1744,7 +1744,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1744,7 +1744,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
1
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -1779,7 +1779,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1779,7 +1779,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
1
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -1795,7 +1795,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1795,7 +1795,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
1
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -1814,7 +1814,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1814,7 +1814,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
0
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -1841,7 +1841,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
...
@@ -1841,7 +1841,7 @@ void test_nghttp2_session_on_request_headers_received(void) {
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
CU_ASSERT
(
NGHTTP2_ERR_IGN_HEADER_BLOCK
==
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
nghttp2_session_on_request_headers_received
(
session
,
&
frame
));
CU_ASSERT
(
0
==
user_data
.
invalid_frame_recv_cb_called
);
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
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
...
@@ -2589,9 +2589,9 @@ void test_nghttp2_session_on_window_update_received(void) {
...
@@ -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
,
nghttp2_frame_window_update_init
(
&
frame
.
window_update
,
NGHTTP2_FLAG_NONE
,
2
,
4096
);
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
(
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
);
nghttp2_frame_window_update_free
(
&
frame
.
window_update
);
...
@@ -2608,7 +2608,7 @@ void test_nghttp2_session_on_window_update_received(void) {
...
@@ -2608,7 +2608,7 @@ void test_nghttp2_session_on_window_update_received(void) {
4096
);
4096
);
CU_ASSERT
(
0
==
nghttp2_session_on_window_update_received
(
session
,
&
frame
));
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
);
CU_ASSERT
(
NGHTTP2_INITIAL_WINDOW_SIZE
+
4096
==
stream
->
remote_window_size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment