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
5fdadc48
Commit
5fdadc48
authored
Jan 28, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flush after printf(). Added user-agent. Add cond (want_read and want_write) to event-loop
parent
31aff016
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
examples/spdycl.cc
examples/spdycl.cc
+10
-1
No files found.
examples/spdycl.cc
View file @
5fdadc48
...
...
@@ -153,6 +153,7 @@ public:
"method"
,
"GET"
,
"scheme"
,
"https"
,
"url"
,
path
,
"user-agent"
,
"spdylay/0.0.0"
,
"version"
,
"HTTP/1.1"
,
NULL
};
...
...
@@ -237,6 +238,7 @@ void on_ctrl_recv_callback
default:
break
;
}
fflush
(
stdout
);
}
void
on_data_chunk_recv_callback
...
...
@@ -250,6 +252,10 @@ void on_data_recv_callback
{
printf
(
"recv DATA frame (stream_id=%d, flags=%d, length=%d)
\n
"
,
stream_id
,
flags
,
length
);
if
(
flags
&
SPDYLAY_FLAG_FIN
)
{
spdylay_submit_goaway
(
session
);
}
fflush
(
stdout
);
}
void
on_ctrl_send_callback
...
...
@@ -264,9 +270,12 @@ void on_ctrl_send_callback
frame
->
syn_stream
.
hd
.
length
);
print_nv
(
frame
->
syn_stream
.
nv
);
break
;
case
SPDYLAY_GOAWAY
:
printf
(
"(last_good_stream_id=%d)
\n
"
,
frame
->
goaway
.
last_good_stream_id
);
default:
break
;
}
fflush
(
stdout
);
}
void
ctl_epollev
(
int
epollfd
,
int
op
,
SpdylayClient
&
sc
)
...
...
@@ -372,7 +381,7 @@ int communicate(const char *host, const char *service, const char *path,
static
const
size_t
MAX_EVENTS
=
1
;
epoll_event
events
[
MAX_EVENTS
];
bool
ok
=
true
;
while
(
1
)
{
while
(
sc
.
want_read
()
||
sc
.
want_write
()
)
{
int
nfds
=
epoll_wait
(
epollfd
,
events
,
MAX_EVENTS
,
-
1
);
if
(
nfds
==
-
1
)
{
perror
(
"epoll_wait"
);
...
...
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