dakrone/clj-http — pull request #151 by joelittlejohn (2013-08-01 13:23:54+00:00)
Title: Don't shutdown reusable connection manager on error

When a request fails, only shutdown the connection manager if it's
single use. If the connection manager is reusable, it should be left
open so that it can be used by subsequent requests.

Closes #150.

Note: I've tried to keep the behaviour for `coerce-body-entity` and the `Connection: close` header identical to how it existed before my changes, just in-case anyone is doing something strange like implementing their own `ClientConnManager`. This means that I define `clj-http.conn-mgr/reusable?` like:

```clj
(defn reusable? [^ClientConnectionManager conn-mgr]
(not (or (instance? SingleClientConnManager conn-mgr)
(instance? BasicClientConnectionManager conn-mgr))))
```

instead of:

```clj
(defn reusable? [^ClientConnectionManager conn-mgr]
(instance? PoolingClientConnectionManager conn-mgr))
```

even though the latter might seem a bit more intuitive. The end result is that custom ClientConnectionManager types are still treated as reusable, not single-use.