X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_http.c;h=61b9a0ec7ba4b4fe7cd8a510f52bda6a6a1e943b;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hp=d5c91d910e8efbd5abadeb8233d24803cca1269d;hpb=1035fba8812893e50d00a871e3399cc1ece3b384;p=collectd.git diff --git a/src/write_http.c b/src/write_http.c index d5c91d91..61b9a0ec 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);