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
02a7182e
Commit
02a7182e
authored
Aug 10, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Create strframetype to handle unknown frame types
parent
47c14470
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
src/app_helper.cc
src/app_helper.cc
+26
-13
No files found.
src/app_helper.cc
View file @
02a7182e
...
...
@@ -91,17 +91,30 @@ const char* strsettingsid(int32_t id)
}
// namespace
namespace
{
const
char
*
frame_names
[]
=
{
"DATA"
,
"HEADERS"
,
"PRIORITY"
,
"RST_STREAM"
,
"SETTINGS"
,
"PUSH_PROMISE"
,
"PING"
,
"GOAWAY"
,
"UNKNOWN"
,
"WINDOW_UPDATE"
const
char
*
strframetype
(
uint8_t
type
)
{
switch
(
type
)
{
case
NGHTTP2_DATA
:
return
"DATA"
;
case
NGHTTP2_HEADERS
:
return
"HEADERS"
;
case
NGHTTP2_PRIORITY
:
return
"PRIORITY"
;
case
NGHTTP2_RST_STREAM
:
return
"RST_STREAM"
;
case
NGHTTP2_SETTINGS
:
return
"SETTINGS"
;
case
NGHTTP2_PUSH_PROMISE
:
return
"PUSH_PROMISE"
;
case
NGHTTP2_PING
:
return
"PING"
;
case
NGHTTP2_GOAWAY
:
return
"GOAWAY"
;
case
NGHTTP2_WINDOW_UPDATE
:
return
"WINDOW_UPDATE"
;
default:
return
"UNKNOWN"
;
}
};
}
// namespace
...
...
@@ -231,7 +244,7 @@ void print_frame(print_type ptype, nghttp2_frame *frame)
{
printf
(
"%s%s%s frame "
,
frame_name_ansi_esc
(
ptype
),
frame_names
[
frame
->
hd
.
type
]
,
strframetype
(
frame
->
hd
.
type
)
,
ansi_escend
());
print_frame_hd
(
frame
->
hd
);
if
(
frame
->
hd
.
flags
)
{
...
...
@@ -357,7 +370,7 @@ void on_frame_recv_parse_error_callback(nghttp2_session *session,
print_timer
();
printf
(
" [PARSE_ERROR] recv %s%s%s frame
\n
"
,
frame_name_ansi_esc
(
PRINT_RECV
),
frame_names
[
type
]
,
strframetype
(
type
)
,
ansi_escend
());
print_frame_attr_indent
();
printf
(
"Error: %s
\n
"
,
nghttp2_strerror
(
error_code
));
...
...
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