fix empty reply from server error (#2903)
The flush causes an empty response a client side. see https://github.com/espressif/arduino-esp32/issues/2902
This commit is contained in:
parent
b0d8d4dd44
commit
c13d11e7d1
@ -96,7 +96,6 @@ void loop(void)
|
|||||||
req = req.substring(addr_start + 1, addr_end);
|
req = req.substring(addr_start + 1, addr_end);
|
||||||
Serial.print("Request: ");
|
Serial.print("Request: ");
|
||||||
Serial.println(req);
|
Serial.println(req);
|
||||||
client.flush();
|
|
||||||
|
|
||||||
String s;
|
String s;
|
||||||
if (req == "/")
|
if (req == "/")
|
||||||
@ -115,6 +114,7 @@ void loop(void)
|
|||||||
}
|
}
|
||||||
client.print(s);
|
client.print(s);
|
||||||
|
|
||||||
|
client.stop();
|
||||||
Serial.println("Done with client");
|
Serial.println("Done with client");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user