martinzink commented on code in PR #1383:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1383#discussion_r952746080
##########
extensions/http-curl/client/HTTPClient.h:
##########
@@ -270,48 +249,33 @@ class HTTPClient : public BaseHTTPClient, public
core::Connectable {
void configure_secure_connection(CURL *http_session);
- bool isSecure(const std::string &url);
+ std::chrono::milliseconds getAbsoluteTimeout() const { return
3*read_timeout_; }
- HTTPReadCallback content_;
+ utils::HTTPReadCallback content_{std::numeric_limits<size_t>::max()};
std::shared_ptr<minifi::controllers::SSLContextService> ssl_context_service_;
std::string url_;
- std::chrono::milliseconds connect_timeout_ms_{30000};
- // read timeout.
- std::chrono::milliseconds read_timeout_ms_{30000};
- char *content_type_str_{nullptr};
- std::string content_type_;
- struct curl_slist *headers_{nullptr};
- HTTPReadCallback *callback{nullptr};
- HTTPUploadCallback *write_callback_{nullptr};
- int64_t http_code_{0};
- ByteOutputCallback read_callback_{INT_MAX};
- utils::HTTPHeaderResponse header_response_{-1};
-
- CURLcode res{CURLE_OK};
-
- CURL* http_session_{nullptr};
- curl_mime* form_{nullptr};
-
std::string method_;
- std::chrono::milliseconds keep_alive_probe_{-1};
+ std::chrono::milliseconds connect_timeout_{std::chrono::seconds(30)};
+ std::chrono::milliseconds read_timeout_{std::chrono::seconds(30)};
- std::chrono::milliseconds keep_alive_idle_{-1};
+ HTTPResponseData response_data_;
- struct BasicAuthCredentials {
- BasicAuthCredentials(std::string username, std::string password) :
username(std::move(username)), password(std::move(password)) {}
+ CURLcode res_{CURLE_OK};
- std::string username;
- std::string password;
- };
+ RequestHeaders request_headers_;
- std::optional<BasicAuthCredentials> username_password_;
+ std::unique_ptr<CURL, decltype(&curl_easy_cleanup)> http_session_{nullptr,
curl_easy_cleanup};
+ std::unique_ptr<curl_mime, decltype(&curl_mime_free)> form_{nullptr,
curl_mime_free};
Review Comment:
good idea, I've replaced them in
https://github.com/apache/nifi-minifi-cpp/commit/3edf5fcfd603463b67bd6c072fa0128bbb861787#diff-475912c726caf957fa46ce1b55d3e845e89aa19b4c7caf2cd4a0ae1f860cbdd5R241-R242
Didnt remove the include from the header because there is a member that
still depends on it `CURLcode res_{CURLE_OK}`
--
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]