From 541c8d2c8d0c77f0c541417165a387ad2ed8def7 Mon Sep 17 00:00:00 2001 From: Hugh Waite Date: Thu, 4 Feb 2016 10:07:42 +0000 Subject: [PATCH] http_client: Rename C API functions following module rename --- modules/http_client/curl_api.c | 4 ++-- modules/http_client/curl_api.h | 26 +++++++++++++------------- modules/http_client/http_client.c | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/http_client/curl_api.c b/modules/http_client/curl_api.c index 622e28b91c4..e299ac093e9 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 caaa09ae392..cde82b62640 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 523228d0054..4dd2b66b7f5 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}, };