1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-26 06:43:09 +03:00
Commit Graph

180 Commits

Author SHA1 Message Date
Dave Roberge
fb83491cc6 Ensure discarded HTTP/2 data frames free flow-control space. (#4033)
https://github.com/square/okhttp/issues/3915
2018-05-29 22:39:09 -04:00
Jesse Wilson
e86eb0e48b [maven-release-plugin] prepare for next development iteration 2018-02-24 13:33:57 -05:00
Jesse Wilson
c0739a4199 [maven-release-plugin] prepare release parent-3.10.0 2018-02-24 13:33:52 -05:00
Jesse Wilson
27c8a79302 First step towards HTTP/2 automatic pings. (#3874)
This changes the executor services in HTTP/2 connection to split up
listener executors (of which there may be many threads) from writer
executors (of which there is one per connection).

This adds a scheduled executor job to send pings on an interval. We
don't yet fail the connection if pongs are not received.

For follow-up there's some work to remove exising APIs to send pings
through the HTTP/2 APIs. These are unused and make it awkard to
confirm that only the automatic pings are being replied to.

See https://github.com/square/okhttp/issues/3261
2018-02-21 20:19:08 -05:00
Tobias Thierer
f704f9d30e OkHttpsURLConnection.setSSLSocketFactory(null): throw.
OkHttpsURLConnection extends javax.net.ssl.HttpsURLConnection.
The super class documentation says that setSSLSocketFactory(null)
throws IllegalArgumentException, but this implementation didn't
do that.

This CL fixed OkHttpsURLConnection.setSSLSocketFactory(null) to
throw, as specified.

Test: not done locally, relying on Travis.
2018-02-21 11:05:02 +00:00
Eric Cochran
2db8c41b3b Move and test toHumanReadableAscii. (#3851) 2018-02-18 06:57:59 -05:00
Yuri Schimke
14215b8b3f cleanup travis output (#3853) 2018-02-17 09:25:41 -05:00
Jesse Wilson
d0418379a7 Move MockWebServer's internal package to not collide with OkHttp's. (#3837)
Hoping this may prevent problems with the Java Platform Module System.
2018-02-09 06:20:57 +00:00
Yuri Schimke
d27531afa9 Use manifest entry for java 9 module name (#3743)
* Use manifest entry for java 9 module name

* add group

* specific names

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml
2018-02-04 03:02:20 -05:00
Jesse Wilson
2bb2dc4340 [maven-release-plugin] prepare for next development iteration 2017-11-18 14:38:02 -05:00
Jesse Wilson
23b6f7556d [maven-release-plugin] prepare release parent-3.9.1 2017-11-18 14:37:50 -05:00
jwilson
51311219af [maven-release-plugin] prepare for next development iteration 2017-09-04 17:00:21 -04:00
jwilson
51663fd08f [maven-release-plugin] prepare release parent-3.9.0 2017-09-04 17:00:16 -04:00
Erik Ghonyan
b3ecb0a6c9 Add charset support for RFC 7617 challenges 2017-08-31 16:18:55 -04:00
jwilson
304d2c9630 [maven-release-plugin] prepare for next development iteration 2017-05-13 10:58:15 -04:00
jwilson
cb981daecf [maven-release-plugin] prepare release parent-3.8.0 2017-05-13 10:58:04 -04:00
jwilson
e7e22feb12 Fix Javadoc builds with the jsr305 dependency.
Because multiple modules share a package we need to share the dependency on
everything in package-info.java.
2017-05-13 10:51:29 -04:00
jwilson
83b9dd4275 Upgrade to Checktyle 7.7.
This allows us to put @Nullable immediately preceding the return type,
which is exactly where we want it.
2017-05-06 14:21:55 -04:00
jwilson
6f8cdcca1d [maven-release-plugin] prepare for next development iteration 2017-04-15 21:53:08 -04:00
jwilson
e56f561e93 [maven-release-plugin] prepare release parent-3.7.0 2017-04-15 21:53:02 -04:00
jwilson
9690110f81 [maven-release-plugin] prepare for next development iteration 2017-01-29 14:14:39 -05:00
jwilson
9dc1bbad24 [maven-release-plugin] prepare release parent-3.6.0 2017-01-29 14:14:33 -05:00
jwilson
29f69277ea [maven-release-plugin] prepare for next development iteration 2016-12-01 12:53:49 -05:00
jwilson
366bc4752b [maven-release-plugin] prepare release parent-3.5.0 2016-12-01 12:53:45 -05:00
jwilson
2b8ad31b08 Fix flakiness in authenticateWithChunkedStreaming().
We were prefering to return the networkResponse before the request
had completely failed. Instead we should return the network response
only on failure, and only for APIs that return failed responses.
2016-11-21 21:58:51 -05:00
jwilson
a27afaf572 Always prefer the server's returned response body.
Previously we would prefer the cached response if it had a newer
Last-Modified date.

Closes: https://github.com/square/okhttp/issues/2886
2016-11-14 20:52:43 -05:00
jwilson
5bb4c0c293 Use Okio's hash methods. 2016-11-13 15:59:25 -05:00
Tobias Thierer
9958fc6934 Make tests portable to platforms with different Header prefixes
Some tests hard coded cache entries with OkHttp-Received-Millis
and OkHttp-Sent-Millis headers. Platforms are allowed to have
prefixes other than the default value "OkHttp", which broke
those tests.
2016-07-28 21:45:06 +01:00
jwilson
591d595561 Remove some dead code pointed out by running coverage.
AOSP doesn't use SystemPropertiesConnectionPool so it's useless. It also doesn't
need to configure protocols through request properties.
2016-07-24 19:07:39 -04:00
jwilson
fd509b937c Inject a leading . for better matching under JavaNetCookieJar
Closes: https://github.com/square/okhttp/issues/2549
2016-07-12 23:22:49 -04:00
jwilson
0c04821a25 Drop support for SPDY/3.
It's redundant with HTTP/2.
2016-07-09 17:19:04 -04:00
jwilson
f85cae7f0d [maven-release-plugin] prepare for next development iteration 2016-07-08 22:39:32 -04:00
jwilson
ee2b9a2917 [maven-release-plugin] prepare release parent-3.4.0 2016-07-08 22:39:28 -04:00
jwilson
764c35e784 Don't share the OkHttpClient's Dispatcher in HttpURLConnection.
Any limits enforced here would be awkward because there's an application
thread blocked on the work anyway.

Closes: https://github.com/square/okhttp/issues/2667
2016-07-03 23:22:51 -04:00
jwilson
7e773f39f9 [maven-release-plugin] prepare for next development iteration 2016-07-02 23:18:34 -04:00
jwilson
9db491924a [maven-release-plugin] prepare release parent-3.4.0-RC1 2016-07-02 23:18:29 -04:00
Jesse Wilson
ae1ef1604d Merge pull request #2685 from square/jwilson.0702.pipe
Upgrade to Okio 1.9 and use its pipe.
2016-07-02 11:00:52 -04:00
Jesse Wilson
8d51e740d7 Merge pull request #2666 from square/jwilson.0626.dead_code
Run IntelliJ's analysis on OkHttp.
2016-07-02 10:56:44 -04:00
jwilson
537df4219c Upgrade to Okio 1.9 and use its pipe. 2016-07-02 10:49:25 -04:00
Tobias Thierer
1ef0b078a8 Cleanup refactoring: Move 3 methods into DelegatingHttpsURLConnection
These three methods were delegating to delegate; their implementation
was duplicated across both subclasses of DelegatingHttpsURLConnection.

This change moves them into the base class in order to
  - avoid duplication
  - separate the responsibility of delegation (base class) from the
    responsibility of change to behavior (subclasses).

Notes:
 - Since these three methods are not available in Java 6, each of
   these need a @IgnoreJRERequirement annotation to pass the
   animal sniffer test. This appears like it should have been
   necessary before but for some reason it used to pass without.
 - This in turn requires a new dependency from okhttp-urlconnection
   onto animal-sniffer-annotations. The dependency was added onto
   version 1.11 of that library (consistent with okhttp itself);
   okio depends on version 1.10, the latest version is 1.15.
2016-06-28 18:22:02 -04:00
jwilson
a4d3082d2f Run IntelliJ's analysis on OkHttp.
This made a few hundred suggestions, many of which are thoughtful but
I'm deliberately ignoring anyway.

The following fixes are good ideas.
2016-06-27 00:47:50 -04:00
jwilson
c5187583bb Add connection, cache, and platform subpackages. 2016-06-26 23:04:30 -04:00
jwilson
e3b3180f9c 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.
2016-06-26 10:27:34 -04:00
jwilson
2843933b4b Fix OkHttpURLConnection to not swallow unexpected exceptions.
Previously we would sometimes delegate to the asynchronous implementation,
and that would prevent exceptions from reaching their destination.
2016-06-25 18:04:02 -04:00
jwilson
ec39c46232 Rename HttpURLConnectionImpl to OkHttpURLConnection.
This is an internal class so nobody should see the name. But having a
completely different name will make it much easier to diagnose future
stacktraces because the internal implementation has changed so much
recently.

Also share fewer internal details with the rest of OkHttp. In particular
remove the OkHttp-Selected-Protocol and OkHttp-Response-Source headers
from the core.
2016-06-25 15:46:24 -04:00
jwilson
084b06b48b Reimplement HttpURLConnection on the native OkHttp API. 2016-06-21 14:30:00 -04:00
jwilson
7a807aff6f [maven-release-plugin] prepare for next development iteration 2016-05-28 14:11:55 -04:00
jwilson
358d96c5fb [maven-release-plugin] prepare release parent-3.3.1 2016-05-28 14:11:52 -04:00
Yuri Schimke
8ceb7480f3 tests running in JDK 9 2016-05-28 13:09:24 -04:00
jwilson
16aed96a35 [maven-release-plugin] prepare for next development iteration 2016-05-24 22:12:31 -04:00