nghttpx: Fix assertion error in libev ev_io_start

This commit is contained in:
Tatsuhiro Tsujikawa 2017-01-03 16:43:49 +09:00
parent fafccc4b98
commit 417321072f
1 changed files with 4 additions and 1 deletions

View File

@ -83,13 +83,16 @@ void RateLimit::regen() {
avail_ += rate_;
}
if (avail_ > 0 && startw_req_) {
if (w_->fd >= 0 && avail_ > 0 && startw_req_) {
ev_io_start(loop_, w_);
handle_tls_pending_read();
}
}
void RateLimit::startw() {
if (w_->fd < 0) {
return;
}
startw_req_ = true;
if (rate_ == 0 || avail_ > 0) {
ev_io_start(loop_, w_);