VES_ENDPOINT_USERNAME: ${VES_ENDPOINT_USERNAME}
VES_ENDPOINT_PASSWORD: ${VES_ENDPOINT_PASSWORD}
+ CURL_CONNECT_TIMEOUT: ${CURL_CONNECT_TIMEOUT}
+ CURL_OPERATION_TIMEOUT: ${CURL_OPERATION_TIMEOUT}
+
ntsim-ng-o-ru:
image: "${DOCKER_REPO}nts-ng-o-ran-ru-fh:${NTS_BUILD_VERSION}"
cap_add:
VES_ENDPOINT_USERNAME: ${VES_ENDPOINT_USERNAME}
VES_ENDPOINT_PASSWORD: ${VES_ENDPOINT_PASSWORD}
+ CURL_CONNECT_TIMEOUT: ${CURL_CONNECT_TIMEOUT}
+ CURL_OPERATION_TIMEOUT: ${CURL_OPERATION_TIMEOUT}
+
ntsim-ng-o-du:
image: "${DOCKER_REPO}nts-ng-o-ran-du:${NTS_BUILD_VERSION}"
cap_add:
VES_ENDPOINT_USERNAME: ${VES_ENDPOINT_USERNAME}
VES_ENDPOINT_PASSWORD: ${VES_ENDPOINT_PASSWORD}
+ CURL_CONNECT_TIMEOUT: ${CURL_CONNECT_TIMEOUT}
+ CURL_OPERATION_TIMEOUT: ${CURL_OPERATION_TIMEOUT}
+
o-ran-sc-topology-service:
image: "${DOCKER_REPO}o-ran-sc-topology-service:${NTS_BUILD_VERSION}"
stop_grace_period: 5m
networks:
default:
external:
- name: smo_integration
\ No newline at end of file
+ name: smo_integration
};
static size_t curl_write_cb(void *data, size_t size, size_t nmemb, void *userp);
-
+
int http_request(const char *url, const char *username, const char* password, const char *method, const char *send_data, int *response_code, char **recv_data) {
assert(url);
assert(method);
return NTS_ERR_FAILED;
}
+ int curl_connect_timeout = get_int_from_string_with_default(getenv("CURL_CONNECT_TIMEOUT"), 1);
+ int curl_operation_timeout = get_int_from_string_with_default(getenv("CURL_OPERATION_TIMEOUT"), 1);
+
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header);
- curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1L); //seconds timeout for a connection
- curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1L); //seconds timeout for an operation
- curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L);
+ curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, (long)curl_connect_timeout); //seconds timeout for a connection
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)curl_operation_timeout); //seconds timeout for an operation
+ curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, (long)curl_connect_timeout);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
// disable SSL verifications
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response_data);
}
-
+
log_add_verbose(2, "%s-ing cURL to url=\"%s\" with body=\"%s\"... ", method, url, send_data_good);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(header);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response_data);
}
-
+
log_add_verbose(2, "%s-ing cURL to url=\"%s\" with body=\"%s\"\n", method, url, send_data_good);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(header);