Small adjustments to the web server

This commit is contained in:
me-no-dev 2018-07-05 22:31:19 +02:00
parent 8afdd71b3a
commit b0c6991bcf
3 changed files with 5 additions and 3 deletions

View File

@ -359,7 +359,7 @@ uint8_t WebServer::_uploadReadByte(WiFiClient& client){
int res = client.read(); int res = client.read();
if(res == -1){ if(res == -1){
while(!client.available() && client.connected()) while(!client.available() && client.connected())
yield(); delay(2);
res = client.read(); res = client.read();
} }
return (uint8_t)res; return (uint8_t)res;

View File

@ -94,11 +94,13 @@ WebServer::~WebServer() {
void WebServer::begin() { void WebServer::begin() {
close(); close();
_server.begin(); _server.begin();
_server.setNoDelay(true);
} }
void WebServer::begin(uint16_t port) { void WebServer::begin(uint16_t port) {
close(); close();
_server.begin(port); _server.begin(port);
_server.setNoDelay(true);
} }
String WebServer::_extractParam(String& authReq,const String& param,const char delimit){ String WebServer::_extractParam(String& authReq,const String& param,const char delimit){

View File

@ -34,10 +34,10 @@ enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END,
enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE }; enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };
enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH }; enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
#define HTTP_DOWNLOAD_UNIT_SIZE 1460 #define HTTP_DOWNLOAD_UNIT_SIZE 1436
#ifndef HTTP_UPLOAD_BUFLEN #ifndef HTTP_UPLOAD_BUFLEN
#define HTTP_UPLOAD_BUFLEN 2048 #define HTTP_UPLOAD_BUFLEN 1436
#endif #endif
#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request #define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request