1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-17 08:42:25 +03:00
Commit Graph

2114 Commits

Author SHA1 Message Date
jwilson
d0a381edc1 [maven-release-plugin] prepare release parent-2.6.0 parent-2.6.0 2015-11-22 12:30:31 -05:00
jwilson
8724227ca9 Changelog for OkHttp 2.6.0. 2015-11-22 12:26:09 -05:00
Jesse Wilson
ae7c732b10 Merge pull request #2020 from square/jwilson_1121_http2_no_nulls
Fix HTTP/2 bug where we were using SPDY/3 style header concatenation.
2015-11-22 10:25:59 -05:00
jwilson
bf560c1b25 Fix HTTP/2 bug where we were using SPDY/3 style header concatenation.
When multiple headers have the same value in SPDY/3, they are concantenated
and separated by \u0000.

When multiple headers have the same value in HTTP/2, they are each written
independently.

This fixes the problem and rearranges the code to share less behavior than
previously. It gets us closer to being able to drop SPDY/3.

Closes https://github.com/square/okhttp/issues/1906
2015-11-22 10:25:50 -05:00
Jesse Wilson
85310b1f88 Merge pull request #2013 from square/jwilson_1118_less_flaky
Fix flakiness in CallTest.cancelTagImmediatelyAfterEnqueue()
2015-11-18 23:43:45 -05:00
jwilson
e36d7ecc26 Fix flakiness in CallTest.cancelTagImmediatelyAfterEnqueue()
There's a race where the HTTP engine has been created, but not yet connected
and the cancel isn't as immediate as it could be. Fix the test by making sure
there's a response to be retrieved.

With the upcoming connection pool changes we might make the implementation
more robust.

Closes: https://github.com/square/okhttp/issues/2001
2015-11-18 23:00:33 -05:00
Jesse Wilson
f2cf770162 Merge pull request #2008 from square/jwilson_1117_more_connections
Stop returning HTTP/1.0 from Connection.getProtocol().
2015-11-18 00:08:33 -05:00
jwilson
529c4a36bb Stop returning HTTP/1.0 from Connection.getProtocol().
This was updating the protocol as a side-effect of an HTTP/1.0 response.
This made the protocol field mutable, and the code more difficult to
trace.

One consequence of this change is that OkHttp will attempt HTTP/1.1 for
all requests, even if a server returns HTTP/1.0 from the first response.
This is closer to our implementation anyway.
2015-11-18 00:01:54 -05:00
Jake Wharton
3edddd1127 Merge pull request #2004 from square/jw/options-allows-body
OPTIONS allows body.
2015-11-16 14:18:19 -05:00
Jake Wharton
607f4f4322 OPTIONS allows body.
> If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed queries on the server. A server that does not support such an extension MAY discard the request body.
2015-11-16 12:19:05 -05:00
Jesse Wilson
e57ba121a4 Merge pull request #1999 from square/jw/consumers-close
Force consumers to call WS#close on IO error.
2015-11-15 16:24:11 -05:00
Jake Wharton
5279518f47 Merge pull request #2000 from square/jwilson_1114_tunnel
Don't use the request to build the proxy tunnel.
2015-11-14 23:42:43 -05:00
jwilson
457fb428a7 Don't use the request to build the proxy tunnel.
The tunnel is shared between requests, and it's awkward to build that with the
first request that needs it.
2015-11-14 22:28:47 -05:00
Jake Wharton
d7a0930910 Force consumers to call WS#close on IO error. 2015-11-14 19:02:56 -05:00
Jesse Wilson
8d71cb8e37 Merge pull request #1996 from square/jw/fail-after-IO
Break apart close states. Try to send close on IOE.
2015-11-14 11:09:14 -08:00
Jake Wharton
38df77497a Break apart close states. Try to send close on IOE.
This breaks apart the states used to track sending a close message and whether or not the connection has been closed. Prior to this, certain threading orders would allow multiple calls to close() which would attempt to remove ownership of the connection, the second of which would fail.
2015-11-14 03:33:55 -05:00
Jesse Wilson
6d2dcf2cc5 Merge pull request #1995 from square/jwilson_1113_plus_is_space
Permit space to be encoded as + or %20.
2015-11-13 23:18:42 -08:00
jwilson
0b1d20c47c Permit space to be encoded as + or %20.
Previously we forced %20, which offended some broken web servers.

Closes https://github.com/square/okhttp/issues/1920
2015-11-13 23:07:53 -08:00
Jesse Wilson
cc821ff316 Merge pull request #1991 from sunyal/sunyal/javadoc_fix
Correct the Javadoc description
2015-11-12 07:17:11 -08:00
abeggs
28dbfc6199 Correct the Javadoc description 2015-11-12 10:13:05 -05:00
Jake Wharton
2800d8153e Merge pull request #1987 from square/jwilson_1110_filename
Include a filename in the PostMultipart example.
2015-11-11 02:51:08 -05:00
jwilson
7722f32b6c Include a filename in the PostMultipart example.
Closes: https://github.com/square/okhttp/issues/1521
2015-11-10 23:49:52 -08:00
Jesse Wilson
4fd3f57b9f Merge pull request #1982 from square/jwilson_1108_allocations
Connection allocations model.
2015-11-09 08:13:23 -05:00
jwilson
49a3313853 Connection allocations model.
This is intended to replace some of the state machines in HttpConnection, HttpEngine,
and ConnectionPool. With this we'll keep track of all streams in flight, not just
the connections currently idle.

