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

Method read

HttpClient.cpp:444–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444int HttpClient::read()
445{
446#if 0 // Fails on WiFi because multi-byte read seems to be broken
447 uint8_t b[1];
448 int ret = read(b, 1);
449 if (ret == 1)
450 {
451 return b[0];
452 }
453 else
454 {
455 return -1;
456 }
457#else
458 int ret = iClient->read();
459 if (ret >= 0)
460 {
461 if (endOfHeadersReached() && iContentLength > 0)
462 {
463 // We're outputting the body now and we've seen a Content-Length header
464 // So keep track of how many bytes are left
465 iBodyLengthConsumed++;
466 }
467 }
468 return ret;
469#endif
470}
471
472int HttpClient::read(uint8_t *buf, size_t size)
473{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected