| 442 | } |
| 443 | |
| 444 | int 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 | |
| 472 | int HttpClient::read(uint8_t *buf, size_t size) |
| 473 | { |
nothing calls this directly
no outgoing calls
no test coverage detected