mirror of https://github.com/arendst/Tasmota.git
Gain a little code space on WebSend response
Gain a little code space on WebSend response
This commit is contained in:
parent
cae714e300
commit
7d690dcc1b
|
@ -2401,10 +2401,11 @@ int WebSend(char *buffer)
|
||||||
if (http_code == HTTP_CODE_OK || http_code == HTTP_CODE_MOVED_PERMANENTLY) {
|
if (http_code == HTTP_CODE_OK || http_code == HTTP_CODE_MOVED_PERMANENTLY) {
|
||||||
#ifdef USE_WEBSEND_RESPONSE
|
#ifdef USE_WEBSEND_RESPONSE
|
||||||
// Return received data to the user - Adds 900+ bytes to the code
|
// Return received data to the user - Adds 900+ bytes to the code
|
||||||
String result = http.getString(); // File found at server - may need lot of ram or trigger out of memory!
|
const char* read = http.getString().c_str(); // File found at server - may need lot of ram or trigger out of memory!
|
||||||
uint32_t j = 0;
|
uint32_t j = 0;
|
||||||
for (uint32_t i = 0; i < result.length(); i++) {
|
char text = '.';
|
||||||
char text = result.charAt(i);
|
while (text != '\0') {
|
||||||
|
text = *read++;
|
||||||
if (text > 31) { // Remove control characters like linefeed
|
if (text > 31) { // Remove control characters like linefeed
|
||||||
mqtt_data[j++] = text;
|
mqtt_data[j++] = text;
|
||||||
if (j == sizeof(mqtt_data) -2) { break; }
|
if (j == sizeof(mqtt_data) -2) { break; }
|
||||||
|
|
Loading…
Reference in New Issue