| 684 | } |
| 685 | |
| 686 | bool 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 | } |
nothing calls this directly
no test coverage detected