Skip to content

Commit

Permalink
remove upload timeout on color upload
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jun 22, 2024
1 parent 8a6976b commit 97c7085
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Source/Prop/props/bento/BentoProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void BentoProp::uploadPlaybackData(PlaybackData data)

URL metaUrl = URL(target).withDataToUpload("uploadData", data.name + ".meta", metaData, "text/plain");

std::unique_ptr<InputStream> mStream(metaUrl.createInputStream(URL::InputStreamOptions(URL::ParameterHandling::inPostData).withProgressCallback(std::bind(&BentoProp::uploadMetaDataProgressCallback, this, std::placeholders::_1, std::placeholders::_2)).withConnectionTimeoutMs(20000)));
std::unique_ptr<InputStream> mStream(metaUrl.createInputStream(URL::InputStreamOptions(URL::ParameterHandling::inPostData).withProgressCallback(std::bind(&BentoProp::uploadMetaDataProgressCallback, this, std::placeholders::_1, std::placeholders::_2)).withConnectionTimeoutMs(5000)));



Expand Down Expand Up @@ -247,7 +247,7 @@ void BentoProp::uploadPlaybackData(PlaybackData data)

url = URL(target).withDataToUpload("uploadData", data.name + ".colors", dataToSend, sendCompressedFile->boolValue() ? "application/zip" : "text/plain");

std::unique_ptr<InputStream> stream(url.createInputStream(URL::InputStreamOptions(URL::ParameterHandling::inPostData).withProgressCallback(std::bind(&BentoProp::uploadProgressCallback, this, std::placeholders::_1, std::placeholders::_2)).withExtraHeaders("Content-Length:" + String(dataToSend.getSize())).withConnectionTimeoutMs(10000)));
std::unique_ptr<InputStream> stream(url.createInputStream(URL::InputStreamOptions(URL::ParameterHandling::inPostData).withProgressCallback(std::bind(&BentoProp::uploadProgressCallback, this, std::placeholders::_1, std::placeholders::_2)).withExtraHeaders("Content-Length: " + String(dataToSend.getSize()))));



Expand Down Expand Up @@ -310,7 +310,7 @@ void BentoProp::uploadFile(FileToUpload f)
}
else
{
NLOGERROR(niceName, "Error uploading color data to prop (id " << String(globalID->intValue()) << ")");
NLOGERROR(niceName, "Error uploading file to prop (id " << String(globalID->intValue()) << ")");
return;
}
}
Expand Down Expand Up @@ -451,7 +451,7 @@ bool BentoProp::uploadProgressCallback(int bytesSent, int totalBytes)
if (threadShouldExit()) return false;
float p = bytesSent * 1.0f / totalBytes;
uploadProgress->setValue(.1f + p * .9f);
//NLOG(prop->niceName, "Uploading... " << (int)(prop->uploadProgress->floatValue() * 100) << "% (" << bytesSent << " / " << totalBytes << ")");
NLOG(niceName, "Uploading ... (" << bytesSent << " / " << totalBytes << ")");

return true;
}
Expand All @@ -463,7 +463,6 @@ bool BentoProp::uploadMetaDataProgressCallback(int bytesSent, int totalBytes)
float p = bytesSent * 1.0f / totalBytes;
uploadProgress->setValue(p * .1f);

//NLOG(prop->niceName, "Uploading... " << (int)(prop->uploadProgress->floatValue() * 100) << "% (" << bytesSent << " / " << totalBytes << ")");

return true;
}
Expand Down Expand Up @@ -569,4 +568,4 @@ var BentoProp::sendMessageToPropFromScript(const var::NativeFunctionArgs& a)
p->sendMessageToProp(m);

return true;
}
}

0 comments on commit 97c7085

Please sign in to comment.