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

779 Commits

Author SHA1 Message Date
jwilson
1f97e6b74c Rename byteAt to getByte.
Should we later support random access for other primitives
or random bulk access, I'd like the prefix to stay constant
(getByte, getInt, getLong, getBytes) vs. the suffix (byteAt,
intAt, longAt). Prefixing may work better for autocomplete
in IDEs, particularly since we already use a prefix for our
consuming reads (readByte, readInt, readLong).
2014-02-08 07:44:47 -05:00
Jesse Wilson
1b25214f59 Merge pull request #510 from square/jwilson_0203_gzip_beginnings
GzipSource beginnings.
2014-02-07 21:28:14 -05:00
jwilson
2c6f99dd56 GzipSource beginnings. 2014-02-07 20:15:29 -05:00
Adrian Cole
08b68ac717 Merge pull request #513 from adamsp/master
Fix for NPE when the OpenSSLSocketImpl returns null from getNpnSelectedProtocol
2014-02-06 01:36:25 +01:00
Adam Speakman
0ca4c82dd1 Fix for NPE when the OpenSSLSocketImpl returns null from getNpnSelectedProtocol. 2014-02-06 12:06:17 +13:00
Jesse Wilson
85fbb0abeb Merge pull request #512 from square/adriancole_02_05_findbugs
FindBugs sweep.
2014-02-05 12:49:22 -05:00
Adrian Cole and Jesse Wilson
fdee6f13a4 FindBugs sweep. 2014-02-05 17:18:30 +01:00
Adrian Cole
b149fec75e Merge pull request #509 from square/jwilson_0202_targetbacklog
Promote the target backlog to a parameter.
2014-02-02 22:54:46 -08:00
jwilson
4313b7af81 Promote the target backlog to a parameter. 2014-02-03 07:45:27 +01:00
Jesse Wilson
8be6646635 Merge pull request #508 from square/jwilson_0202_inflater_source
InflaterSource. Like InflaterInputStream.
2014-02-02 22:21:26 -08:00
jwilson
220c30ba20 InflaterSource. Like InflaterInputStream. 2014-02-03 01:24:01 -05:00
Adrian Cole
a12d6a6fcc Merge pull request #503 from normanmaurer/pooled
Use the pooled allocator for performance reasons
2014-02-01 16:59:41 -08:00
Adrian Cole
810a9175da Merge pull request #505 from adriancole/flush-control-frames-dont-flush-user-frames
Flush control frames; don't flush user frames.
2014-02-01 16:59:10 -08:00
Adrian Cole
b2293c2660 Merge pull request #504 from square/jwilson_0201_caliper
Use Caliper for benchmarking.
2014-02-01 12:53:18 -08:00
Adrian Cole
15099af480 Flush control frames; don't flush user frames. 2014-02-01 12:52:12 -08:00
jwilson
99841aecb4 Use Caliper for benchmarking. 2014-02-01 15:52:06 -05:00
Adrian Cole
f2ef66fd22 Merge pull request #502 from adriancole/mws-npn
Tell MockWebServer which NPN protocols to use.
2014-02-01 11:23:29 -08:00
Norman Maurer
18ef05d70d Use the pooled allocator for performance reasons 2014-02-01 20:09:25 +01:00
Adrian Cole
66b2582379 Add instructions to execute the benchmark with correct JVM parameters. 2014-02-01 11:01:27 -08:00
Adrian Cole
08bc3c8808 Add MockWebServer.setNpnProtocols 2014-02-01 11:00:49 -08:00
Jesse Wilson
b52e0412f5 Merge pull request #501 from square/jwilson_0201_netty
New benchmark target for Netty.
2014-02-01 10:34:05 -08:00
jwilson
13ce4a09be New benchmark target for Netty.
This required some reworking to the harness since Netty doesn't
want to be used with an ExecutorService.

NettyHttpClient [HTTP_11]
bodyByteCount=1048576 headerCount=20 concurrencyLevel=10
Requests per second: 597.1

OkHttp [HTTP_11]
bodyByteCount=1048576 headerCount=20 concurrencyLevel=10
Requests per second: 705.2
2014-02-01 12:21:03 -05:00
Adrian Cole
7032f69b8a Merge pull request #500 from square/jwilson_0130_mo_benchmarks
New benchmark targets for Apache HTTP Client and URLConnection.
2014-02-01 06:59:00 -08:00
jwilson
7c21992db5 New benchmark targets for Apache HTTP Client and URLConnection.
OkHttp [HTTP_11]
bodyByteCount=1048576 headerCount=20 threadCount=10
Requests per second: 690.9

