nghttpx, h2load: Perform write whenever read succeeds

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-28 19:00:59 +09:00
parent 3fd5d0af79
commit 6f58434d89
3 changed files with 10 additions and 15 deletions

View File

@ -143,10 +143,8 @@ void readcb(struct ev_loop *loop, ev_io *w, int revents) {
client->fail();
return;
}
if (ev_is_active(&client->wev)) {
writecb(loop, &client->wev, revents);
// client->disconnect() and client->fail() may be called
}
writecb(loop, &client->wev, revents);
// client->disconnect() and client->fail() may be called
}
} // namespace

View File

@ -81,11 +81,9 @@ void readcb(struct ev_loop *loop, ev_io *w, int revents) {
delete handler;
return;
}
if (ev_is_active(handler->get_wev())) {
if (handler->do_write() != 0) {
delete handler;
return;
}
if (handler->do_write() != 0) {
delete handler;
return;
}
}
} // namespace

View File

@ -116,12 +116,11 @@ void readcb(struct ev_loop *loop, ev_io *w, int revents) {
return;
}
http2session->connection_alive();
if (ev_is_active(http2session->get_wev())) {
rv = http2session->do_write();
if (rv != 0) {
http2session->disconnect(http2session->should_hard_fail());
return;
}
rv = http2session->do_write();
if (rv != 0) {
http2session->disconnect(http2session->should_hard_fail());
return;
}
}
} // namespace