You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Ferenc Gerlits (Jira)" <ji...@apache.org> on 2022/10/21 07:24:00 UTC
[jira] [Created] (MINIFICPP-1971) Clean up code related to HTTPUploadCallback
Ferenc Gerlits created MINIFICPP-1971:
-----------------------------------------
Summary: Clean up code related to HTTPUploadCallback
Key: MINIFICPP-1971
URL: https://issues.apache.org/jira/browse/MINIFICPP-1971
Project: Apache NiFi MiNiFi C++
Issue Type: Improvement
Affects Versions: 0.13.0
Reporter: Ferenc Gerlits
{{HTTPUploadCallback}} and related classes are a mess. Some problems:
* review uses of {{seek_callback}} (set as {{CURLOPT_SEEKFUNCTION}}); when does {{curl}} call this? if {{curl}} needs this (for handling of network errors, maybe?), we should support it better;
* in {{HTTPUploadByteArrayInputCallback::setPosition()}}, the {{getBufferSize() <= static_cast<size_t>(offset)}} check should probably be changed to {{getBufferSize() < static_cast<size_t>(offset)}}, since seeking to the end of the data is valid;
* {{HTTPUploadByteArrayInputCallback}} and {{HttpStreamingCallback}} are both callbacks for {{ProcessSession::read}} and for {{curl}}, which is confusing. Since both of these store the data to be uploaded in memory, their constructor could take the data in e.g. a vector, and reading the flow file could be done separately and in a simpler way;
* there is a lot of code related to stopping and closing; are these useful/necessary?
* is the multi-threading code in {{HttpStreamingCallback}} necessary, and if it is, could it be done simpler?
* could/should most (all?) usages of {{HTTPUploadByteArrayInputCallback}} be replaced by {{HTTPUploadStreamContentsCallback}}?
* etc
--
This message was sent by Atlassian Jira
(v8.20.10#820010)