MCPcopy Create free account
hub / github.com/apache/cloudberry / performCurl

Method performCurl

gpcontrib/gpcloud/src/s3restful_service.cpp:122–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120};
121
122void S3RESTfulService::performCurl(CURL *curl, Response &response) {
123 CURLcode res = curl_easy_perform(curl);
124 if (res != CURLE_OK) {
125 if (res == CURLE_COULDNT_RESOLVE_HOST || res == CURLE_COULDNT_RESOLVE_PROXY) {
126 S3_DIE(S3ResolveError, curl_easy_strerror(res));
127 } else if (res == CURLE_COULDNT_CONNECT) {
128 S3_DIE(S3ConnectionError, "Failed to connect to host or proxy.");
129 } else {
130 S3_DIE(S3ConnectionError, curl_easy_strerror(res));
131 }
132 } else {
133 long responseCode;
134 // Get the HTTP response status code from HTTP header
135 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &responseCode);
136
137 response.FillResponse(responseCode);
138 }
139}
140
141// get() will execute HTTP GET RESTful API with given url/headers/params,
142// and return raw response content.

Callers 5

getMethod · 0.95
putMethod · 0.95
postMethod · 0.95
headMethod · 0.95
deleteRequestMethod · 0.95

Calls 1

FillResponseMethod · 0.80

Tested by

no test coverage detected