1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

Merge branch 'master' into patch-1

This commit is contained in:
Alex Potsides
2016-04-26 14:17:35 +01:00
3 changed files with 14 additions and 1 deletions

View File

@ -33,6 +33,10 @@
class TransportTraits
{
public:
virtual ~TransportTraits()
{
}
virtual std::unique_ptr<WiFiClient> create()
{
return std::unique_ptr<WiFiClient>(new WiFiClient());
@ -624,6 +628,13 @@ int HTTPClient::writeToStream(Stream * stream)
break;
}
// read trailing \r\n at the end of the chunk
char buf[2];
auto trailing_seq_len = _tcp->readBytes((uint8_t*)buf, 2);
if (trailing_seq_len != 2 || buf[0] != '\r' || buf[1] != '\n') {
return returnError(HTTPC_ERROR_READ_TIMEOUT);
}
delay(0);
}
} else {

View File

@ -213,7 +213,7 @@ public:
return size;
}
char peek()
int peek()
{
if (!_rx_buf || _rx_buf_offset == _rx_buf->len)
return -1;