| 58 | } |
| 59 | |
| 60 | void forceClose() { |
| 61 | if (started_) { |
| 62 | // lock shouldn't be needed here as call paths currently guarantee |
| 63 | // flow, but we should be safe anyway. |
| 64 | std::lock_guard<std::mutex> lock(mutex_); |
| 65 | close(); |
| 66 | http_client_->forceClose(); |
| 67 | if (http_client_future_.valid()) { |
| 68 | http_client_future_.get(); |
| 69 | } else { |
| 70 | logger_->log_warn("Future status already cleared for %s, continuing", http_client_->getURL()); |
| 71 | } |
| 72 | |
| 73 | started_ = false; |
| 74 | } |
| 75 | } |
| 76 | /** |
| 77 | * Skip to the specified offset. |
| 78 | * @param offset offset to which we will skip |