X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwrite_http.c;h=4a92ac751e118ad80cbc99c277b9cd859e44442c;hb=e7a7be6760b7f79780e9e9ed10fa9e029a3faa38;hp=6127c0426d2ba4fc36ffdd0d654f564b95b3a829;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/write_http.c b/src/write_http.c index 6127c042..4a92ac75 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);