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
b9d2f9b6
Commit
b9d2f9b6
authored
Aug 29, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add int return value to on_frame_not_send_callback
parent
d4852b0f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
13 deletions
+23
-13
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+6
-1
lib/nghttp2_session.c
lib/nghttp2_session.c
+4
-2
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+4
-3
src/shrpx_spdy_session.cc
src/shrpx_spdy_session.cc
+4
-3
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+5
-4
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
b9d2f9b6
...
...
@@ -879,8 +879,13 @@ typedef int (*nghttp2_on_frame_send_callback)
* sent because of the error. The error is indicated by the
* |lib_error_code|, which is one of the values defined in
* :type:`nghttp2_error`.
*
* The implementation of this function must return 0 if it
* succeeds. If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
void
(
*
nghttp2_on_frame_not_send_callback
)
typedef
int
(
*
nghttp2_on_frame_not_send_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
);
...
...
lib/nghttp2_session.c
View file @
b9d2f9b6
...
...
@@ -1474,8 +1474,10 @@ int nghttp2_session_send(nghttp2_session *session)
it. */
nghttp2_frame
*
frame
=
nghttp2_outbound_item_get_ctrl_frame
(
item
);
if
(
frame
->
hd
.
type
!=
NGHTTP2_WINDOW_UPDATE
)
{
session
->
callbacks
.
on_frame_not_send_callback
(
session
,
frame
,
framebuflen
,
session
->
user_data
);
if
(
session
->
callbacks
.
on_frame_not_send_callback
(
session
,
frame
,
framebuflen
,
session
->
user_data
)
!=
0
)
{
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
}
}
nghttp2_outbound_item_free
(
item
);
...
...
src/shrpx_http2_upstream.cc
View file @
b9d2f9b6
...
...
@@ -331,7 +331,7 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
}
// namespace
namespace
{
void
on_frame_not_send_callback
(
nghttp2_session
*
session
,
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
)
{
...
...
@@ -348,6 +348,7 @@ void on_frame_not_send_callback(nghttp2_session *session,
upstream
->
rst_stream
(
downstream
,
NGHTTP2_INTERNAL_ERROR
);
}
}
return
0
;
}
}
// namespace
...
...
src/shrpx_spdy_session.cc
View file @
b9d2f9b6
...
...
@@ -970,7 +970,7 @@ int before_frame_send_callback(nghttp2_session *session,
}
// namespace
namespace
{
void
on_frame_not_send_callback
(
nghttp2_session
*
session
,
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
)
{
...
...
@@ -986,19 +986,20 @@ void on_frame_not_send_callback(nghttp2_session *session,
auto
sd
=
reinterpret_cast
<
StreamData
*>
(
nghttp2_session_get_stream_user_data
(
session
,
frame
->
hd
.
stream_id
));
if
(
!
sd
)
{
return
;
return
0
;
}
if
(
sd
->
dconn
)
{
auto
downstream
=
sd
->
dconn
->
get_downstream
();
if
(
!
downstream
||
downstream
->
get_downstream_stream_id
()
!=
frame
->
hd
.
stream_id
)
{
return
;
return
0
;
}
downstream
->
set_response_state
(
Downstream
::
MSG_RESET
);
call_downstream_readcb
(
spdy
,
downstream
);
}
spdy
->
remove_stream_data
(
sd
);
}
return
0
;
}
}
// namespace
...
...
tests/nghttp2_session_test.c
View file @
b9d2f9b6
...
...
@@ -155,7 +155,7 @@ static int on_frame_send_callback(nghttp2_session *session,
return
0
;
}
static
void
on_frame_not_send_callback
(
nghttp2_session
*
session
,
static
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error
,
void
*
user_data
)
...
...
@@ -164,6 +164,7 @@ static void on_frame_not_send_callback(nghttp2_session *session,
++
ud
->
frame_not_send_cb_called
;
ud
->
not_sent_frame_type
=
frame
->
hd
.
type
;
ud
->
not_sent_error
=
lib_error
;
return
0
;
}
static
int
on_data_chunk_recv_callback
(
nghttp2_session
*
session
,
...
...
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