This makes it much easier to test if the call was canceled.
Note that the Call's request is always the original user request.
This is different than the previous request that was passed in, as
that could have been the follow up to a redirect.
Still some work to do on method naming, but this was the interesting part.
Also very much need to rename OkUrlFactory in tests to urlFactory, otherwise
the client.client stuff becomes madness.
Instead of having one instance of Authenticator, and that interface
defines two methods, we now have two instances of Authenticator and
that interface defines one method.
This prevents leaking request-specific configuration (the authenticator)
into shared connection configuration (the proxy authenticator).
This creates a model-like API in which individual parts can be read. It also offers the posibility of using this model to parse multipart in the future.
This eliminates the need to always send a frame for every FrameSink#write and to always send an empty frame for FrameSink#close. Now, we only emit bytes once Okio reports complete segments.
To my great delight, Java and Android can read .pem files without
the BKS or JKS store files we typically use to distribute trusted
certificates.
This recipe includes a big copy-and-pasteable method for converting
an InputStream of PEM files into an SSLContext. The rest of it is
warnings about how dangerous that is.
Closes https://github.com/square/okhttp/issues/1336
Similar to HTTP and Call, the WebSocketCall is a representation of a pending HTTP request and subsequent upgrade to speak web sockets. Upon synchronous execution you are handed a WebSocket instance for synchronous writing and also pass in a WebSocketListener for async callbacks due to reading.
The API changes in this commits also generalize WebSocket such that it's agnostic to being a client or server peer.
This was present in a bunch of loops, but not all and not consistently. After fixing two, I figured that I would normalize them all under the umbrella of uniformity and being lazy (only lookup up the value once if it never changes).