MCPcopy Create free account
hub / github.com/amcewen/HttpClient / skipResponseHeaders

Method skipResponseHeaders

HttpClient.cpp:401–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401int 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
434bool HttpClient::endOfBodyReached()
435{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected