You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by gi...@git.apache.org on 2017/07/26 23:37:31 UTC

[GitHub] jai1 commented on a change in pull request #602: Fix #601: Use long when calling curl_easy_getinfo in tests

jai1 commented on a change in pull request #602: Fix #601: Use long when calling curl_easy_getinfo in tests
URL: https://github.com/apache/incubator-pulsar/pull/602#discussion_r129723131
 
 

 ##########
 File path: pulsar-client-cpp/tests/HttpHelper.cc
 ##########
 @@ -32,16 +32,15 @@ int makePutRequest(const std::string& url, const std::string& body) {
     curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
     curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
-    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
     int res = curl_easy_perform(curl);
-    curl_slist_free_all(list); /* free the list again */ 
-    
+    curl_slist_free_all(list); /* free the list again */
+
     if (res != CURLE_OK) {
         return -1;
     }
 
-    int httpResult = 0;
+    long httpResult = 0;
     curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpResult);
     curl_easy_cleanup(curl);
-    return httpResult;
+    return (int) httpResult;
 
 Review comment:
   How about we change the return type to long, don't like type casting very much.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services