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

823 Commits

Author SHA1 Message Date
jwilson
8377182cfe Don't do DNS lookups on null hosts. 2014-02-22 09:12:39 -05:00
Adrian Cole
dce4bb2c13 Merge pull request #544 from square/jwilson_0221_okbuffer_refactor
Small OkBuffer API changes.
2014-02-21 21:39:30 -08:00
jwilson
f5d07820a2 Small OkBuffer API changes. 2014-02-22 00:17:26 -05:00
Jake Wharton
f41e2c8c04 Deprecate G+ community in favor of StackOverflow. 2014-02-21 00:08:02 -08:00
Jesse Wilson
9e8b022f08 Merge pull request #539 from square/adrian.unthrottle-client-reads
When a SPDY client, do not flow-control the server
2014-02-19 23:49:30 -05:00
Adrian Cole
a3e9485b81 When a SPDY client, use a large flow-control window. 2014-02-19 20:26:41 -08:00
Jesse Wilson
0effa60031 Merge pull request #538 from square/jwilson_0219_deflatersink
DeflaterSink.
2014-02-19 08:16:47 -05:00
Adrian Cole
e9d95f5b8b Animal Sniffer 2014-02-18 22:04:35 -08:00
Jesse Wilson
ad0ff5847c Merge pull request #537 from square/adrian.remove-old-header
Remove OkHttp-Selected-Transport header
2014-02-19 00:47:56 -05:00
Adrian Cole
ccd54b7025 Removed OkHttp-Selected-Transport header. 2014-02-18 21:35:07 -08:00
jwilson
60e68ab198 DeflaterSink. 2014-02-19 00:27:32 -05:00
Adrian Cole
15fff4c325 Merge pull request #536 from square/jwilson_0217_source_in_engine
Use OkBuffer+Source in HttpEngine.
2014-02-18 08:27:20 -08:00
jwilson
a669069599 Use OkBuffer+Source in HttpEngine. 2014-02-18 02:33:00 -05:00
Jake Wharton
625909bcd0 Merge pull request #533 from square/jwilson_0215_rethink_recycle
Move connection pooling logic.
2014-02-17 17:13:53 -08:00
Jake Wharton
000e62ec37 Merge pull request #534 from square/jwilson_0217_buffered_sink
BufferedSink.
2014-02-17 15:37:05 -08:00
Jesse Wilson
5be60e4b70 Merge pull request #535 from square/jwilson_0217_base64
Give Base64 lots of love.
2014-02-17 18:33:09 -05:00
jwilson
167245bb4a Give Base64 lots of love.
Fix some bugs, such as decoding of input that contains lots
of padding or whitespace. See
https://code.google.com/p/android/issues/detail?id=66078

Improve performance by correctly guessing the output array
size whenever the input doesn't contain whitespace.

Build Base64 into ByteString, and expose it through there
only.

Use more reasonable names in the implementation.
2014-02-17 13:53:39 -05:00
jwilson
415841c48f BufferedSink. 2014-02-17 09:18:53 -05:00
jwilson
dac5aed3d5 Move connection pooling logic.
Previously we had this ugly, awkward release() method that
attempted to manage connection pooling, discarding streams
for caching, and closing broken streams.

Move connection reuse to HttpConnection, with policy informed
by HttpEngine. It specifies what to do when the connection
becomes idle: pool, close or hold. The connection does what
it's told.
2014-02-15 18:44:43 -05:00
Jesse Wilson
ce76caedda Merge pull request #532 from square/jwilson_0215_statemachine
Enforce the implicit state machine in HttpConnection.
2014-02-15 13:30:23 -05:00
jwilson
322e9f3700 Enforce the implicit state machine in HttpConnection.
This checks that calls into HttpConnection occur in the correct
sequence.

Once this is merged I can follow up by making HttpConnection
responsible for its own pooling rather than relying on HttpEngine
to do that work.
2014-02-15 13:30:15 -05:00
Jesse Wilson
4caed5ca3b Merge pull request #530 from square/jwilson_0214_http_connection
Split HttpTransport in two.
2014-02-14 16:56:50 -05:00
jwilson
504b9cf55a Split HttpTransport in two.
The new (awkwardly-named) HttpConnection class now owns the
socket, and stays around between HTTP requests. It matches
SpdyConnection in lifecycle: it is tied to the socket.

The HTTP transport class is a dumb adapter that adapts the
protocol-specific decisions (chunked-encoding, content-length
stuff).

