diff -Nurd -x*.[Poa] -x*.orig -xMakefile -x.deps freeciv/client/gui-gtk/clinet.c freeciv+http_proxy/client/gui-gtk/clinet.c
--- freeciv/client/gui-gtk/clinet.c Wed May 12 12:40:46 1999
+++ freeciv+http_proxy/client/gui-gtk/clinet.c Wed May 19 01:26:19 1999
@@ -208,19 +208,22 @@
}
s[0] = '\0';
++s;
+ while (isdigit(s[0])) {++s;}
} else {
- s = server;
port = 80;
- }
-
- if ((s = strchr(s,'/'))) {
+ if (!(s = strchr(server,'/'))) {
+ s = &server[strlen(server)];
+ }
+ } /* s now points past the host[:port] part */
+
+ if (s[0] == '/') {
s[0] = '\0';
++s;
- } else {
- strcpy(errbuf, "Invalid metaserver URL, check $http_proxy value");
+ } else if (s[0]) {
+ strcpy(errbuf, "Invalid $http_proxy value, cannot find separating '/'");
+ /* which is obligatory if more characters follow */
return -1;
}
-
urlpath = s;
}
@@ -246,9 +249,10 @@
}
f=fdopen(s,"r+");
- fprintf(f,"GET /%s%s HTTP/1.0\r\n\r\n",
- urlpath,
- proxy_url ? METALIST_ADDR : "");
+ fprintf(f,"GET %s%s%s HTTP/1.0\r\n\r\n",
+ proxy_url ? "" : "/",
+ urlpath,
+ proxy_url ? METALIST_ADDR : "");
fflush(f);
#define NEXT_FIELD p=strstr(p,"
"); if(p==NULL) continue; p+=4;
diff -Nurd -x*.[Poa] -x*.orig -xMakefile -x.deps freeciv/client/gui-xaw/clinet.c freeciv+http_proxy/client/gui-xaw/clinet.c
--- freeciv/client/gui-xaw/clinet.c Wed May 12 12:40:47 1999
+++ freeciv+http_proxy/client/gui-xaw/clinet.c Wed May 19 01:04:45 1999
@@ -183,7 +183,7 @@
struct hostent *ph;
int s;
FILE *f;
- char *proxy_url;
+ char *proxy_url = (char *)NULL;
char urlbuf[512];
char *urlpath;
char *server;
@@ -214,19 +214,22 @@
}
s[0] = '\0';
++s;
+ while (isdigit(s[0])) {++s;}
} else {
- s = server;
port = 80;
- }
-
- if ((s = strchr(s,'/'))) {
+ if (!(s = strchr(server,'/'))) {
+ s = &server[strlen(server)];
+ }
+ } /* s now points past the host[:port] part */
+
+ if (s[0] == '/') {
s[0] = '\0';
++s;
- } else {
- strcpy(errbuf, "Invalid metaserver URL, check $http_proxy value");
+ } else if (s[0]) {
+ strcpy(errbuf, "Invalid $http_proxy value, cannot find separating '/'");
+ /* which is obligatory if more characters follow */
return -1;
}
-
urlpath = s;
}
@@ -252,9 +255,10 @@
}
f=fdopen(s,"r+");
- fprintf(f,"GET /%s%s HTTP/1.0\r\n\r\n",
- urlpath,
- proxy_url ? METALIST_ADDR : "");
+ fprintf(f,"GET %s%s%s HTTP/1.0\r\n\r\n",
+ proxy_url ? "" : "/",
+ urlpath,
+ proxy_url ? METALIST_ADDR : "");
fflush(f);
#define NEXT_FIELD p=strstr(p," | "); if(p==NULL) continue; p+=4;
|