X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fhttp.c;h=9f274dc618abc8c65acbfe2e001206acf7ff7c54;hb=eee1589ef3d198a21635d15c9086df2b99f9013d;hp=d63c0e2317dd3f421f6cbff8edb3209b9389a98f;hpb=90896e3314dc1741fbfa9ac53631af43ca7b530e;p=wget diff --git a/src/http.c b/src/http.c index d63c0e23..9f274dc6 100644 --- a/src/http.c +++ b/src/http.c @@ -1983,6 +1983,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy, exec_name, quote (relevant->host)); return HOSTERR; } + else if (sock != -1) + { + sock = -1; + } } if (sock < 0) @@ -2778,8 +2782,7 @@ read_header: } /* Return if we have no intention of further downloading. */ - if ((!(*dt & RETROKF) && !opt.content_on_error) || head_only - || (opt.method && strcasecmp (opt.method, "get") != 0)) + if ((!(*dt & RETROKF) && !opt.content_on_error) || head_only) { /* In case the caller cares to look... */ hs->len = 0; @@ -3700,7 +3703,8 @@ digest_authentication_encode (const char *au, const char *user, param_token name, value; - realm = opaque = nonce = qop = algorithm = NULL; + realm = opaque = nonce = qop = NULL; + algorithm = "MD5"; au += 6; /* skip over `Digest' */ while (extract_param (&au, &name, &value, ',')) @@ -3782,7 +3786,7 @@ digest_authentication_encode (const char *au, const char *user, md5_finish_ctx (&ctx, hash); dump_hash (a2buf, hash); - if (!strcmp(qop, "auth") || !strcmp (qop, "auth-int")) + if (qop && (!strcmp(qop, "auth") || !strcmp (qop, "auth-int"))) { /* RFC 2617 Digest Access Authentication */ /* generate random hex string */ @@ -3832,7 +3836,7 @@ digest_authentication_encode (const char *au, const char *user, res = xmalloc (res_size); - if (!strcmp(qop,"auth")) + if (qop && !strcmp (qop, "auth")) { res_len = snprintf (res, res_size, "Digest "\ "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\""\