Пример #1
0
static int wh_send_buffer (wh_callback_t *cb) /* {{{ */
{
        int status = 0;

        curl_easy_setopt (cb->curl, CURLOPT_POSTFIELDS, cb->send_buffer);
        status = curl_easy_perform (cb->curl);

        wh_log_http_error (cb);

        if (status != CURLE_OK)
        {
                ERROR ("write_http plugin: curl_easy_perform failed with "
                                "status %i: %s",
                                status, cb->curl_errbuf);
        }
        return (status);
} /* }}} wh_send_buffer */
Пример #2
0
/* must hold cb->send_lock when calling */
static int wh_post_nolock (wh_callback_t *cb, char const *data) /* {{{ */
{
        int status = 0;

        curl_easy_setopt (cb->curl, CURLOPT_POSTFIELDS, data);
        status = curl_easy_perform (cb->curl);

        wh_log_http_error (cb);

        if (status != CURLE_OK)
        {
                ERROR ("write_http plugin: curl_easy_perform failed with "
                                "status %i: %s",
                                status, cb->curl_errbuf);
        }
        return (status);
} /* }}} wh_post_nolock */