|
@@ -31,30 +31,30 @@
|
|
|
#include "../../sr_module.h"
|
|
|
#include "functions.h"
|
|
|
|
|
|
-typedef int (*curlapi_curlconnect_f)(struct sip_msg *msg, const str *connection, const str* _url, str* _result, const char *contenttype, const str* _post);
|
|
|
+typedef int (*httpcapi_httpconnect_f)(struct sip_msg *msg, const str *connection, const str* _url, str* _result, const char *contenttype, const str* _post);
|
|
|
|
|
|
-typedef struct curl_api {
|
|
|
- curlapi_curlconnect_f curl_connect;
|
|
|
-} curl_api_t;
|
|
|
+typedef struct httpc_api {
|
|
|
+ httpcapi_httpconnect_f http_connect;
|
|
|
+} httpc_api_t;
|
|
|
|
|
|
-typedef int (*bind_curl_api_f)(curl_api_t *api);
|
|
|
-int bind_curl_api(curl_api_t *api);
|
|
|
+typedef int (*bind_httpc_api_f)(httpc_api_t *api);
|
|
|
+int bind_httpc_api(httpc_api_t *api);
|
|
|
|
|
|
/**
|
|
|
* @brief Load the CURL API
|
|
|
*/
|
|
|
-static inline int curl_load_api(curl_api_t *api)
|
|
|
+static inline int httpc_load_api(httpc_api_t *api)
|
|
|
{
|
|
|
- bind_curl_api_f bindcurl;
|
|
|
+ bind_httpc_api_f bindhttpc;
|
|
|
|
|
|
- bindcurl = (bind_curl_api_f)find_export("bind_curl", 0, 0);
|
|
|
- if(bindcurl == 0) {
|
|
|
- LM_ERR("cannot find bind_curl\n");
|
|
|
+ bindhttpc = (bind_httpc_api_f)find_export("bind_http_client", 0, 0);
|
|
|
+ if(bindhttpc == 0) {
|
|
|
+ LM_ERR("cannot find bind_http_client\n");
|
|
|
return -1;
|
|
|
}
|
|
|
- if (bindcurl(api) < 0)
|
|
|
+ if (bindhttpc(api) < 0)
|
|
|
{
|
|
|
- LM_ERR("cannot bind curl api\n");
|
|
|
+ LM_ERR("cannot bind http_client api\n");
|
|
|
return -1;
|
|
|
}
|
|
|
return 0;
|