Rename openconnect_parse_url() to internal_parse_url()
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 9 Mar 2011 16:50:15 +0000 (16:50 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 9 Mar 2011 21:11:46 +0000 (21:11 +0000)
We only need to expose a simpler version of this

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
http.c
main.c
nm-auth-dialog.c
openconnect-internal.h
openconnect.h
ssl.c

diff --git a/http.c b/http.c
index 8f149f5..e1c3f79 100644 (file)
--- a/http.c
+++ b/http.c
@@ -520,8 +520,8 @@ char *local_strcasestr(const char *haystack, const char *needle)
 #define strcasestr local_strcasestr
 #endif
 
-int openconnect_parse_url(char *url, char **res_proto, char **res_host, int *res_port,
-             char **res_path, int default_port)
+int internal_parse_url(char *url, char **res_proto, char **res_host,
+                      int *res_port, char **res_path, int default_port)
 {
        char *proto = url;
        char *host, *path, *port_str;
@@ -668,7 +668,7 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
                        free(vpninfo->urlpath);
                        vpninfo->urlpath = NULL;
 
-                       ret = openconnect_parse_url(vpninfo->redirect_url, NULL, &host, &port, &vpninfo->urlpath, 0);
+                       ret = internal_parse_url(vpninfo->redirect_url, NULL, &host, &port, &vpninfo->urlpath, 0);
                        if (ret) {
                                vpninfo->progress(vpninfo, PRG_ERR, "Failed to parse redirected URL '%s': %s\n",
                                                  vpninfo->redirect_url, strerror(-ret));
@@ -1088,8 +1088,8 @@ int openconnect_set_http_proxy(struct openconnect_info *vpninfo, char *proxy)
        free(vpninfo->proxy);
        vpninfo->proxy = NULL;
 
-       ret = openconnect_parse_url(url, &vpninfo->proxy_type, &vpninfo->proxy,
-                       &vpninfo->proxy_port, NULL, 80);
+       ret = internal_parse_url(url, &vpninfo->proxy_type, &vpninfo->proxy,
+                                &vpninfo->proxy_port, NULL, 80);
        if (ret)
                goto out;
 
diff --git a/main.c b/main.c
index 98d6dae..a5969bb 100644 (file)
--- a/main.c
+++ b/main.c
@@ -484,7 +484,7 @@ int main(int argc, char **argv)
                char *scheme;
                char *group;
 
-               if (openconnect_parse_url(url, &scheme, &vpninfo->hostname, &vpninfo->port,
+               if (internal_parse_url(url, &scheme, &vpninfo->hostname, &vpninfo->port,
                              &group, 443)) {
                        fprintf(stderr, "Failed to parse server URL '%s'\n",
                                url);
index e38300f..09f0de1 100644 (file)
@@ -1197,7 +1197,7 @@ static void connect_host(auth_ui_data *ui_data)
        for (i = 0; i < host_nr; i++)
                host = host->next;
 
-       if (openconnect_parse_url(host->hostaddress, NULL,
+       if (internal_parse_url(host->hostaddress, NULL,
                      &ui_data->vpninfo->hostname, &ui_data->vpninfo->port,
                      &ui_data->vpninfo->urlpath, 443)) {
                fprintf(stderr, "Failed to parse server URL '%s'\n",
index 8540229..7d45862 100644 (file)
@@ -279,6 +279,8 @@ int parse_xml_response(struct openconnect_info *vpninfo, char *response,
 
 /* http.c */
 int process_proxy(struct openconnect_info *vpninfo, int ssl_sock);
+int internal_parse_url(char *url, char **res_proto, char **res_host,
+                      int *res_port, char **res_path, int default_port);
 
 /* ssl_ui.c */
 int set_openssl_ui(void);
index 9835b2e..75118fb 100644 (file)
@@ -96,7 +96,5 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo);
 void openconnect_close_https(struct openconnect_info *vpninfo);
 char *openconnect_create_useragent(char *base);
 void openconnect_init_openssl(void);
-int openconnect_parse_url(char *url, char **res_proto, char **res_host,
-                         int *res_port, char **res_path, int default_port);
 
 #endif /* __OPENCONNECT_H__ */
diff --git a/ssl.c b/ssl.c
index a7f30da..65a2871 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -605,7 +605,7 @@ int match_cert_hostname(struct openconnect_info *vpninfo, X509 *peer_cert)
                        if (strlen(str) != len)
                                continue;
 
-                       if (openconnect_parse_url(str, &url_proto, &url_host, &url_port, &url_path, 0)) {
+                       if (internal_parse_url(str, &url_proto, &url_host, &url_port, &url_path, 0)) {
                                OPENSSL_free(str);
                                continue;
                        }
@@ -903,7 +903,7 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
                                    (!strncmp(proxies[i], "http://", 7) ||
                                     !strncmp(proxies[i], "socks://", 8) ||
                                     !strncmp(proxies[i], "socks5://", 9)))
-                                       openconnect_parse_url(proxies[i], &vpninfo->proxy_type,
+                                       internal_parse_url(proxies[i], &vpninfo->proxy_type,
                                                  &vpninfo->proxy, &vpninfo->proxy_port,
                                                  NULL, 0);
                                i++;