Skip to content

Commit b0c6991

Browse files
committed
Small adjustments to the web server
1 parent 8afdd71 commit b0c6991

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

libraries/WebServer/src/Parsing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ uint8_t WebServer::_uploadReadByte(WiFiClient& client){
359359
int res = client.read();
360360
if(res == -1){
361361
while(!client.available() && client.connected())
362-
yield();
362+
delay(2);
363363
res = client.read();
364364
}
365365
return (uint8_t)res;

libraries/WebServer/src/WebServer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ WebServer::~WebServer() {
9494
void WebServer::begin() {
9595
close();
9696
_server.begin();
97+
_server.setNoDelay(true);
9798
}
9899

99100
void WebServer::begin(uint16_t port) {
100101
close();
101102
_server.begin(port);
103+
_server.setNoDelay(true);
102104
}
103105

104106
String WebServer::_extractParam(String& authReq,const String& param,const char delimit){

libraries/WebServer/src/WebServer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END,
3434
enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };
3535
enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
3636

37-
#define HTTP_DOWNLOAD_UNIT_SIZE 1460
37+
#define HTTP_DOWNLOAD_UNIT_SIZE 1436
3838

3939
#ifndef HTTP_UPLOAD_BUFLEN
40-
#define HTTP_UPLOAD_BUFLEN 2048
40+
#define HTTP_UPLOAD_BUFLEN 1436
4141
#endif
4242

4343
#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request

0 commit comments

Comments
 (0)