Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/158#discussion_r147542555
  
    --- Diff: extensions/http-curl/client/HTTPClient.cpp ---
    @@ -175,19 +201,53 @@ bool HTTPClient::submit() {
     
       curl_easy_setopt(http_session_, CURLOPT_URL, url_.c_str());
       logger_->log_info("Submitting to %s", url_);
    -  curl_easy_setopt(http_session_, CURLOPT_WRITEFUNCTION, 
&utils::HTTPRequestResponse::recieve_write);
    -  curl_easy_setopt(http_session_, CURLOPT_WRITEDATA, 
static_cast<void*>(&content_));
    -
    +  if (callback == nullptr) {
    +    content_.ptr = &read_callback_;
    +    curl_easy_setopt(http_session_, CURLOPT_WRITEFUNCTION, 
&utils::HTTPRequestResponse::recieve_write);
    +    curl_easy_setopt(http_session_, CURLOPT_WRITEDATA, 
static_cast<void*>(&content_));
    +  }
       curl_easy_setopt(http_session_, CURLOPT_HEADERFUNCTION, 
&utils::HTTPHeaderResponse::receive_headers);
       curl_easy_setopt(http_session_, CURLOPT_HEADERDATA, 
static_cast<void*>(&header_response_));
    -
    +  curl_easy_setopt(http_session_, CURLOPT_TCP_KEEPALIVE, 0L);
    --- End diff --
    
    This shouldn't be necessary. 


---

Reply via email to