Skip to content

Commit ecacea3

Browse files
committed
Update syncwebserver.cpp
small adjustments
1 parent 732b3e7 commit ecacea3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

esp3d/syncwebserver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ void SPIFFSFileupload()
610610
if (auth_level == LEVEL_GUEST) {
611611
web_interface->_upload_status=UPLOAD_STATUS_FAILED;
612612
ESPCOM::println (F ("Upload rejected"), PRINTER_PIPE);
613-
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected");
613+
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected", 401);
614614
} else {
615615
//get current file ID
616616
HTTPUpload& upload = (web_interface->web_server).upload();
@@ -724,7 +724,7 @@ void WebUpdateUpload()
724724
web_interface->_upload_status=UPLOAD_STATUS_FAILED;
725725
ESPCOM::println (F ("Update failed"), PRINTER_PIPE);
726726
LOG("Web Update failed\r\n");
727-
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected");
727+
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected",401);
728728
} else {
729729
//get current file ID
730730
HTTPUpload& upload = (web_interface->web_server).upload();
@@ -1232,7 +1232,7 @@ void handle_serial_SDFileList()
12321232
}
12331233

12341234
#define NB_RETRY 5
1235-
#define MAX_RESEND_BUFFER 128
1235+
#define MAX_RESEND_BUFFER 228
12361236
#define SERIAL_CHECK_TIMEOUT 2000
12371237
//SD file upload by serial
12381238
void SDFile_serial_upload()
@@ -1246,7 +1246,7 @@ void SDFile_serial_upload()
12461246
if(web_interface->is_authenticated() == LEVEL_GUEST) {
12471247
web_interface->_upload_status=UPLOAD_STATUS_FAILED;
12481248
ESPCOM::println (F ("SD upload rejected"), PRINTER_PIPE);
1249-
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected");
1249+
pushError(ESP_ERROR_AUTHENTICATION, "Upload rejected", 401);
12501250
LOG("SD upload rejected\r\n");
12511251
} else {
12521252
//retrieve current file id
@@ -1337,7 +1337,7 @@ void SDFile_serial_upload()
13371337
//if comment line then reset
13381338
is_comment = false;
13391339
//does line fit the buffer ?
1340-
if (current_line.length() < 126) {
1340+
if (current_line.length() < MAX_RESEND_BUFFER) {
13411341
//do we have something in buffer ?
13421342
if (current_line.length() > 0 ) {
13431343
lineNb++;
@@ -1361,7 +1361,7 @@ void SDFile_serial_upload()
13611361
pushError(ESP_ERROR_BUFFER_OVERFLOW, "Error buffer overflow");
13621362
}
13631363
} else if (!is_comment) {
1364-
if (current_line.length() < 126) {
1364+
if (current_line.length() < MAX_RESEND_BUFFER) {
13651365
current_line += char (upload.buf[pos]); //copy current char to buffer to send/resend
13661366
} else {
13671367
LOG ("Error over buffer\n")

0 commit comments

Comments
 (0)