nghttpx, h2load: Perform write whenever read succeeds
This commit is contained in:
parent
3fd5d0af79
commit
6f58434d89
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue