diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 3ce4c16de..2733e12e1 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -33,6 +33,10 @@ class TransportTraits { public: + virtual ~TransportTraits() + { + } + virtual std::unique_ptr create() { return std::unique_ptr(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 { diff --git a/libraries/ESP8266WiFi/src/include/UdpContext.h b/libraries/ESP8266WiFi/src/include/UdpContext.h index f3b58f87e..c367492cd 100644 --- a/libraries/ESP8266WiFi/src/include/UdpContext.h +++ b/libraries/ESP8266WiFi/src/include/UdpContext.h @@ -213,7 +213,7 @@ public: return size; } - char peek() + int peek() { if (!_rx_buf || _rx_buf_offset == _rx_buf->len) return -1; diff --git a/tools/sdk/ld/eagle.app.v6.common.ld b/tools/sdk/ld/eagle.app.v6.common.ld index c731ece35..90d9fc18c 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld +++ b/tools/sdk/ld/eagle.app.v6.common.ld @@ -78,6 +78,8 @@ SECTIONS *(.sdata2.*) *(.gnu.linkonce.s2.*) *(.jcr) + . = ALIGN(4); + _Pri_3_HandlerAddress = ABSOLUTE(.); _data_end = ABSOLUTE(.); } >dram0_0_seg :dram0_0_phdr