nghttpx, h2load: Perform write whenever read succeeds
This commit is contained in:
parent
3fd5d0af79
commit
6f58434d89
|
@ -143,11 +143,9 @@ 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
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Client::Client(Worker *worker, size_t req_todo)
|
||||
|
|
|
@ -81,13 +81,11 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -116,14 +116,13 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
|
|
Loading…
Reference in New Issue