* Poll and process the HTTP request/response. * * @return True iff the request is done; no call to Receive() should be done after it returns true. */
| 264 | * @return True iff the request is done; no call to Receive() should be done after it returns true. |
| 265 | */ |
| 266 | bool NetworkHTTPRequest::Receive() |
| 267 | { |
| 268 | if (this->callback.cancelled && !this->finished) { |
| 269 | Debug(net, 1, "HTTP request failed: cancelled by user"); |
| 270 | this->callback.OnFailure(); |
| 271 | this->finished = true; |
| 272 | /* Fall-through, as we are waiting for IsQueueEmpty() to happen. */ |
| 273 | } |
| 274 | |
| 275 | return this->finished && this->callback.IsQueueEmpty(); |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * Destructor of the HTTP request. |
no test coverage detected