Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename openconnect_parse_url() to internal_parse_url()
We only need to expose a simpler version of this

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 9, 2011
1 parent 21d459d commit 4c4531a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions http.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion nm-auth-dialog.c
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions openconnect-internal.h
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions openconnect.h
Expand Up @@ -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__ */
4 changes: 2 additions & 2 deletions ssl.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit 4c4531a

Please sign in to comment.