Fri 27 Dec 2013 04:58:24 AM UTC, comment #1:
This bug cannot be reproduced. I have set up the exact same environment as described in the bug report. A Python BaseHTTPServer with protocol_version = HTTP/1.0.
Wget does indeed close the connection after each request and creates a new connection. This is evidently seen in the debug output:
```
Running Test Test Debian #701032
/home/sauron/Programming/wget/src/wget -d --user=Sauron --password=TheEye 127.0.0.1:35404/File1
['/home/sauron/Programming/wget/src/wget', '-d', '--user=Sauron', '--password=TheEye', '127.0.0.1:35404/File1']
Setting --user (user) to Sauron
Setting --password (password) to TheEye
DEBUG output created by Wget 1.14.99-fb23 on linux-gnu.
URI encoding = ‘UTF-8’
--2013-12-27 10:15:23-- http://127.0.0.1:35404/File1
Host ‘127.0.0.1’ has not issued a general basic challenge.
Connecting to 127.0.0.1:35404... connected.
Created socket 3.
Releasing 0x0000000001859b80 (new refcount 0).
Deleting unused 0x0000000001859b80.
---request begin---
GET /File1 HTTP/1.1
User-Agent: Wget/1.14.99-fb23 (linux-gnu)
Accept: /
Host: 127.0.0.1:35404
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response... 127.0.0.1 - - [27/Dec/2013 10:15:23] "GET /File1 HTTP/1.1" 401 -
Unable to Authenticate
---response begin---
HTTP/1.0 401 Authorization Required
Server: BaseHTTP/0.6 Python/3.3.3
Date: Fri, 27 Dec 2013 04:45:23 GMT
WWW-Authenticate: Basic realm="Wget-Test"
---response end---
401 Authorization Required
Registered socket 3 for persistent reuse.
] done.
Inserted ‘127.0.0.1’ into basic_authed_hosts
Disabling further reuse of socket 3.
Closed fd 3
Connecting to 127.0.0.1:35404... connected.
Created socket 3.
Releasing 0x00000000018599e0 (new refcount 0).
Deleting unused 0x00000000018599e0.
---request begin---
GET /File1 HTTP/1.1
User-Agent: Wget/1.14.99-fb23 (linux-gnu)
Accept: /
Host: 127.0.0.1:35404
Connection: Keep-Alive
Authorization: Basic U2F1cm9uOlRoZUV5ZQ==
---request end---
HTTP request sent, awaiting response... 127.0.0.1 - - [27/Dec/2013 10:15:23] "GET /File1 HTTP/1.1" 200 -
---response begin---
HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.3.3
Date: Fri, 27 Dec 2013 04:45:23 GMT
Content-type: text/plain
Content-Length: 24
---response end---
200 OK
Registered socket 3 for persistent reuse.
Length: 24 [text/plain]
Saving to: ‘File1’
100%[====================================================================================================================>] 24 --.-K/s in 0s
2013-12-27 10:15:23 (2.34 MB/s) - ‘File1’ saved [24/24]
```
Also, addressing a question about no auth string sent in the first request, that is the default behaviour of Wget for identification of the auth protocol. This can be overridden by using the switch --auth-no-challenge so it won't wait for a challenge from the server and will instead send the credentials in the first request itself.
|