X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_http.c;h=06327edbb1019bb9bd9f8a037bd1767151f78af9;hb=f4e0ca6bb59e633618ff3918fde47018672ea758;hp=2dd13c5b1feac51b23b03272781fea312e518b79;hpb=e746ad785774de37a30302fef65f1c4aaf8698ab;p=collectd.git diff --git a/src/write_http.c b/src/write_http.c index 2dd13c5b..06327edb 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -119,6 +119,7 @@ static int wh_post_nolock(wh_callback_t *cb, char const *data) /* {{{ */ { int status = 0; + curl_easy_setopt(cb->curl, CURLOPT_URL, cb->location); curl_easy_setopt(cb->curl, CURLOPT_POSTFIELDS, data); status = curl_easy_perform(cb->curl); @@ -168,7 +169,6 @@ static int wh_callback_init(wh_callback_t *cb) /* {{{ */ curl_easy_setopt(cb->curl, CURLOPT_HTTPHEADER, cb->headers); curl_easy_setopt(cb->curl, CURLOPT_ERRORBUFFER, cb->curl_errbuf); - curl_easy_setopt(cb->curl, CURLOPT_URL, cb->location); curl_easy_setopt(cb->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(cb->curl, CURLOPT_MAXREDIRS, 50L);