UrlConnection [HTTP_11]
bodyByteCount=1048576 headerCount=20 threadCount=10
Requests per second: 671.3

ApacheHttpClient [HTTP_11]
bodyByteCount=1048576 headerCount=20 threadCount=10
Requests per second: 317.4
2014-02-01 00:55:37 -05:00
Adrian Cole
e369755806 Merge pull request #499 from square/benchmarks
Quick and dirty benchmark.
2014-01-31 20:40:25 -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
Jesse Wilson
52804f6d9a Merge pull request #496 from square/jwilson_0130_adapters
Adapters that go the other way, to java.io.
2014-01-30 22:30:10 -08:00
jwilson
2d01579a18 Adapters that go the other way, to java.io.
These ones are slightly more awkward because they need to do
their own internal buffering.
2014-01-30 22:22:58 -05:00
Adrian Cole
d587a44399 Merge pull request #495 from adriancole/hpack-write-literal-name-no-indexing
HPACK: Write headers using indexed names where possible.
2014-01-29 11:25:40 -08:00
Adrian Cole
0b3ec2b55d HPACK: Write headers using indexed names where possible. 2014-01-29 11:17:55 -08:00
Jesse Wilson
a3db2d7239 Merge pull request #494 from square/jwilson_0128_data_in_buffers
Read/write access for byte, short and int.
2014-01-28 21:52:01 -08:00
jwilson
855c114f4f Read/write access for byte, short and int.
This is big-endian only because that's all we use in OkHttp.
2014-01-29 00:51:06 -05:00
Jesse Wilson
e50e4b7bf4 Merge pull request #493 from square/jwilson_0128_okbuffers
Adapters for sources and sinks.
2014-01-28 21:04:23 -08:00
jwilson
25cb503a41 Adapters for sources and sinks. 2014-01-28 22:56:24 -05:00
Jesse Wilson
99a8dae943 Merge pull request #492 from square/jwilson_0127_indexof
More buffer stuff: deadlines, indexOf and read.
2014-01-27 20:00:24 -08:00
jwilson
bcacc38f7d More buffer stuff: deadlines, indexOf and read.
Rename Timeout to Deadline. I'm still unsatisfied with this API,
but at least the new name is accurate.

Implement indexOf as a linear scan and read by delegating to
write.
2014-01-27 21:38:55 -05:00
Adrian Cole
c30a661bf0 Merge pull request #489 from adriancole/spdy-3.1
Update to spdy/3.1 and ignore old spdy frames.
2014-01-27 14:22:23 -08:00
Adrian Cole
d152445db7 Update to spdy/3.1 and ignore old spdy frames. 2014-01-27 14:06:17 -08:00
Adrian Cole
0feedd1e65 Merge pull request #490 from adriancole/close-test-peers
Use latest junit maven config and close test resources
2014-01-27 14:05:01 -08:00
Adrian Cole
b77e76c736 Test de-flakiness attempt
Update surefire to latest and set travis to emit maven version.

Only use one MockSpdyPeer in SpdyConnectionTest and close its executor.

Consistency in HttpURLConnection tests.

Bump so and read timeouts in ConnectionPoolTest.
2014-01-27 13:52:58 -08:00
Jesse Wilson
236b631fba Merge pull request #488 from jgilfelt/patch-1
Fix mockwebserver jar download 404
2014-01-27 06:27:45 -08:00
Jesse Wilson
7bf48539c1 Merge pull request #486 from adriancole/window-update
Send window update after the peer sends half the limit on a stream or connection
2014-01-27 06:27:21 -08:00
Jeff Gilfelt
35b031fb63 Fix mockwebserver jar download 404 2014-01-27 10:41:27 +00:00
Adrian Cole
358169b89f Send window update after the peer sends half the limit on a stream or connection. 2014-01-26 21:54:25 -08:00
Jesse Wilson
d4e80bcc06 Merge pull request #487 from square/jwilson_0126_buffer_to_buffer
Implement moving bytes between OkBuffers.
2014-01-26 21:49:04 -08:00
jwilson
5fe67f1bfc Implement moving bytes between OkBuffers.
This is more complicated than I'd anticipated.
2014-01-27 00:47:21 -05:00
Jesse Wilson
e33ee39e41 Merge pull request #485 from square/okbuffer
OkBuffer API sketch.
2014-01-26 16:07:35 -08: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
Adrian Cole
3cf454698b Merge pull request #484 from adriancole/stream-window-update
spdy streams honor write window updates
2014-01-26 14:02:55 -08:00
Adrian Cole
d990b5819c spdy streams honor write window updates. 2014-01-26 14:01:36 -08:00