Move request buff to stack

Save 384 heap bytes by handling the web request buffering in the loop()
stack context.
This commit is contained in:
Earle F. Philhower, III committed 2017-12-14 09:47:00 -08:00
1 parent ec4979e6f5
commit 143c4e65ae
3 files changed
+7 -8

No files matched your search

+3 -2
View File
@@ -319,7 +319,7 @@ void loop()
if (decoder && decoder->isRunning()) {
strcpy_P(status, PSTR("Playing")); // By default we're OK unless the decoder says otherwise
if (!decoder->loop()) {
Serial.printf_P(PSTR("Stopping decoder"));
Serial.printf_P(PSTR("Stopping decoder\n"));
decoder->stop();
strcpy_P(title, PSTR("Stopped"));
}
@@ -330,7 +330,8 @@ void loop()
char *reqUrl;
char *params;
WiFiClient client = server.available();
if (client && WebReadRequest(&client, &reqUrl, &params)) {
char *reqBuff = (char *)alloca(384);
if (client && WebReadRequest(&client, reqBuff, 384, &reqUrl, &params)) {
Serial.printf_P(PSTR("URL: '%s'\n"), reqUrl);
if (IsIndexHTML(reqUrl)) {
HandleIndex(&client);