1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-27 18:21:14 +03:00

Split HttpEngine into 3 interceptors.

BridgeInterceptor does some basic header management and implements gzip
on responses.

CacheInterceptor implements HTTP response caching.

ConnectInterceptor takes the StreamAllocation that's already allocated
and uses it to create an HttpStream.
This commit is contained in:
jwilson
2016-06-26 08:08:35 -04:00
parent 5c7bbf6f9e
commit e3b3180f9c
18 changed files with 633 additions and 641 deletions

View File

@@ -31,7 +31,7 @@ import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.internal.Platform;
import okhttp3.internal.http.HttpEngine;
import okhttp3.internal.http.OkHeaders;
import okio.Buffer;
import okio.BufferedSource;
@@ -229,7 +229,7 @@ public final class HttpLoggingInterceptor implements Interceptor {
logger.log(headers.name(i) + ": " + headers.value(i));
}
if (!logBody || !HttpEngine.hasBody(response)) {
if (!logBody || !OkHeaders.hasBody(response)) {
logger.log("<-- END HTTP");
} else if (bodyEncoded(response.headers())) {
logger.log("<-- END HTTP (encoded body omitted)");