Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-05-23 09:29:51 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-05-23 09:29:51 +0300
commit386477f433041d9a74143d84605de24aacfd0838 (patch)
tree775aff839457a7f6cb2b685ff2a76218b0e258f1
parente97a816c0183982c26a95b34821f64f14468455e (diff)
Added conditional code to save files with upload errors
-rw-r--r--src/Networking/UploadingNetworkResponder.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Networking/UploadingNetworkResponder.cpp b/src/Networking/UploadingNetworkResponder.cpp
index 5b4245de..6cac6b39 100644
--- a/src/Networking/UploadingNetworkResponder.cpp
+++ b/src/Networking/UploadingNetworkResponder.cpp
@@ -111,7 +111,14 @@ void UploadingNetworkResponder::FinishUpload(uint32_t fileLength, time_t fileLas
const char *uploadFilename = filenameBeingProcessed.c_str();
if (uploadError)
{
+#if 0 // Temporary code to save files with upload errors and report successful uploads
+ String<MaxFilenameLength> newName;
+ MassStorage::CombineName(newName.GetRef(), Platform::GetGCodeDir(), "uploadError_");
+ newName.catf("%04u", (unsigned int)(millis() % 10000));
+ MassStorage::Rename(uploadFilename, newName.c_str(), true, true);
+#else
MassStorage::Delete(uploadFilename, true);
+#endif
}
else
{
@@ -126,6 +133,9 @@ void UploadingNetworkResponder::FinishUpload(uint32_t fileLength, time_t fileLas
// Update the file timestamp if it was specified
(void)MassStorage::SetLastModifiedTime(origFilename.c_str(), fileLastModified);
}
+#if 0 // Temporary code to save files with upload errors and report successful uploads
+ GetPlatform().Message(GenericMessage, "Successful upload\n");
+#endif
}
filenameBeingProcessed.Clear();
}