shazow/urllib3 — pull request #26 by piotr-dobrogost (2011-12-22 22:19:02+00:00)
Title: Add identity to connections and connection pools.

After this output from `test/with_dummyserver/test_connectionpool.py` looks like this

````
Finding files... done.
Importing test modules ... done.

HTTPConnectionPool, localhost:18081 (1): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (1): "GET /encodingrequest HTTP/1.1" 200 21
HTTPConnectionPool, localhost:18081 (1): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (2): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (2): "GET /encodingrequest HTTP/1.1" 200 33
HTTPConnectionPool, localhost:18081 (2): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (4): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (4): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (4): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (4): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (4): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (4): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (4): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (4): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (4): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (6): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (6): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (6): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (6): Starting new (2) HTTP connection
HTTPConnectionPool, localhost:18081 (6): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (6): Starting new (3) HTTP connection
HTTPConnectionPool, localhost:18081 (6): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (6): Connection HTTPConnection (3) returned to the pool
HTTPConnectionPool, localhost:18081 (6): Starting new (4) HTTP connection
HTTPConnectionPool, localhost:18081 (6): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (6): Connection HTTPConnection (4) returned to the pool
HTTPConnectionPool, localhost:18081 (6): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (6): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (6): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (7): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (7): "GET /specific_method?method=GET HTTP/1.1" 200 0
HTTPConnectionPool, localhost:18081 (7): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (9): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (9): "GET /keepalive?close=0 HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (9): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (9): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (9): "GET /keepalive?close=0 HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (9): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (11): "GET /keepalive?close=1 HTTP/1.1" 200 7
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (11): "GET /keepalive?close=0 HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (11): "GET /keepalive?close=1 HTTP/1.1" 200 7
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (11): "GET /keepalive?close=0 HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (11): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (13): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (13): "POST /echo HTTP/1.1" 200 2140
HTTPConnectionPool, localhost:18081 (13): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (14): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (14): "GET /redirect?target=%2F HTTP/1.1" 303 112
HTTPConnectionPool, localhost:18081 (14): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (14): Redirecting /redirect?target=%2F -> http://localhost:18081/
HTTPConnectionPool, localhost:18081 (16): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (16): "GET /echo?lol=cat HTTP/1.1" 200 7
HTTPConnectionPool, localhost:18081 (16): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (17): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (17): "POST /specific_method HTTP/1.1" 200 0
HTTPConnectionPool, localhost:18081 (17): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (18): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (18): "POST /echo HTTP/1.1" 200 289
HTTPConnectionPool, localhost:18081 (18): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (19): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (19): "POST /echo HTTP/1.1" 200 22
HTTPConnectionPool, localhost:18081 (19): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (20): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (20): "GET /redirect?target=%2F HTTP/1.1" 303 112
HTTPConnectionPool, localhost:18081 (20): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (20): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (20): "GET /redirect?target=%2F HTTP/1.1" 303 112
HTTPConnectionPool, localhost:18081 (20): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (20): Redirecting /redirect?target=%2F -> http://localhost:18081/
HTTPConnectionPool, localhost:18081 (20): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (20): "GET http://localhost:18081/ HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (20): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (22): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (22): "GET / HTTP/1.1" 200 13
HTTPConnectionPool, localhost:18081 (24): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (24): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (25): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (25): "POST /upload HTTP/1.1" 200 0
HTTPConnectionPool, localhost:18081 (25): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (26): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (26): "POST /upload HTTP/1.1" 200 0
HTTPConnectionPool, localhost:18081 (26): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (27): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (27): "PUT /specific_method?method=PUT HTTP/1.1" 200 0
HTTPConnectionPool, localhost:18081 (27): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (28): Starting new (1) HTTP connection
HTTPConnectionPool, localhost:18081 (28): "GET /specific_method?method=POST HTTP/1.1" 400 25
HTTPConnectionPool, localhost:18081 (28): Connection HTTPConnection (1) returned to the pool
HTTPConnectionPool, localhost:18081 (28): Connection HTTPConnection (1) fetched from pool
HTTPConnectionPool, localhost:18081 (28): "POST /specific_method HTTP/1.1" 400 25
HTTPConnectionPool, localhost:18081 (28): Connection HTTPConnection (1) returned to the pool
----------------------------------------------------------------------
Ran 20 tests in 25.196s

OK
```