mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +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) {
|
if(buff) {
|
||||||
// read all data from stream and send it to server
|
// 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
|
// get available data size
|
||||||
size_t s = stream->available();
|
size_t s = stream->available();
|
||||||
|
|
||||||
|
if(len) {
|
||||||
|
s = ((s > len) ? len : s);
|
||||||
|
}
|
||||||
|
|
||||||
if(s) {
|
if(s) {
|
||||||
int c = stream->readBytes(buff, ((s > buff_size) ? buff_size : s));
|
int c = stream->readBytes(buff, ((s > buff_size) ? buff_size : s));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user