Skip to content

Instantly share code, notes, and snippets.

@daddz
Created January 13, 2011 22:03
Show Gist options
  • Save daddz/778713 to your computer and use it in GitHub Desktop.
Save daddz/778713 to your computer and use it in GitHub Desktop.
CURLM *curl;
static void foo_cb(const char *data, const char *moredata) {
struct curl_httppost *post = NULL;
struct curl_httppost *last = NULL;
CURL *handle;
handle = curl_easy_init();
curl_formadd(&post, &last,
CURLFORM_COPYNAME, "data",
CURLFORM_COPYCONTENTS, data,
CURLFORM_END);
curl_formadd(&post, &last,
CURLFORM_COPYNAME, "moredata",
CURLFORM_COPYCONTENTS, moredata,
CURLFORM_END);
curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
curl_multi_add_handle(curl, handle);
curl_formfree(post);
}
static void plugin_load() {
/* pseudocode */
signal_connect('foo-signal', foo_cb);
curl = curl_multi_init();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment