aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/urlapi-int.h5
-rw-r--r--lib/urlapi.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/urlapi-int.h b/lib/urlapi-int.h
index a57d2e22b..75a360542 100644
--- a/lib/urlapi-int.h
+++ b/lib/urlapi-int.h
@@ -30,4 +30,9 @@ bool Curl_is_absolute_url(const char *url, char *scheme, size_t buflen);
char *Curl_concat_url(const char *base, const char *relurl);
size_t Curl_strlen_url(const char *url, bool relative);
void Curl_strcpy_url(char *output, const char *url, bool relative);
+
+#ifdef DEBUGBUILD
+CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname);
+#endif
+
#endif /* HEADER_CURL_URLAPI_INT_H */
diff --git a/lib/urlapi.c b/lib/urlapi.c
index 21942ebad..5cbda6a98 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -67,6 +67,12 @@ struct Curl_URL {
#define DEFAULT_SCHEME "https"
+#ifdef DEBUGBUILD
+#define UNITTEST
+#else
+#define UNITTEST static
+#endif
+
static void free_urlhandle(struct Curl_URL *u)
{
free(u->scheme);
@@ -488,7 +494,7 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u,
return result;
}
-static CURLUcode parse_port(struct Curl_URL *u, char *hostname)
+UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname)
{
char *portptr = NULL;
char endbracket;
@@ -845,7 +851,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
if(result)
return result;
- result = parse_port(u, hostname);
+ result = Curl_parse_port(u, hostname);
if(result)
return result;