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.
When an interceptor changes the request from a method that doesn't use
a request body to a request method that requires a body, the connection
times out because no body will be sent.
Commit 765a965 (pr #1835) did not modify all the necessary lines
when changing the configureSocket() method over from a
modify-in-place to a return-modified pattern. The problem
only shows up on Android where the behavior is required for
TLS_FALLBACK_SCSV tests to work.
There are a few cases in OkHttp where API calls don't exist on
Android, but this is one that we can work around with any loss
of understanding.
The same test also behaves differently on Android due to
differences between the OpenJDK and Android's
HttpURLConnection implementation.
See issue #1824.
Before this change HttpURLConnection would parse the bad ASCII
characters like \u0001, but fail when setting them in the host
header.
After this change HttpURLConnection throws UnknownHostException.
Earlier versions of OkHttp would escape the bad characters, but
this behavior has not been retained.
Fix for issue #1833.
This change involves a behavior change for HttpUrl, and consequently
HttpURLConnectionImpl.
Modify the various Delegating*SocketFactory implementations
to return a *Socket from configureSocket() rather than assume
configuration just modifies the object supplied. Improves
flexibility and reduces the need to override multiple methods
in some places.
Related to issue #1790.
If there is a *connection* timeout the next route should
be tried. Timeouts during a request/response should
probably not be retried.
The timeout/interrupt behavior was changed in PR #1257
for issue #1146. This modified both connection and
request/response behavior. The issue reported was actually
about the use of Thread.interrupt(), not timeouts, but the
behavior change modified both behavior for interrupt and
timeout.
PR #1388 split the handling of exceptions so that separate
code now handles connection errors from that which handles
request/response errors. It faithfully kept the behavior
from PR #1257.
The modification of the timeout behavior during *connection*
caused problems on Android. Now that the two types of error
handling are split it's possible to deal with them
differently and return the connection behavior to trying
the next route. This does not modify behavior during
request/response.
The previous wording made it sound like any connection that was ongoing
for more than 10 seconds (e.g. a download of a large file) would be
disconnected.