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
1945d0f0
Commit
1945d0f0
authored
Jun 23, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix assertion failure in nghttp2_stream.c
This is regression introduced in
46b70c1d
.
parent
4870edb3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
1 deletion
+48
-1
lib/nghttp2_stream.c
lib/nghttp2_stream.c
+6
-1
tests/main.c
tests/main.c
+2
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+39
-0
tests/nghttp2_session_test.h
tests/nghttp2_session_test.h
+1
-0
No files found.
lib/nghttp2_stream.c
View file @
1945d0f0
...
...
@@ -356,7 +356,12 @@ static int stream_update_dep_on_detach_item(nghttp2_stream *stream,
return
0
;
}
assert
(
stream
->
dpri
==
NGHTTP2_STREAM_DPRI_TOP
);
if
(
stream
->
dpri
==
NGHTTP2_STREAM_DPRI_NO_ITEM
)
{
/* nghttp2_stream_defer_item() does not clear stream->item, but
set dpri = NGHTTP2_STREAM_DPRI_NO_ITEM. Catch this case
here. */
return
0
;
}
stream
->
dpri
=
NGHTTP2_STREAM_DPRI_NO_ITEM
;
...
...
tests/main.c
View file @
1945d0f0
...
...
@@ -266,6 +266,8 @@ int main(int argc _U_, char *argv[] _U_) {
test_nghttp2_session_send_data_callback
)
||
!
CU_add_test
(
pSuite
,
"session_on_begin_headers_temporal_failure"
,
test_nghttp2_session_on_begin_headers_temporal_failure
)
||
!
CU_add_test
(
pSuite
,
"session_defer_then_close"
,
test_nghttp2_session_defer_then_close
)
||
!
CU_add_test
(
pSuite
,
"http_mandatory_headers"
,
test_nghttp2_http_mandatory_headers
)
||
!
CU_add_test
(
pSuite
,
"http_content_length"
,
...
...
tests/nghttp2_session_test.c
View file @
1945d0f0
...
...
@@ -7469,6 +7469,45 @@ void test_nghttp2_session_on_begin_headers_temporal_failure(void) {
nghttp2_bufs_free
(
&
bufs
);
}
void
test_nghttp2_session_defer_then_close
(
void
)
{
nghttp2_session
*
session
;
nghttp2_session_callbacks
callbacks
;
nghttp2_data_provider
prd
;
int
rv
;
const
uint8_t
*
datap
;
ssize_t
datalen
;
nghttp2_frame
frame
;
memset
(
&
callbacks
,
0
,
sizeof
(
nghttp2_session_callbacks
));
callbacks
.
send_callback
=
null_send_callback
;
nghttp2_session_client_new
(
&
session
,
&
callbacks
,
NULL
);
prd
.
read_callback
=
defer_data_source_read_callback
;
rv
=
nghttp2_submit_request
(
session
,
NULL
,
reqnv
,
ARRLEN
(
reqnv
),
&
prd
,
NULL
);
CU_ASSERT
(
rv
>
0
);
/* This sends HEADERS */
datalen
=
nghttp2_session_mem_send
(
session
,
&
datap
);
CU_ASSERT
(
datalen
>
0
);
/* This makes DATA item deferred */
datalen
=
nghttp2_session_mem_send
(
session
,
&
datap
);
CU_ASSERT
(
datalen
==
0
);
nghttp2_frame_rst_stream_init
(
&
frame
.
rst_stream
,
1
,
NGHTTP2_CANCEL
);
/* Assertion failure; GH-264 */
rv
=
nghttp2_session_on_rst_stream_received
(
session
,
&
frame
);
CU_ASSERT
(
rv
==
0
);
nghttp2_session_del
(
session
);
}
static
void
check_nghttp2_http_recv_headers_fail
(
nghttp2_session
*
session
,
nghttp2_hd_deflater
*
deflater
,
int32_t
stream_id
,
int
stream_state
,
const
nghttp2_nv
*
nva
,
size_t
nvlen
)
{
...
...
tests/nghttp2_session_test.h
View file @
1945d0f0
...
...
@@ -126,6 +126,7 @@ void test_nghttp2_session_cancel_reserved_remote(void);
void
test_nghttp2_session_reset_pending_headers
(
void
);
void
test_nghttp2_session_send_data_callback
(
void
);
void
test_nghttp2_session_on_begin_headers_temporal_failure
(
void
);
void
test_nghttp2_session_defer_then_close
(
void
);
void
test_nghttp2_http_mandatory_headers
(
void
);
void
test_nghttp2_http_content_length
(
void
);
void
test_nghttp2_http_content_length_mismatch
(
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