1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-27 18:21:14 +03:00
Commit Graph

84 Commits

Author SHA1 Message Date
Jesse Wilson
2cea341be1 [maven-release-plugin] prepare for next development iteration 2014-06-11 01:36:58 -04:00
Jesse Wilson
f171096b11 [maven-release-plugin] prepare release parent-2.0.0-RC2 2014-06-11 01:34:55 -04:00
Jake Wharton
6a3bdc60a9 Merge pull request #882 from square/jw/okio-low-hanging-fruit
Leverage Okio for yanking a full byte[].
2014-05-30 18:36:25 -07:00
Jake Wharton
91f36c75af Update test to JUnit 4, Square code style. 2014-05-30 16:08:49 -07:00
Jake Wharton
3226432039 Leverage Okio for yanking a full byte[]. 2014-05-30 15:57:02 -07:00
Jesse Wilson
cc92c4cecc [maven-release-plugin] prepare for next development iteration 2014-05-24 02:03:47 -04:00
Jesse Wilson
8dcc74d339 [maven-release-plugin] prepare release parent-2.0.0-RC1 2014-05-24 02:03:37 -04:00
Jesse Wilson
84312bd93f Rename Response.Callback to Callback. 2014-05-10 11:20:07 -04:00
Adrian Cole
a5b7c3b2f3 Add ALPN support; Configure maven to use ALPN on OpenJDK 8. 2014-04-28 09:44:46 -07:00
Adrian Cole
022173a444 Don't suggest NPN will be used when it might be ALPN. 2014-04-27 09:12:37 -07:00
Jesse Wilson
da7ef589e1 When we want a port, take it. 2014-04-27 10:58:20 -04:00
Adrian Cole
bdf42b20e8 Add --frames arg to okcurl, which sends HTTP/2 frame metadata to STDERR. 2014-04-26 11:15:30 -07:00
Jake Wharton
7bfcaa60e2 Use more convenience methods from Okio 0.8.0. 2014-04-25 09:23:34 -07:00
Adrian Cole
e19326c033 Add MockWebServerRule. 2014-04-25 08:16:08 -07:00
Jesse Wilson
5b6f64a462 Fix HTTP post retransmit in the new API.
We don't buffer response bodies in the new API. But we should retransmit
POST bodies when a request fails.
2014-04-23 00:55:58 -04:00
Jesse Wilson
9546527a1c Kill httpMinorVersion.
Replacing it with Protocol.
2014-04-19 14:29:27 -04:00
Jesse Wilson
e9b5bf2a1d Rename HTTP_11 to HTTP_1_1.
Otherwise it seems like HTTP_11 is version 11, greater than
HTTP_2.
2014-04-19 12:23:48 -04:00
Jesse Wilson
2d3bdd9d92 Fewer public APIs for Protocol identification. 2014-04-18 21:30:03 -04:00
Jesse Wilson
ab4927b857 Hide Protocol's internal byte string. 2014-04-18 20:46:54 -04:00
Jesse Wilson
411a338105 Use File helpers in Okio. 2014-04-18 17:57:15 -04:00
Jesse Wilson
62a7ea2d20 Make Buffer the body type in MockResponse. 2014-04-17 20:19:16 -04:00
Jesse Wilson
b242024216 Switch to Okio.
This depends on a new method, Buffer.copy() not included in Okio 0.5.
We may need to wait for an Okio 0.6 before merging this.
2014-04-15 23:59:06 -04:00
Jesse Wilson
bcf069cd2b Teach MockWebServer to throttle the request body.
We use a single throttle for both request and response. This is
sufficient for all of our current needs.

This breaks API compatibility with previous custom dispatchers.
Dispatchers that override peekSocketPolicy() must now override
peek() instead.
2014-03-23 11:25:02 -04:00
Jesse Wilson
7b106923e0 Merge pull request #602 from square/adrian.567.slow-network-tests
Test case for read timeout granularity
2014-03-06 16:42:08 -08:00
Adrian Cole
f0941ff6ea fix #605: Allow DELETE Request Body, Ensure Sane Behavior. 2014-03-06 15:58:28 -08:00
Adrian Cole
26b5f35718 Update MWS to pay attention to throttling for SPDY streams. 2014-03-06 15:56:31 -08:00
Adrian Cole
a5ba3e9062 Add HTTP/2 PushObserver. 2014-03-01 21:23:04 -08:00
Jesse Wilson
edb8164469 Tweak Markdown. 2014-02-28 22:52:27 -05:00
Jesse Wilson
6d8e198e2d New mockwebserver docs. 2014-02-28 22:47:02 -05:00
Jesse Wilson
110a4fac42 Rearrange OkHttp modules.
The HTTP client and SPDY code are now a single module that
mockwebserver depends upon.

