Browse code

respect HTTPProxyPort in new code (bb#1094)

git-svn: trunk@3941

Tomasz Kojm authored on 2008/07/14 17:58:40
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Jul 14 10:32:26 CEST 2008 (tk)
2
+----------------------------------
3
+  * freshclam/manager.c: respect HTTPProxyPort in new code (bb#1094)
4
+
1 5
 Fri Jul 11 20:14:14 CEST 2008 (tk)
2 6
 ----------------------------------
3 7
   * freshclam: IPv6 support (bb#715)
... ...
@@ -186,6 +186,7 @@ static int wwwconnect(const char *server, const char *proxy, int pport, char *ip
186 186
 	int socketfd, port, ret;
187 187
 #ifdef SUPPORT_IPv6
188 188
 	struct addrinfo hints, *res = NULL, *rp;
189
+	char port_s[6];
189 190
 #else
190 191
 	struct sockaddr_in name;
191 192
 	struct hostent *host;
... ...
@@ -227,7 +228,9 @@ static int wwwconnect(const char *server, const char *proxy, int pport, char *ip
227 227
     memset(&hints, 0, sizeof(hints));
228 228
     hints.ai_family = AF_UNSPEC;
229 229
     hints.ai_socktype = SOCK_STREAM;
230
-    ret = getaddrinfo(hostpt, "80", &hints, &res);
230
+    snprintf(port_s, sizeof(port_s), "%d", port);
231
+    port_s[sizeof(port_s) - 1] = 0;
232
+    ret = getaddrinfo(hostpt, port_s, &hints, &res);
231 233
     if(ret) {
232 234
 	logg("%cCan't get information about %s: %s\n", logerr ? '!' : '^', hostpt, gai_strerror(ret));
233 235
 	return -1;