X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwrite_http.c;h=468892808f82e8bf5293664caa10c48ba79c4378;hb=f374b72032a227a75b6bc9ae574cd28abbc16f24;hp=c1b3f0b0c7c7cc25cb4455d9b9a5c128cbc2dfbe;hpb=02a29964b4e67bb04c1419daedc8eacfafdf0a7c;p=collectd.git diff --git a/src/write_http.c b/src/write_http.c index c1b3f0b0..46889280 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -114,6 +114,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); @@ -163,7 +164,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);