Note that I've sketched this out into a new Connection.java class. In a follow up
change I'll attempt to combine this with the existing Connection class.
2015-11-09 08:12:54 -05:00
Jake Wharton
87592d9fec Merge pull request #1980 from square/jwilson_1107_failing_test
New failing test for HTTP/2 connection interference.
2015-11-08 21:15:39 +00:00
jwilson
f92348de5c New failing test for HTTP/2 connection interference. 2015-11-07 16:02:13 -05:00
jwilson
4330e45998 Merge branch 'nfuller-FixWriteTimeouts'
* nfuller-FixWriteTimeouts:
  Fix URLConnectionTest.writeTimeouts with large receive buffers
2015-11-06 20:14:45 -05:00
Neil Fuller
8b19bc471f Fix URLConnectionTest.writeTimeouts with large receive buffers
The test relies on small client send / server receive buffers
to force blocking and generate a timeout.

The switch to make MockWebServer a @Rule (commit
785d9e9438) moved the
MockWebServer.start() call earlier in the test execution.
Setting the ServerSocketFactory became a no-op so the server
receive buffer size was left as the default.

The test became reliant on either:
1) The default server socket receive buffer being small enough
(e.g. less than the data being transmitted).
2) The device being too slow to send the requested data in the
time allowed.

The test was recently made less reliable by:
1) The okio commit
f30955cb15eb234f874dd55819686832c960765b, which made the segment
size bigger (increasing throughput / transfer efficiency).
2) The OkHttp commit f30955cb15eb234f874dd55819686832c960765b,
which reduced the amount of data being sent in the test from
16MB to 2MB.
3) Recent Android devices have large default buffer sizes. e.g.
Nexus 5: 1MB, Nexus 5X: 6MB.
2015-11-06 20:14:35 -05:00
Jesse Wilson
9575e7afdb Merge pull request #1970 from square/jwilson_1104_nonascii_fragment
Don't percent-encode non-ASCII characters in fragments
2015-11-06 00:03:07 -05:00
jwilson
f4feb0adfc Don't percent-encode non-ASCII characters in fragments
Fixes https://github.com/square/okhttp/issues/1635
2015-11-05 23:56:37 -05:00
Jake Wharton
3f3c7640ad Merge pull request #1971 from square/jwilson_1105_drop_dss
Drop our one remaining DSS cipher suite.
2015-11-05 13:54:09 +01:00
jwilson
868ee84445 Drop our one remaining DSS cipher suite.
Tracking Chrome and Firefox, which have also dropped this cipher suite.

This is the only cipher suite change since the last update. See our cipher
suites spreadsheet for a comparison: https://goo.gl/dWXbi0

Closes https://github.com/square/okhttp/issues/1476
2015-11-05 01:06:10 -05:00
Jesse Wilson
65b43ff3a6 Merge pull request #1967 from square/jwilson_1103_custom_dns
Make the DNS service pluggable.
2015-11-04 09:35:07 -05:00
jwilson
38c6e610f1 Make the DNS service pluggable.
It was already pluggable as the internal class named Network. Now it's
exposed as a public interface called DNS.
2015-11-04 09:25:20 -05:00
Jesse Wilson
904f761143 Merge pull request #1963 from square/jwilson_1102_connectionspec
Make ConnectionSpec more uniform.
2015-11-02 22:19:42 -05:00
jwilson
784fc03fd4 Make ConnectionSpec more uniform.
Closes https://github.com/square/okhttp/issues/1831
2015-11-02 22:19:32 -05:00
Jesse Wilson
f20329132f Merge pull request #1960 from square/jw/disconnect-request-halfway
Add policy for disconnecting request body halfway.
2015-11-01 22:22:45 -05:00
Jake Wharton
bbd028c95f Add policy for disconnecting request body halfway. 2015-11-01 23:10:53 +00:00
Jesse Wilson
41a600eee4 Merge pull request #1959 from square/jwilson_1101_uri
Encode enough to make URI happy.
2015-11-01 12:45:49 -05:00
jwilson
080e7536ab Encode enough to make URI happy.
Plus a bunch of test cases around this unfortunate case.

Closes https://github.com/square/okhttp/issues/1872
2015-11-01 12:32:27 -05:00
Jake Wharton
071efc6451 Merge pull request #1956 from square/jwilson_1030_null_fragment
Handle null fragments.
2015-11-01 02:38:49 +00:00
Jake Wharton
26efb805c6 Merge pull request #1957 from square/jwilson_1031_interceptors_return_null
Throw the right exception if an interceptor returns null.
2015-11-01 02:26:57 +00:00
Jesse Wilson
d34371c347 Merge pull request #1958 from markhobson/master
Log favicon request instead of using standard output
2015-10-31 17:28:24 -04:00
jwilson
a84e9c83c4 Throw the right exception if an interceptor returns null.
Previously we were treating null as a sentinel 'canceled' value
for application interceptors, and crashing on network interceptors.

Closes https://github.com/square/okhttp/issues/1921
2015-10-31 15:02:33 -04:00
Mark Hobson
bebea4679e Log favicon request instead of using standard output 2015-10-31 18:58:14 +00:00
jwilson
e4dd6cfd63 Handle null fragments. 2015-10-31 09:02:12 -04:00
Jesse Wilson
876db04850 Merge pull request #1848 from yschimke/use_x-www-form-urlencoded
use application/x-www-form-urlencoded in okcurl
2015-10-29 23:13:29 -04:00
Jesse Wilson
c894fd1016 Merge pull request #1885 from iagreen/master.better-uri-encoding
use URI constructor for encoding
2015-10-29 23:12:04 -04:00
Jesse Wilson
c429ab5335 Merge pull request #1939 from nfuller/FixHttpUrlConnectionFollowRedirects
Fix Http(s)URLConnectionImpl.getInstanceFollowsRedirects()
2015-10-29 23:06:23 -04:00
Jesse Wilson
403e127cf2 Merge pull request #1944 from square/jwilson_1026_update_javadoc_links
Update links to Javadoc.
2015-10-26 17:41:16 -04:00