This should make it possible to make significant simplifications
to how connection recycling works: in a follow up change the
HttpConnection class will know when it can be recycled and take
that action automatically.
2014-02-14 16:23:39 -05:00
Jesse Wilson
efaf141801 Merge pull request #527 from square/jw/okcurl-bodies
Add body support to OkCurl. Introduce tests.
2014-02-14 15:27:10 -05:00
Jake Wharton
334584b834 Add body support to OkCurl. Introduce tests. 2014-02-14 09:02:08 -08:00
Jesse Wilson
3265dedc64 Merge pull request #529 from square/jw/java7
Make Java 7 build requirement more clear.
2014-02-14 08:01:27 -05:00
Jake Wharton
622e6a23cc Make Java 7 build requirement more clear. 2014-02-13 22:59:07 -08:00
Jesse Wilson
8720ab420f Merge pull request #526 from square/jwilson_0212_okbuffer_in_spdystream
Use OkBuffer in SpdyStream.
2014-02-12 17:20:53 -05:00
jwilson
c8507d05b4 Use OkBuffer in SpdyStream. 2014-02-12 17:20:18 -05:00
Adrian Cole
c40cb632ff Merge pull request #524 from square/jwilson_0211_buffered_source
BufferedSource.
2014-02-12 08:58:32 -08:00
jwilson
9c6a433725 BufferedSource.
The Source API is nice for source implementors: no annoying
skip method, no annoying available() method, just one API to
supply bytes to the caller.

But it isn't as nice of an API for source callers. It lacks
convenient APIs!

This bridges the gap. Calling code should use BufferedSource,
and implementing code should implement Source.
2014-02-11 22:21:31 -05:00
Jesse Wilson
545807ee8d Merge pull request #523 from square/jwilson_0211_okbuffer_in_http2_source
Use OkBuffer in http/2 source stream
2014-02-11 17:15:30 -05:00
jwilson
72d5faec97 Use OkBuffer in http/2 source stream 2014-02-11 17:09:44 -05:00
Jesse Wilson
a2cb34de5f Merge pull request #519 from square/jwilson_0209_okbuffer_in_spdy3_source
Use OkBuffer in spdy/3 source stream.
2014-02-11 15:54:55 -05:00
jwilson
d60d8e143a Use OkBuffer in spdy/3 source stream.
This isn't quite as simple as I had hoped. We still lack something
like DataInputStream/BufferedInputStream that combines a buffer with
a Source. That means there's a bunch of methods that must manually
refill the buffer before acting upon it.

I'm going to continue to migrate code, and will follow up with
changes to simplify this interaction.
2014-02-11 15:54:39 -05:00
Jake Wharton
12f7e649bc Merge pull request #522 from square/adrian.curl-X
Add -X to okcurl, permitting HEAD requests
2014-02-11 09:05:19 -08:00
Adrian Cole
6587a862cf Add -X to okcurl, permitting HEAD requests. 2014-02-11 09:04:18 -08:00
Jesse Wilson
f11832d5cf Merge pull request #518 from square/adrian.okclient-provided-sslcontext
OkHttp no longer uses default ssl context.
2014-02-09 10:54:43 -05:00
Adrian Cole
5d7fdbaf30 fix #184: OkHttp no longer uses default ssl context. 2014-02-09 09:30:37 -05:00
Jake Wharton
de6d505c03 Merge pull request #514 from square/jw/okcurl
Initial implementation of an OkHttp-backed curl clone.
2014-02-08 18:45:46 -05:00
Jake Wharton
acd45e124e Initial implementation of an OkHttp-backed curl clone. 2014-02-08 17:39:37 -05:00
Adrian Cole
1151c9853c Merge pull request #517 from square/jwilson_0208_buffer_fixes
Fix some OkBuffer bugs.
2014-02-08 10:20:34 -05:00
Adrian Cole
4c8ce7cad5 Merge pull request #516 from square/jwilson_0208_byte_at_to_get_byte
Rename byteAt to getByte.
2014-02-08 10:17:00 -05:00
jwilson
cd16580d2e Fix some OkBuffer bugs.
GzipSource exceptions used six hex digits instead of
8 to print ints.

readUtf8 always did an extra copy of the bytes being
read.

Moving bytes between buffers crashed when the destination
was empty and the source was a prefix.

InputStream reading returned values in -128..127 instead
of in 0..255.
2014-02-08 08:22:22 -05:00
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