version 1.27, 2000/01/09 05:14:38 |
version 1.28, 2000/04/24 03:30:16 |
|
|
char c, *cp, *ep, *portnum, *path, buf[4096]; |
char c, *cp, *ep, *portnum, *path, buf[4096]; |
const char *savefile; |
const char *savefile; |
char *line, *proxy, *host, *port; |
char *line, *proxy, *host, *port; |
|
char *hosttail; |
volatile sig_t oldintr; |
volatile sig_t oldintr; |
off_t hashbytes; |
off_t hashbytes; |
char *cause = "unknown"; |
char *cause = "unknown"; |
|
|
return (0); |
return (0); |
} |
} |
|
|
portnum = strchr(host, ':'); /* find portnum */ |
if (*host == '[' && (hosttail = strrchr(host, ']')) != NULL && |
|
(hosttail[1] == '\0' || hosttail[1] == ':')) { |
|
host++; |
|
*hosttail++ = '\0'; |
|
} else |
|
hosttail = host; |
|
|
|
portnum = strrchr(hosttail, ':'); /* find portnum */ |
if (portnum != NULL) |
if (portnum != NULL) |
*portnum++ = '\0'; |
*portnum++ = '\0'; |
|
|
|
|
fprintf(ttyout, "Requesting %s (via %s)\n", |
fprintf(ttyout, "Requesting %s (via %s)\n", |
origline, proxyenv); |
origline, proxyenv); |
} |
} |
snprintf(buf, sizeof(buf), "GET %s%s HTTP/1.0\r\nHost: %s\r\n\r\n", |
if (strchr(host, ':')) { |
proxy ? "" : "/", path, host); |
snprintf(buf, sizeof(buf), |
|
"GET %s%s HTTP/1.0\r\nHost: [%s]:%s\r\n\r\n", |
|
proxy ? "" : "/", path, host, port); |
|
} else { |
|
snprintf(buf, sizeof(buf), |
|
"GET %s%s HTTP/1.0\r\nHost: %s:%s\r\n\r\n", |
|
proxy ? "" : "/", path, host, port); |
|
} |
len = strlen(buf); |
len = strlen(buf); |
if (write(s, buf, len) < len) { |
if (write(s, buf, len) < len) { |
warn("Writing HTTP request"); |
warn("Writing HTTP request"); |