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
b7ff05c4
Commit
b7ff05c4
authored
Jul 23, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail session if header compression failed on send
parent
65cb5594
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
lib/nghttp2_session.c
lib/nghttp2_session.c
+6
-0
tests/main.c
tests/main.c
+2
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+35
-0
tests/nghttp2_session_test.h
tests/nghttp2_session_test.h
+1
-0
No files found.
lib/nghttp2_session.c
View file @
b7ff05c4
...
...
@@ -1290,6 +1290,12 @@ int nghttp2_session_send(nghttp2_session *session)
nghttp2_outbound_item_free
(
item
);
free
(
item
);
if
(
framebuflen
==
NGHTTP2_ERR_HEADER_COMP
)
{
// If header compression error occurred, should terminiate
// connection.
framebuflen
=
nghttp2_session_fail_session
(
session
,
NGHTTP2_INTERNAL_ERROR
);
}
if
(
nghttp2_is_fatal
(
framebuflen
))
{
return
framebuflen
;
}
else
{
...
...
tests/main.c
View file @
b7ff05c4
...
...
@@ -108,6 +108,8 @@ int main(int argc, char* argv[])
test_nghttp2_session_send_headers_start_stream
)
||
!
CU_add_test
(
pSuite
,
"session_send_headers_reply"
,
test_nghttp2_session_send_headers_reply
)
||
!
CU_add_test
(
pSuite
,
"session_send_headers_header_comp_error"
,
test_nghttp2_session_send_headers_header_comp_error
)
||
!
CU_add_test
(
pSuite
,
"session_send_priority"
,
test_nghttp2_session_send_priority
)
||
!
CU_add_test
(
pSuite
,
"session_send_rst_stream"
,
...
...
tests/nghttp2_session_test.c
View file @
b7ff05c4
...
...
@@ -1115,6 +1115,41 @@ void test_nghttp2_session_send_headers_reply(void)
nghttp2_session_del
(
session
);
}
/* TODO Rewrite this test when header continuation is supported */
void
test_nghttp2_session_send_headers_header_comp_error
(
void
)
{
nghttp2_session
*
session
;
nghttp2_session_callbacks
callbacks
;
const
char
*
nv
[]
=
{
":path"
,
NULL
,
NULL
};
size_t
valuelen
=
64
*
1024
-
1
;
char
*
value
=
malloc
(
valuelen
+
1
);
nghttp2_frame
*
frame
=
malloc
(
sizeof
(
nghttp2_frame
));
nghttp2_nv
*
nva
;
ssize_t
nvlen
;
memset
(
value
,
'0'
,
valuelen
);
value
[
valuelen
]
=
'\0'
;
nv
[
1
]
=
value
;
memset
(
&
callbacks
,
0
,
sizeof
(
nghttp2_session_callbacks
));
callbacks
.
send_callback
=
null_send_callback
;
nghttp2_session_client_new
(
&
session
,
&
callbacks
,
NULL
);
nvlen
=
nghttp2_nv_array_from_cstr
(
&
nva
,
nv
);
nghttp2_frame_headers_init
(
&
frame
->
headers
,
NGHTTP2_FLAG_END_HEADERS
,
-
1
,
NGHTTP2_PRI_DEFAULT
,
nva
,
nvlen
);
nghttp2_session_add_frame
(
session
,
NGHTTP2_CAT_CTRL
,
frame
,
NULL
);
CU_ASSERT
(
0
==
nghttp2_session_send
(
session
));
CU_ASSERT
(
session
->
goaway_flags
&
(
NGHTTP2_GOAWAY_SEND
|
NGHTTP2_GOAWAY_FAIL_ON_SEND
));
free
(
value
);
nghttp2_session_del
(
session
);
}
void
test_nghttp2_session_send_priority
(
void
)
{
nghttp2_session
*
session
;
...
...
tests/nghttp2_session_test.h
View file @
b7ff05c4
...
...
@@ -43,6 +43,7 @@ void test_nghttp2_session_on_window_update_received(void);
void
test_nghttp2_session_on_data_received
(
void
);
void
test_nghttp2_session_send_headers_start_stream
(
void
);
void
test_nghttp2_session_send_headers_reply
(
void
);
void
test_nghttp2_session_send_headers_header_comp_error
(
void
);
void
test_nghttp2_session_send_priority
(
void
);
void
test_nghttp2_session_send_rst_stream
(
void
);
void
test_nghttp2_session_is_my_stream_id
(
void
);
...
...
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