diff --git a/okhttp/src/main/java/com/squareup/okhttp/Response.java b/okhttp/src/main/java/com/squareup/okhttp/Response.java
index 7da802686..276299222 100644
--- a/okhttp/src/main/java/com/squareup/okhttp/Response.java
+++ b/okhttp/src/main/java/com/squareup/okhttp/Response.java
@@ -60,15 +60,14 @@ public final class Response {
}
/**
- * The wire-level request that initiated this HTTP response. This is usually
- * not the same request instance provided to the HTTP client:
+ * The wire-level request that initiated this HTTP response. This is not
+ * necessarily the same request issued by the application:
*
* - It may be transformed by the HTTP client. For example, the client
- * may have added its own {@code Content-Encoding} header to enable
- * response compression.
- *
- It may be the request generated in response to an HTTP redirect.
- * In this case the request URL may be different than the initial
- * request URL.
+ * may copy headers like {@code Content-Length} from the request body.
+ *
- It may be the request generated in response to an HTTP redirect or
+ * authentication challenge. In this case the request URL may be
+ * different than the initial request URL.
*
*/
public Request request() {
diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpEngine.java b/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpEngine.java
index 27a6a25f1..5e1931655 100644
--- a/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpEngine.java
+++ b/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpEngine.java
@@ -509,7 +509,7 @@ public final class HttpEngine {
closeQuietly(responseBodyBytes);
// Close the connection if it cannot be reused.
- if (transport != null && !transport.canReuseConnection()) {
+ if (transport != null && connection != null && !transport.canReuseConnection()) {
closeQuietly(connection.getSocket());
connection = null;
return null;