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
59286adc
Commit
59286adc
authored
Aug 29, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add int return value to nghttp2_on_unknown_frame_recv_callback
parent
db4f5195
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
18 deletions
+28
-18
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+6
-1
lib/nghttp2_session.c
lib/nghttp2_session.c
+9
-7
src/app_helper.cc
src/app_helper.cc
+2
-1
src/app_helper.h
src/app_helper.h
+1
-1
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+5
-4
src/shrpx_spdy_session.cc
src/shrpx_spdy_session.cc
+5
-4
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
59286adc
...
@@ -972,8 +972,13 @@ typedef int (*nghttp2_on_frame_recv_parse_error_callback)
...
@@ -972,8 +972,13 @@ typedef int (*nghttp2_on_frame_recv_parse_error_callback)
* first 8 bytes of the received frame. The |payload| is the pointer
* first 8 bytes of the received frame. The |payload| is the pointer
* to the data portion of the received frame. The |payloadlen| is the
* to the data portion of the received frame. The |payloadlen| is the
* length of the |payload|. This is the data after the length field.
* length of the |payload|. This is the data after the length field.
*
* 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_unknown_frame_recv_callback
)
typedef
int
(
*
nghttp2_on_unknown_frame_recv_callback
)
(
nghttp2_session
*
session
,
(
nghttp2_session
*
session
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
...
...
lib/nghttp2_session.c
View file @
59286adc
...
@@ -2669,13 +2669,15 @@ static int nghttp2_session_process_ctrl_frame(nghttp2_session *session)
...
@@ -2669,13 +2669,15 @@ static int nghttp2_session_process_ctrl_frame(nghttp2_session *session)
default:
default:
/* Unknown frame */
/* Unknown frame */
if
(
session
->
callbacks
.
on_unknown_frame_recv_callback
)
{
if
(
session
->
callbacks
.
on_unknown_frame_recv_callback
)
{
session
->
callbacks
.
on_unknown_frame_recv_callback
if
(
session
->
callbacks
.
on_unknown_frame_recv_callback
(
session
,
(
session
,
session
->
iframe
.
headbuf
,
session
->
iframe
.
headbuf
,
sizeof
(
session
->
iframe
.
headbuf
),
sizeof
(
session
->
iframe
.
headbuf
),
session
->
iframe
.
buf
,
session
->
iframe
.
buf
,
session
->
iframe
.
buflen
,
session
->
iframe
.
buflen
,
session
->
user_data
);
session
->
user_data
)
!=
0
)
{
r
=
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
}
}
}
}
if
(
nghttp2_is_fatal
(
r
))
{
if
(
nghttp2_is_fatal
(
r
))
{
...
...
src/app_helper.cc
View file @
59286adc
...
@@ -377,7 +377,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
...
@@ -377,7 +377,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
return
0
;
return
0
;
}
}
void
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
int
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
const
uint8_t
*
head
,
const
uint8_t
*
head
,
size_t
headlen
,
size_t
headlen
,
const
uint8_t
*
payload
,
const
uint8_t
*
payload
,
...
@@ -388,6 +388,7 @@ void on_unknown_frame_recv_callback(nghttp2_session *session,
...
@@ -388,6 +388,7 @@ void on_unknown_frame_recv_callback(nghttp2_session *session,
printf
(
" recv unknown frame
\n
"
);
printf
(
" recv unknown frame
\n
"
);
dump_header
(
head
,
headlen
);
dump_header
(
head
,
headlen
);
fflush
(
stdout
);
fflush
(
stdout
);
return
0
;
}
}
int
on_frame_send_callback
int
on_frame_send_callback
...
...
src/app_helper.h
View file @
59286adc
...
@@ -54,7 +54,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
...
@@ -54,7 +54,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
size_t
payloadlen
,
size_t
payloadlen
,
int
error_code
,
void
*
user_data
);
int
error_code
,
void
*
user_data
);
void
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
int
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
const
uint8_t
*
head
,
const
uint8_t
*
head
,
size_t
headlen
,
size_t
headlen
,
const
uint8_t
*
payload
,
const
uint8_t
*
payload
,
...
...
src/shrpx_http2_upstream.cc
View file @
59286adc
...
@@ -373,15 +373,16 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
...
@@ -373,15 +373,16 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
}
// namespace
}
// namespace
namespace
{
namespace
{
void
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
int
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
void
*
user_data
)
void
*
user_data
)
{
{
auto
upstream
=
reinterpret_cast
<
Http2Upstream
*>
(
user_data
);
auto
upstream
=
reinterpret_cast
<
Http2Upstream
*>
(
user_data
);
if
(
LOG_ENABLED
(
INFO
))
{
if
(
LOG_ENABLED
(
INFO
))
{
ULOG
(
INFO
,
upstream
)
<<
"Received unknown control frame."
;
ULOG
(
INFO
,
upstream
)
<<
"Received unknown control frame."
;
}
}
return
0
;
}
}
}
// namespace
}
// namespace
...
...
src/shrpx_spdy_session.cc
View file @
59286adc
...
@@ -1024,15 +1024,16 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
...
@@ -1024,15 +1024,16 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
}
// namespace
}
// namespace
namespace
{
namespace
{
void
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
int
on_unknown_frame_recv_callback
(
nghttp2_session
*
session
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
head
,
size_t
headlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
const
uint8_t
*
payload
,
size_t
payloadlen
,
void
*
user_data
)
void
*
user_data
)
{
{
auto
spdy
=
reinterpret_cast
<
SpdySession
*>
(
user_data
);
auto
spdy
=
reinterpret_cast
<
SpdySession
*>
(
user_data
);
if
(
LOG_ENABLED
(
INFO
))
{
if
(
LOG_ENABLED
(
INFO
))
{
SSLOG
(
INFO
,
spdy
)
<<
"Received unknown control frame"
;
SSLOG
(
INFO
,
spdy
)
<<
"Received unknown control frame"
;
}
}
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