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
5da38b22
Commit
5da38b22
authored
Mar 02, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Fix bug that it did not try to connect to server again
parent
ce61f626
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
src/h2load.cc
src/h2load.cc
+13
-3
src/h2load.h
src/h2load.h
+6
-0
No files found.
src/h2load.cc
View file @
5da38b22
...
...
@@ -202,7 +202,9 @@ void readcb(struct ev_loop *loop, ev_io *w, int revents) {
auto
client
=
static_cast
<
Client
*>
(
w
->
data
);
client
->
restart_timeout
();
if
(
client
->
do_read
()
!=
0
)
{
client
->
fail
();
if
(
client
->
try_again_or_fail
()
==
0
)
{
return
;
}
delete
client
;
return
;
}
...
...
@@ -453,7 +455,7 @@ void Client::restart_timeout() {
}
}
void
Client
::
fail
()
{
int
Client
::
try_again_or_
fail
()
{
disconnect
();
if
(
new_connection_requested
)
{
...
...
@@ -471,13 +473,21 @@ void Client::fail() {
// Keep using current address
if
(
connect
()
==
0
)
{
return
;
return
0
;
}
std
::
cerr
<<
"client could not connect to host"
<<
std
::
endl
;
}
}
process_abandoned_streams
();
return
-
1
;
}
void
Client
::
fail
()
{
disconnect
();
process_abandoned_streams
();
}
void
Client
::
disconnect
()
{
...
...
src/h2load.h
View file @
5da38b22
...
...
@@ -307,6 +307,12 @@ struct Client {
int
connect
();
void
disconnect
();
void
fail
();
// Call this function when do_read() returns -1. This function
// tries to connect to the remote host again if it is requested. If
// so, this function returns 0, and this object should be retained.
// Otherwise, this function returns -1, and this object should be
// deleted.
int
try_again_or_fail
();
void
timeout
();
void
restart_timeout
();
int
submit_request
();
...
...
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