| 620 | } |
| 621 | |
| 622 | void TClientConnection::OnPollEvent(TInstant now) { |
| 623 | THolder<TClientConnection> this_(this); |
| 624 | Activate(now); |
| 625 | |
| 626 | { |
| 627 | char tmp[1]; |
| 628 | |
| 629 | if (::recv(Socket_, tmp, 1, MSG_PEEK) < 1) { |
| 630 | /* |
| 631 | * We can received a FIN so our socket was moved to |
| 632 | * TCP_CLOSE_WAIT state. Check it before adding work |
| 633 | * for this socket. |
| 634 | */ |
| 635 | |
| 636 | return; |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | THolder<TClientRequest> obj(HttpServ_->CreateRequest(this_)); |
| 641 | AcceptMoment = now; |
| 642 | |
| 643 | HttpServ_->AddRequest(obj, Reject_); |
| 644 | } |
| 645 | |
| 646 | void TClientConnection::Activate(TInstant now) noexcept { |
| 647 | HttpServ_->Connections->Erase(this, now); |
no test coverage detected