X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_http.c;h=468892808f82e8bf5293664caa10c48ba79c4378;hb=45492ba3d0119874e2f2878d68089fc8f62268a4;hp=c1b3f0b0c7c7cc25cb4455d9b9a5c128cbc2dfbe;hpb=11c8a760c2d354b2f4637bdb297efb253bfaa519;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);