Created
January 13, 2011 22:03
-
-
Save daddz/778713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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