| 399 | } |
| 400 | |
| 401 | int HttpClient::skipResponseHeaders() |
| 402 | { |
| 403 | // Just keep reading until we finish reading the headers or time out |
| 404 | unsigned long timeoutStart = millis(); |
| 405 | // Whilst we haven't timed out & haven't reached the end of the headers |
| 406 | while ((!endOfHeadersReached()) && |
| 407 | ( (millis() - timeoutStart) < iHttpResponseTimeout )) |
| 408 | { |
| 409 | if (available()) |
| 410 | { |
| 411 | (void)readHeader(); |
| 412 | // We read something, reset the timeout counter |
| 413 | timeoutStart = millis(); |
| 414 | } |
| 415 | else |
| 416 | { |
| 417 | // We haven't got any data, so let's pause to allow some to |
| 418 | // arrive |
| 419 | delay(kHttpWaitForDataDelay); |
| 420 | } |
| 421 | } |
| 422 | if (endOfHeadersReached()) |
| 423 | { |
| 424 | // Success |
| 425 | return HTTP_SUCCESS; |
| 426 | } |
| 427 | else |
| 428 | { |
| 429 | // We must've timed out |
| 430 | return HTTP_ERROR_TIMED_OUT; |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | bool HttpClient::endOfBodyReached() |
| 435 | { |
nothing calls this directly
no outgoing calls
no test coverage detected