mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-16 05:07:06 +00:00
push in curl_formadd wrapper
This commit is contained in:
parent
401ad16faa
commit
db2d587eec
@ -49,7 +49,7 @@ SWITCH_DECLARE(switch_CURLcode) switch_curl_easy_setopt(CURL *handle, switch_CUR
|
|||||||
SWITCH_DECLARE(const char *) switch_curl_easy_strerror(switch_CURLcode errornum );
|
SWITCH_DECLARE(const char *) switch_curl_easy_strerror(switch_CURLcode errornum );
|
||||||
SWITCH_DECLARE(void) switch_curl_init(void);
|
SWITCH_DECLARE(void) switch_curl_init(void);
|
||||||
SWITCH_DECLARE(void) switch_curl_destroy(void);
|
SWITCH_DECLARE(void) switch_curl_destroy(void);
|
||||||
|
SWITCH_DECLARE(CURLFORMcode) switch_curl_formadd(struct curl_httppost **formpost, struct curl_httppost **lastptr, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ SWITCH_DECLARE(switch_CURLcode) switch_curl_easy_getinfo(switch_CURL *curl, swit
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_curl_easy_cleanup(switch_CURL *handle)
|
SWITCH_DECLARE(void) switch_curl_easy_cleanup(switch_CURL *handle)
|
||||||
{
|
{
|
||||||
curl_easy_cleanup((CURL *)handle);
|
curl_easy_cleanup((CURL *)handle);
|
||||||
@ -75,3 +73,18 @@ SWITCH_DECLARE(void) switch_curl_destroy(void)
|
|||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* kind of ugly but there is no better portable way to wrap this function =(::: */
|
||||||
|
#include "../../../../libs/curl/lib/formdata.c"
|
||||||
|
|
||||||
|
SWITCH_DECLARE(CURLFORMcode) switch_curl_formadd(struct curl_httppost **httppost,
|
||||||
|
struct curl_httppost **last_post,
|
||||||
|
...)
|
||||||
|
{
|
||||||
|
va_list arg;
|
||||||
|
CURLFORMcode result;
|
||||||
|
va_start(arg, last_post);
|
||||||
|
result = FormAdd(httppost, last_post, arg);
|
||||||
|
va_end(arg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user