about summary refs log tree commit diff stats
path: root/WWW/Library
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2016-11-15 09:36:45 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2016-11-15 09:36:45 -0500
commite7b70b64af3b0c7608d63db5dd2743e5d6d7843b (patch)
treec374b6977030ae0dabc6ffe8ec2ff5a54265fafa /WWW/Library
parent237a7f5139b5c46eef09f9fb0ee9205feda37d60 (diff)
downloadlynx-snapshots-e7b70b64af3b0c7608d63db5dd2743e5d6d7843b.tar.gz
snapshot of project "lynx", label v2-8-9dev_10a
Diffstat (limited to 'WWW/Library')
-rw-r--r--WWW/Library/Implementation/HTTCP.c13
-rw-r--r--WWW/Library/Implementation/HTTP.c8
-rw-r--r--WWW/Library/Implementation/HTUtils.h4
3 files changed, 10 insertions, 15 deletions
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index ff1cf9aa..54491956 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTCP.c,v 1.134 2014/12/03 01:00:40 tom Exp $
+ * $LynxId: HTTCP.c,v 1.135 2016/11/15 09:31:58 tom Exp $
  *
  *			Generic Communication Code		HTTCP.c
  *			==========================
@@ -1804,7 +1804,6 @@ int HTDoConnect(const char *url,
     int status = 0;
     char *line = NULL;
     char *p1 = NULL;
-    char *at_sign = NULL;
     char *host = NULL;
 
 #ifdef INET6
@@ -1826,14 +1825,8 @@ int HTDoConnect(const char *url,
      * Get node name and optional port number.
      */
     p1 = HTParse(url, "", PARSE_HOST);
-    if ((at_sign = StrChr(p1, '@')) != NULL) {
-	/*
-	 * If there's an @ then use the stuff after it as a hostname.
-	 */
-	StrAllocCopy(host, (at_sign + 1));
-    } else {
-	StrAllocCopy(host, p1);
-    }
+    StrAllocCopy(host, p1);
+    strip_userid(host, FALSE);
     FREE(p1);
 
     HTSprintf0(&line, "%s%s", WWW_FIND_MESSAGE, host);
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index a5be9264..08ed0c08 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTP.c,v 1.159 2016/11/08 09:38:27 tom Exp $
+ * $LynxId: HTTP.c,v 1.160 2016/11/15 09:31:41 tom Exp $
  *
  * HyperText Tranfer Protocol	- Client implementation		HTTP.c
  * ==========================
@@ -582,7 +582,7 @@ static char *fake_hostname(char *auth)
 /*
  * Strip any username from the given string so we retain only the host.
  */
-static void strip_userid(char *host)
+void strip_userid(char *host, int parse_only)
 {
     char *p1 = host;
     char *p2 = skip_user_passwd(host);
@@ -633,7 +633,7 @@ static void strip_userid(char *host)
 		       gettext("User/password may be confused with hostname: '%s' (e.g, '%s')"),
 		       auth, fake);
 	}
-	if (msg != 0)
+	if (msg != 0 && !parse_only)
 	    HTAlert(msg);
 	if (do_trimming) {
 	    while ((*p1++ = *p2++) != '\0') {
@@ -1312,7 +1312,7 @@ static int HTLoadHTTP(const char *arg,
 	char *host = NULL;
 
 	if ((host = HTParse(anAnchor->address, "", PARSE_HOST)) != NULL) {
-	    strip_userid(host);
+	    strip_userid(host, TRUE);
 	    HTBprintf(&command, "Host: %s%c%c", host, CR, LF);
 	    FREE(host);
 	}
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index d0757e55..5c221ccb 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTUtils.h,v 1.120 2014/01/19 15:18:01 tom Exp $
+ * $LynxId: HTUtils.h,v 1.121 2016/11/15 09:26:37 tom Exp $
  *
  * Utility macros for the W3 code library
  * MACROS FOR GENERAL USE
@@ -801,6 +801,8 @@ extern "C" {
 
     extern FILE *TraceFP(void);
 
+    extern void strip_userid(char *host, int warn);
+
 #ifdef USE_SSL
     extern SSL *HTGetSSLHandle(void);
     extern void HTSSLInitPRNG(void);
n class='oid'>ca93ee5a ^
8a43e6ca ^
e6b847b3 ^
e6b847b3 ^

f38066d3 ^
8a43e6ca ^





e6b847b3 ^
8a43e6ca ^
1a2145bb ^
8a43e6ca ^

9c801326 ^

e6b847b3 ^

f38066d3 ^







e6b847b3 ^

8a43e6ca ^


1a2145bb ^
8a43e6ca ^




1a2145bb ^
8a43e6ca ^


e6b847b3 ^
8a43e6ca ^
e6b847b3 ^
a9000364 ^
8a43e6ca ^


f68763ad ^
e6b847b3 ^
a9000364 ^
8a43e6ca ^



1a2145bb ^
f68763ad ^
8a43e6ca ^




e6b847b3 ^
8a43e6ca ^
f38066d3 ^

8a43e6ca ^
f38066d3 ^
8a43e6ca ^
f38066d3 ^



8a43e6ca ^
e6b847b3 ^
a9000364 ^
8a43e6ca ^


f38066d3 ^



8a43e6ca ^

e6b847b3 ^
a9000364 ^
8a43e6ca ^

878f0f57 ^
e6b847b3 ^
a9000364 ^
1a2145bb ^
e6b847b3 ^
a9000364 ^
8a43e6ca ^










e6b847b3 ^
8a43e6ca ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135