mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Merge pull request #1290 from Links2004/httpClient
http client allow slow streams for sendRequest
This commit is contained in:
commit
dd93ea26ee
@ -354,11 +354,15 @@ int HTTPClient::sendRequest(const char * type, Stream * stream, size_t size) {
|
||||
|
||||
if(buff) {
|
||||
// read all data from stream and send it to server
|
||||
while(connected() && stream->available() && (len > 0 || len == -1)) {
|
||||
while(connected() && (stream->available() > -1) && (len > 0 || len == -1)) {
|
||||
|
||||
// get available data size
|
||||
size_t s = stream->available();
|
||||
|
||||
if(len) {
|
||||
s = ((s > len) ? len : s);
|
||||
}
|
||||
|
||||
if(s) {
|
||||
int c = stream->readBytes(buff, ((s > buff_size) ? buff_size : s));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user