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
db498a76
Commit
db498a76
authored
Feb 02, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettify verbose output
parent
56227819
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
19 deletions
+35
-19
examples/spdylay_ssl.cc
examples/spdylay_ssl.cc
+35
-19
No files found.
examples/spdylay_ssl.cc
View file @
db498a76
...
...
@@ -218,11 +218,19 @@ const char *ctrl_names[] = {
};
}
// namespace
namespace
{
void
print_frame_attr_indent
()
{
printf
(
" "
);
}
}
// namespace
void
print_nv
(
char
**
nv
)
{
int
i
;
for
(
i
=
0
;
nv
[
i
];
i
+=
2
)
{
printf
(
" %s: %s
\n
"
,
nv
[
i
],
nv
[
i
+
1
]);
print_frame_attr_indent
();
printf
(
"%s: %s
\n
"
,
nv
[
i
],
nv
[
i
+
1
]);
}
}
...
...
@@ -233,49 +241,57 @@ void print_timer()
printf
(
"[%3ld.%03ld]"
,
tv
.
tv_sec
,
tv
.
tv_usec
/
1000
);
}
namespace
{
void
print_ctrl_hd
(
const
spdylay_ctrl_hd
&
hd
)
{
printf
(
"<version=%u, flags=%u, length=%d>
\n
"
,
hd
.
version
,
hd
.
flags
,
hd
.
length
);
}
}
// namespace
void
print_frame
(
spdylay_frame_type
type
,
spdylay_frame
*
frame
)
{
printf
(
"%s frame "
,
ctrl_names
[
type
-
1
]);
print_ctrl_hd
(
frame
->
syn_stream
.
hd
);
switch
(
type
)
{
case
SPDYLAY_SYN_STREAM
:
printf
(
"(stream_id=%d, assoc_stream_id=%d, flags=%u, length=%d, pri=%u)
\n
"
,
print_frame_attr_indent
();
printf
(
"(stream_id=%d, assoc_stream_id=%d, pri=%u)
\n
"
,
frame
->
syn_stream
.
stream_id
,
frame
->
syn_stream
.
assoc_stream_id
,
frame
->
syn_stream
.
hd
.
flags
,
frame
->
syn_stream
.
hd
.
length
,
frame
->
syn_stream
.
pri
);
frame
->
syn_stream
.
pri
);
print_nv
(
frame
->
syn_stream
.
nv
);
break
;
case
SPDYLAY_SYN_REPLY
:
printf
(
"(stream_id=%d, flags=%u, length=%d)
\n
"
,
frame
->
syn_reply
.
stream_id
,
frame
->
syn_reply
.
hd
.
flags
,
frame
->
syn_reply
.
hd
.
length
);
print_frame_attr_indent
();
printf
(
"(stream_id=%d)
\n
"
,
frame
->
syn_reply
.
stream_id
);
print_nv
(
frame
->
syn_reply
.
nv
);
break
;
case
SPDYLAY_RST_STREAM
:
printf
(
"(stream_id=%d, status_code=%u, flags=%u, length=%d)
\n
"
,
frame
->
rst_stream
.
stream_id
,
frame
->
rst_stream
.
status_code
,
frame
->
rst_stream
.
hd
.
flags
,
frame
->
rst_stream
.
hd
.
length
);
print_frame_attr_indent
();
printf
(
"(stream_id=%d, status_code=%u)
\n
"
,
frame
->
rst_stream
.
stream_id
,
frame
->
rst_stream
.
status_code
);
break
;
case
SPDYLAY_SETTINGS
:
printf
(
"(flags=%u, length=%d, niv=%lu)
\n
"
,
frame
->
settings
.
hd
.
flags
,
frame
->
settings
.
hd
.
length
,
static_cast
<
unsigned
long
>
(
frame
->
settings
.
niv
));
print_frame_attr_indent
();
printf
(
"(niv=%lu)
\n
"
,
static_cast
<
unsigned
long
>
(
frame
->
settings
.
niv
));
for
(
size_t
i
=
0
;
i
<
frame
->
settings
.
niv
;
++
i
)
{
printf
(
" [%d(%u):%u]
\n
"
,
print_frame_attr_indent
();
printf
(
"[%d(%u):%u]
\n
"
,
frame
->
settings
.
iv
[
i
].
settings_id
,
frame
->
settings
.
iv
[
i
].
flags
,
frame
->
settings
.
iv
[
i
].
value
);
}
break
;
case
SPDYLAY_PING
:
print_frame_attr_indent
();
printf
(
"(unique_id=%d)
\n
"
,
frame
->
ping
.
unique_id
);
break
;
case
SPDYLAY_GOAWAY
:
print_frame_attr_indent
();
printf
(
"(last_good_stream_id=%d)
\n
"
,
frame
->
goaway
.
last_good_stream_id
);
break
;
case
SPDYLAY_HEADERS
:
printf
(
"(stream_id=%d, flags=%u, length=%d)
\n
"
,
frame
->
headers
.
stream_id
,
frame
->
headers
.
hd
.
flags
,
frame
->
headers
.
hd
.
length
);
print_frame_attr_indent
();
printf
(
"(stream_id=%d)
\n
"
,
frame
->
headers
.
stream_id
);
print_nv
(
frame
->
headers
.
nv
);
break
;
default:
...
...
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