7 return curl_easy_init();
12 return curl_easy_perform((CURL *)handle);
22 code = curl_easy_getinfo(curl, info, va_arg(ap,
void *));
30 curl_easy_cleanup((CURL *)handle);
43 curl_slist_free_all((
struct curl_slist *) list);
48 return curl_easy_strerror(errornum);
53 curl_global_init(CURL_GLOBAL_ALL);
58 curl_global_cleanup();
64 struct curl_httppost *formpost=NULL;
65 struct curl_httppost *lastptr=NULL;
69 for (hp = event->headers; hp; hp = hp->
next) {
70 if (!strncasecmp(hp->
name,
"attach_file:", 12)) {
80 for (hp = event->headers; hp; hp = hp->
next) {
82 if (!strncasecmp(hp->
name,
"attach_file:", 12)) {
83 char *pname = strdup(hp->
name + 12);
86 char *fname = strchr(pname,
':');
90 curl_formadd(&formpost,
92 CURLFORM_COPYNAME, pname,
93 CURLFORM_FILENAME, fname,
94 CURLFORM_FILE, hp->
value,
100 curl_formadd(&formpost,
102 CURLFORM_COPYNAME, hp->
name,
103 CURLFORM_COPYCONTENTS, hp->
value,
109 *formpostp = formpost;
void switch_curl_init(void)
void switch_curl_destroy(void)
Representation of an event.
switch_curl_slist_t * switch_curl_slist_append(switch_curl_slist_t *list, const char *string)
switch_CURLcode switch_curl_easy_getinfo(switch_CURL *curl, switch_CURLINFO info,...)
switch_CURLcode switch_curl_easy_perform(switch_CURL *handle)
switch_CURL * switch_curl_easy_init(void)
SWITCH_BEGIN_EXTERN_C typedef void switch_CURL
struct curl_slist switch_curl_slist_t
switch_status_t
Common return values.
switch_status_t switch_curl_process_form_post_params(switch_event_t *event, switch_CURL *curl_handle, struct curl_httppost **formpostp)
void switch_curl_easy_cleanup(switch_CURL *handle)
const char * switch_curl_easy_strerror(switch_CURLcode errornum)
void switch_curl_slist_free_all(switch_curl_slist_t *list)