| 545 | } |
| 546 | |
| 547 | void HTTPRequest::waitClientClose() { |
| 548 | LogPrint("http-poll", "wait for connection close\n"); |
| 549 | |
| 550 | // wait at most 5 seconds for client to close |
| 551 | for (int i = 0; i < 10 && IsRPCRunning() && !isConnClosed(); i++) { |
| 552 | std::unique_lock<std::mutex> lock(cs); |
| 553 | closeCv.wait_for(lock, std::chrono::milliseconds(500)); |
| 554 | } |
| 555 | |
| 556 | if (isConnClosed()) { |
| 557 | LogPrint("http-poll", "wait for connection close, ok\n"); |
| 558 | } else if (!IsRPCRunning()) { |
| 559 | LogPrint("http-poll", "wait for connection close, RPC stopped\n"); |
| 560 | } else { |
| 561 | LogPrint("http-poll", "wait for connection close, timeout after 5 seconds\n"); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | void HTTPRequest::startDetectClientClose() { |
| 566 | LogPrint("http-poll", "start detect http connection close\n"); |
nothing calls this directly
no test coverage detected