1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-27 04:22:07 +03:00

Merge pull request #424 from lingmingyb/nullpointer

Connected after everything is initialized
This commit is contained in:
Jesse Wilson
2014-01-09 08:58:45 -08:00

View File

@@ -109,7 +109,6 @@ public final class Connection implements Closeable {
throws IOException {
if (connected) throw new IllegalStateException("already connected");
connected = true;
socket = (route.proxy.type() != Proxy.Type.HTTP) ? new Socket(route.proxy) : new Socket();
Platform.get().connectSocket(socket, route.inetSocketAddress, connectTimeout);
socket.setSoTimeout(readTimeout);
@@ -121,6 +120,7 @@ public final class Connection implements Closeable {
} else {
streamWrapper();
}
connected = true;
}
/**