diff --git a/clients/cloud-setup/nm-http-client.c b/clients/cloud-setup/nm-http-client.c index 5daf9b356d..fdef04497e 100644 --- a/clients/cloud-setup/nm-http-client.c +++ b/clients/cloud-setup/nm-http-client.c @@ -265,6 +265,7 @@ nm_http_client_req (NMHttpClient *self, int timeout_msec, gssize max_data, const char *const *http_headers, + const char * http_method, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -326,6 +327,9 @@ nm_http_client_req (NMHttpClient *self, curl_easy_setopt (edata->ehandle, CURLOPT_HTTPHEADER, edata->headers); } + if (http_method) + curl_easy_setopt(edata->ehandle, CURLOPT_CUSTOMREQUEST, http_method); + if (timeout_msec > 0) { edata->timeout_source = _source_attach (self, nm_g_timeout_source_new (timeout_msec, @@ -387,6 +391,7 @@ typedef struct { GTask *task; char *uri; const char *const *http_headers; + const char *http_method; NMHttpClientPollReqCheckFcn check_fcn; gpointer check_user_data; GBytes *response_data; @@ -424,6 +429,7 @@ _poll_req_probe_start_fcn (GCancellable *cancellable, poll_req_data->request_timeout_ms, poll_req_data->request_max_data, poll_req_data->http_headers, + poll_req_data->http_method, cancellable, callback, user_data); @@ -504,6 +510,7 @@ nm_http_client_poll_req (NMHttpClient *self, int poll_timeout_ms, int ratelimit_timeout_ms, const char *const *http_headers, + const char *http_method, GCancellable *cancellable, NMHttpClientPollReqCheckFcn check_fcn, gpointer check_user_data, diff --git a/clients/cloud-setup/nm-http-client.h b/clients/cloud-setup/nm-http-client.h index eeca3930d2..6f5338fd86 100644 --- a/clients/cloud-setup/nm-http-client.h +++ b/clients/cloud-setup/nm-http-client.h @@ -37,6 +37,7 @@ void nm_http_client_poll_req (NMHttpClient *self, int poll_timeout_ms, int ratelimit_timeout_ms, const char *const *http_headers, + const char *http_method, GCancellable *cancellable, NMHttpClientPollReqCheckFcn check_fcn, gpointer check_user_data, diff --git a/clients/cloud-setup/nmcs-provider-ec2.c b/clients/cloud-setup/nmcs-provider-ec2.c index 5ef0b51fa9..4d92e1a778 100644 --- a/clients/cloud-setup/nmcs-provider-ec2.c +++ b/clients/cloud-setup/nmcs-provider-ec2.c @@ -139,6 +139,7 @@ detect (NMCSProvider *provider, 7000, 1000, NULL, + NULL, g_task_get_cancellable (task), _detect_get_meta_data_check_cb, NULL, @@ -398,6 +399,7 @@ _get_config_metadata_ready_cb (GObject *source, 10000, 1000, NULL, + NULL, iface_data->cancellable, NULL, NULL, @@ -416,6 +418,7 @@ _get_config_metadata_ready_cb (GObject *source, 10000, 1000, NULL, + NULL, iface_data->cancellable, NULL, NULL, @@ -533,6 +536,7 @@ get_config (NMCSProvider *provider, 15000, 1000, NULL, + NULL, g_task_get_cancellable (get_config_data->task), _get_config_metadata_ready_check, metadata_data,