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
a51cdaac
Commit
a51cdaac
authored
Aug 29, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add int return value to nghttp2_before_frame_send_callback
parent
544ac9f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+6
-1
lib/nghttp2_session.c
lib/nghttp2_session.c
+6
-4
src/shrpx_spdy_session.cc
src/shrpx_spdy_session.cc
+5
-4
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
a51cdaac
...
@@ -850,8 +850,13 @@ typedef int (*nghttp2_on_data_recv_callback)
...
@@ -850,8 +850,13 @@ typedef int (*nghttp2_on_data_recv_callback)
* HEADERS and PUSH_PROMISE frame (see also
* HEADERS and PUSH_PROMISE frame (see also
* `nghttp2_session_get_stream_user_data()`), which is not assigned
* `nghttp2_session_get_stream_user_data()`), which is not assigned
* when it was queued.
* when it was queued.
*
* 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_before_frame_send_callback
)
typedef
int
(
*
nghttp2_before_frame_send_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
/**
/**
...
...
lib/nghttp2_session.c
View file @
a51cdaac
...
@@ -1496,10 +1496,12 @@ int nghttp2_session_send(nghttp2_session *session)
...
@@ -1496,10 +1496,12 @@ int nghttp2_session_send(nghttp2_session *session)
/* Call before_send callback */
/* Call before_send callback */
if
(
item
->
frame_cat
==
NGHTTP2_CAT_CTRL
&&
if
(
item
->
frame_cat
==
NGHTTP2_CAT_CTRL
&&
session
->
callbacks
.
before_frame_send_callback
)
{
session
->
callbacks
.
before_frame_send_callback
)
{
session
->
callbacks
.
before_frame_send_callback
if
(
session
->
callbacks
.
before_frame_send_callback
(
session
,
(
session
,
nghttp2_outbound_item_get_ctrl_frame
(
item
),
nghttp2_outbound_item_get_ctrl_frame
(
item
),
session
->
user_data
);
session
->
user_data
)
!=
0
)
{
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
}
}
}
}
data
=
session
->
aob
.
framebuf
+
session
->
aob
.
framebufoff
;
data
=
session
->
aob
.
framebuf
+
session
->
aob
.
framebufoff
;
...
...
src/shrpx_spdy_session.cc
View file @
a51cdaac
...
@@ -945,9 +945,9 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
...
@@ -945,9 +945,9 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
}
// namespace
}
// namespace
namespace
{
namespace
{
void
before_frame_send_callback
(
nghttp2_session
*
session
,
int
before_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
nghttp2_frame
*
frame
,
void
*
user_data
)
void
*
user_data
)
{
{
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
frame
->
headers
.
cat
==
NGHTTP2_HCAT_REQUEST
)
{
frame
->
headers
.
cat
==
NGHTTP2_HCAT_REQUEST
)
{
...
@@ -956,7 +956,7 @@ void before_frame_send_callback(nghttp2_session *session,
...
@@ -956,7 +956,7 @@ void before_frame_send_callback(nghttp2_session *session,
if
(
!
sd
||
!
sd
->
dconn
)
{
if
(
!
sd
||
!
sd
->
dconn
)
{
nghttp2_submit_rst_stream
(
session
,
frame
->
hd
.
stream_id
,
nghttp2_submit_rst_stream
(
session
,
frame
->
hd
.
stream_id
,
NGHTTP2_CANCEL
);
NGHTTP2_CANCEL
);
return
;
return
0
;
}
}
auto
downstream
=
sd
->
dconn
->
get_downstream
();
auto
downstream
=
sd
->
dconn
->
get_downstream
();
if
(
downstream
)
{
if
(
downstream
)
{
...
@@ -965,6 +965,7 @@ void before_frame_send_callback(nghttp2_session *session,
...
@@ -965,6 +965,7 @@ void before_frame_send_callback(nghttp2_session *session,
nghttp2_submit_rst_stream
(
session
,
frame
->
hd
.
stream_id
,
NGHTTP2_CANCEL
);
nghttp2_submit_rst_stream
(
session
,
frame
->
hd
.
stream_id
,
NGHTTP2_CANCEL
);
}
}
}
}
return
0
;
}
}
}
// namespace
}
// namespace
...
...
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