MCPcopy Create free account
hub / github.com/chrxh/alien / appendResourceData

Method appendResourceData

source/Network/NetworkService.cpp:686–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684}
685
686bool NetworkService::appendResourceData(std::string const& resourceId, std::string const& data, int chunkIndex)
687{
688 httplib::SSLClient client(_serverAddress);
689 configureClient(client);
690
691 httplib::MultipartFormDataItems items = {
692 {"userName", *_loggedInUserName, "", ""},
693 {"password", *_password, "", ""},
694 {"simId", resourceId, "", ""},
695 {"content", data, "", "application/octet-stream"},
696 {"chunkIndex", std::to_string(chunkIndex), "", ""},
697 };
698
699 try {
700 auto result = executeRequest([&] { return client.Post("/alien-server/appendsimulationdata.php", items); });
701 if (!parseBoolResult(result->body)) {
702 return false;
703 }
704 } catch (...) {
705 logNetworkError();
706 return false;
707 }
708 return true;
709}

Callers

nothing calls this directly

Calls 6

configureClientFunction · 0.85
to_stringFunction · 0.85
executeRequestFunction · 0.85
parseBoolResultFunction · 0.85
logNetworkErrorFunction · 0.85
PostMethod · 0.80

Tested by

no test coverage detected