mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-07 16:23:38 +03:00
Update Parsing.cpp
This commit is contained in:
parent
8c675236c7
commit
3a95fb5a94
@ -138,7 +138,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
|
|||||||
|
|
||||||
if (!isForm){
|
if (!isForm){
|
||||||
if (searchStr != "") searchStr += '&';
|
if (searchStr != "") searchStr += '&';
|
||||||
char *plainBuf = NULL;
|
char *plainBuf = nullptr;
|
||||||
size_t plainLen = 0;
|
size_t plainLen = 0;
|
||||||
while ( (plainLen == 0) || (plainLen < contentLength))
|
while ( (plainLen == 0) || (plainLen < contentLength))
|
||||||
{
|
{
|
||||||
@ -148,7 +148,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
|
|||||||
while(!client.available() && tries--)delay(1);
|
while(!client.available() && tries--)delay(1);
|
||||||
size_t newLen = client.available();
|
size_t newLen = client.available();
|
||||||
if (!newLen) break;
|
if (!newLen) break;
|
||||||
plainBuf = (plainBuf == NULL) ? (char *) malloc(newLen + 1) : (char *) realloc(plainBuf, plainLen + newLen + 1);
|
plainBuf = (plainBuf == nullptr) ? (char *) malloc(newLen + 1) : (char *) realloc(plainBuf, plainLen + newLen + 1);
|
||||||
client.readBytes(&plainBuf[plainLen], newLen);
|
client.readBytes(&plainBuf[plainLen], newLen);
|
||||||
plainLen += newLen;
|
plainLen += newLen;
|
||||||
plainBuf[plainLen] = '\0';
|
plainBuf[plainLen] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user