martinzink commented on code in PR #1383: URL: https://github.com/apache/nifi-minifi-cpp/pull/1383#discussion_r954899382
########## extensions/http-curl/client/HTTPStream.cpp: ########## @@ -26,55 +26,55 @@ #include "io/validation.h" #include "utils/gsl.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace io { +namespace org::apache::nifi::minifi::extensions::curl { -HttpStream::HttpStream(std::shared_ptr<utils::HTTPClient> client) +HttpStream::HttpStream(std::shared_ptr<HTTPClient> client) : http_client_(std::move(client)), written(0), - // given the nature of the stream we don't want to slow libCURL, we will produce - // a warning instead allowing us to adjust it server side or through the local configuration. - http_read_callback_(66560, true), + // given the nature of the stream we don't want to slow libCURL, we will produce + // a warning instead allowing us to adjust it server side or through the local configuration. started_(false) { // submit early on } void HttpStream::close() { - http_callback_.close(); - http_read_callback_.close(); + if (auto read_callback = http_client_->getReadCallback()) + read_callback->close(); + if (auto upload_callback = http_client_->getUploadCallback()) + upload_callback->close(); } void HttpStream::seek(size_t /*offset*/) { // seek is an unnecessary part of this implementation throw std::logic_error{"HttpStream::seek is unimplemented"}; } -size_t HttpStream::tell() const { +size_t HttpStream::tell() const { // tell is an unnecessary part of this implementation throw std::logic_error{"HttpStream::tell is unimplemented"}; } // data stream overrides -size_t HttpStream::write(const uint8_t *value, size_t size) { +size_t HttpStream::write(const uint8_t* value, size_t size) { if (size == 0) return 0; if (IsNullOrEmpty(value)) { - return STREAM_ERROR; + return io::STREAM_ERROR; } if (!started_) { std::lock_guard<std::mutex> lock(mutex_); if (!started_) { - callback_.ptr = &http_callback_; - callback_.pos = 0; - http_client_->setUploadCallback(&callback_); + auto callback = std::make_unique<HttpStreamingCallback>(); + callback->pos = 0; Review Comment: you are right, removed these in https://github.com/apache/nifi-minifi-cpp/pull/1383/commits/044ce269808a28e5a6eaeca34fb30747426a6ab7#diff-4e08bc45485eac46e59652e031a79a51dca96dc3a08fa5bf6ee8d2b5603bda6eL68 -- 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: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org