summaryrefslogtreecommitdiff
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2000-01-07 10:59:12 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2000-01-07 10:59:12 +0000
commitf5f109a0688a24ded03803cd3b19d62ad574f13e (patch)
treea661e0adb597512fbbc53f97dae79bf6e69d10fe /lib/libfetch/http.c
parent04e8772051398d25637351f794866c6084a47229 (diff)
Notes
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 716d6c2a139f..9b32bc214f4a 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -293,13 +293,14 @@ _http_auth(char *usr, char *pwd)
FILE *
fetchGetHTTP(struct url *URL, char *flags)
{
- int sd = -1, e, i, enc = ENC_NONE, verbose;
+ int sd = -1, e, i, enc = ENC_NONE, direct, verbose;
struct cookie *c;
char *ln, *p, *px, *q;
FILE *f, *cf;
size_t len;
- verbose = (strchr(flags, 'v') != NULL);
+ direct = (flags && strchr(flags, 'd'));
+ verbose = (flags && strchr(flags, 'v'));
/* allocate cookie */
if ((c = calloc(1, sizeof(struct cookie))) == NULL)
@@ -310,14 +311,14 @@ fetchGetHTTP(struct url *URL, char *flags)
URL->port = 80; /* default HTTP port */
/* attempt to connect to proxy server */
- if ((px = getenv("HTTP_PROXY")) != NULL) {
+ if (!direct && (px = getenv("HTTP_PROXY")) != NULL) {
char host[MAXHOSTNAMELEN];
int port = 3128; /* XXX I think 3128 is default... check? */
/* measure length */
len = strcspn(px, ":");
- /* get port (atoi is a little too tolerant perhaps?) */
+ /* get port (XXX atoi is a little too tolerant perhaps?) */
if (px[len] == ':')
port = atoi(px+len+1);