The tests are now in a separate module that depends on both
OkHttp and mockwebserver.
2014-02-27 23:28:40 -05:00
Adrian Cole
fb46f100a4 Teach MockWebServer HTTP/2 Push Promise. 2014-02-23 17:16:01 -08:00
jwilson
84184afdb2 Use Sink in HttpEngine. 2014-02-23 18:13:58 -05:00
jwilson
095448552e OkBuffer toString and hex. 2014-02-22 16:08:25 -05:00
jwilson
2581c36905 Okio module. 2014-02-22 14:23:52 -05:00
jwilson
7995b46276 Interfaces for BufferedSource and BufferedSink.
This means OkBuffer implements these interfaces directly.
That's much simpler for code that sometimes wants to access
an in-memory OkBuffer and sometimes wants to access an
I/O backed stream like a socket.
2014-02-22 13:51:22 -05:00
jwilson
a669069599 Use OkBuffer+Source in HttpEngine. 2014-02-18 02:33:00 -05:00
jwilson
72d5faec97 Use OkBuffer in http/2 source stream 2014-02-11 17:09:44 -05:00
Adrian Cole and Jesse Wilson
fdee6f13a4 FindBugs sweep. 2014-02-05 17:18:30 +01:00
Adrian Cole
08bc3c8808 Add MockWebServer.setNpnProtocols 2014-02-01 11:00:49 -08:00
jwilson
9bbdf3a924 Quick and dirty benchmark.
Sample output:

OkHttp [gzip, chunked, HTTP_11]
bodyByteCount=1048576 headerCount=20 threadCount=10
Requests per second: 121.0
Requests per second: 304.6
Requests per second: 379.1
Requests per second: 386.9
Requests per second: 369.2
Requests per second: 390.8
Requests per second: 368.8
Requests per second: 325.2
Requests per second: 409.4
Requests per second: 389.1
2014-01-31 22:24:54 -05:00
jwilson
32a2b1d8d0 OkBuffer API sketch.
I'm unhappy with java.io:
 * No timeouts.
 * Every layer needs to copy bytes around. Always copying bytes.
 * Features like mark/reset and available() are clumsy.
 * Its awkard in mixed text/binary protocols like HTTP because
   character decoding is separate and takes over the stream.

Unfortunately java.nio isn't better, just different:
 * It's complex.
 * Buffers are fixed size.
 * No built-in buffer pooling.
 * Features like mark/reset/position are clumsy.

This is an obnoxious attempt at a 3rd I/O interface, mostly
inspired by InputStream and OutputStream, but using growable
buffers instead of byte arrays as the core data container.
2014-01-26 18:09:56 -05:00
jwilson
3a21915069 Drop obsolete imports.
These crept in after rebase.
2014-01-19 23:53:16 -05:00
Jesse Wilson
14e87e8d8a Merge pull request #461 from square/jwilson_0119_more_cache_headers
Move more cache headers out of public API.
2014-01-19 20:49:50 -08:00
jwilson
c1458f74d8 Move more cache headers out of public API. 2014-01-19 23:19:14 -05:00
Adrian Cole
4a627bb009 Change spdy and http/2 headers to always lowercase. Introduce allocation-free ByteString.equalsAscii. 2014-01-19 20:18:49 -08:00
Adrian Cole
b95a0ccbca Top-level immutable, internal HeaderEntry class to reduce duplication around header names. Do not emit :version in http/2. 2014-01-19 10:35:34 -08:00
Adrian Cole
9766de54dc consolidate protocol constants 2014-01-16 08:39:31 -08:00
Jake Wharton
fb21058af3 Drop explicit and now duplicate Java 6 enforcement.
The root pom now enforces Java 6 across the entire project so there is no need to explicitly enable it for MockWebServer.
2014-01-14 15:15:48 -08:00
Jake Wharton
b7a07f0fe1 Ship a fat jar for MockWebServer. 2014-01-14 14:59:03 -08:00
jwilson
749a65b776 Use thread names everywhere.
Sometimes we name a thread both via its ExecutorService
and via a NamedRunnable. The ExecutorService thread needs
to be named because threads are cached and will be visible
in a thread dump even when no runnables are running.

NamedRunnables are also used because they provide additional
context: the host or URL being serviced by a thread.
2014-01-12 09:47:56 -05:00