adamdebreceni commented on a change in pull request #1233:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1233#discussion_r783842490
##########
File path: extensions/http-curl/protocols/RESTSender.cpp
##########
@@ -102,17 +104,36 @@ const C2Payload RESTSender::sendPayload(const std::string
url, const Direction d
client.setKeepAliveIdle(std::chrono::milliseconds(2000));
client.setConnectionTimeout(std::chrono::milliseconds(2000));
if (direction == Direction::TRANSMIT) {
- input = std::unique_ptr<utils::ByteInputCallBack>(new
utils::ByteInputCallBack());
- callback = std::unique_ptr<utils::HTTPUploadCallback>(new
utils::HTTPUploadCallback());
- input->write(outputConfig);
- callback->ptr = input.get();
- callback->pos = 0;
client.set_request_method("POST");
if (!ssl_context_service_ && url.find("https://") == 0) {
setSecurityContext(client, "POST", url);
}
- client.setUploadCallback(callback.get());
- client.setPostSize(outputConfig.size());
+ if (payload.getOperation() == Operation::TRANSFER) {
+ // treat nested payloads as files
+ for (auto& file : payload.getNestedPayloads()) {
Review comment:
made it const
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]