Module: kamailio
Branch: master
Commit: 541c8d2c8d0c77f0c541417165a387ad2ed8def7
URL:
https://github.com/kamailio/kamailio/commit/541c8d2c8d0c77f0c541417165a387a…
Author: Hugh Waite <hugh.waite(a)xura.com>
Committer: Hugh Waite <hugh.waite(a)xura.com>
Date: 2016-02-04T10:08:32Z
http_client: Rename C API functions following module rename
---
Modified: modules/http_client/curl_api.c
Modified: modules/http_client/curl_api.h
Modified: modules/http_client/http_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/541c8d2c8d0c77f0c541417165a387a…
Patch:
https://github.com/kamailio/kamailio/commit/541c8d2c8d0c77f0c541417165a387a…
---
diff --git a/modules/http_client/curl_api.c b/modules/http_client/curl_api.c
index 622e28b..e299ac0 100644
--- a/modules/http_client/curl_api.c
+++ b/modules/http_client/curl_api.c
@@ -22,13 +22,13 @@
#include "functions.h"
#include "curl_api.h"
-int bind_curl_api(curl_api_t *api)
+int bind_httpc_api(httpc_api_t *api)
{
if (!api) {
ERR("Invalid parameter value\n");
return -1;
}
- api->curl_connect = curl_con_query_url;
+ api->http_connect = curl_con_query_url;
return 0;
}
diff --git a/modules/http_client/curl_api.h b/modules/http_client/curl_api.h
index caaa09a..cde82b6 100644
--- a/modules/http_client/curl_api.h
+++ b/modules/http_client/curl_api.h
@@ -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;
diff --git a/modules/http_client/http_client.c b/modules/http_client/http_client.c
index 523228d..4dd2b66 100644
--- a/modules/http_client/http_client.c
+++ b/modules/http_client/http_client.c
@@ -133,7 +133,7 @@ static cmd_export_t cmds[] = {
{"http_connect", (cmd_function)w_curl_connect_post, 5,
fixup_curl_connect_post,
fixup_free_curl_connect_post,
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE},
- {"bind_curl", (cmd_function)bind_curl_api, 0, 0, 0, 0},
+ {"bind_http_client", (cmd_function)bind_httpc_api, 0, 0, 0, 0},
};