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

38 Commits

Author SHA1 Message Date
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
Jake Wharton
faea360ddf Toward a 2.0! 2014-01-11 18:59:47 -08:00
jwilson
c6888734b4 Fix a bug where discardStream took way too long.
We were relying on the socket timeout of a single read,
but performing multiple reads each with independent
timeouts.
2014-01-11 13:37:48 -05:00
Jesse Wilson
34ad7ecf40 Merge pull request #421 from lingmingyb/test_spdyTimeout
Testcase for spdy connection socket timeout.
2014-01-09 09:00:00 -08:00
lingming.yb
3aa708978d Testcase for spdy connection socket timeout. 2014-01-09 10:44:29 +08:00
Adrian Cole
379e4ff199 feedback from #413 and a few optimizations on hpack. 2014-01-07 10:24:14 -08:00
Jake Wharton
efcffd0c1c Remove duplication of protocols in MWS' NPN declaration. 2014-01-07 09:38:46 -08:00
Adrian Cole
5c787a0b9d Refactor SPDY code to use ByteString for headers. 2014-01-06 18:51:11 -08:00
Adrian Cole
bd26cf927a Switch list iteration to index-based as it is more efficient on android. 2014-01-06 12:44:01 -08:00
Adrian Cole
68de030b35 update http2 to draft 9 and hpack to draft 5 2014-01-04 19:33:14 -08:00
lingming.yb
1cfab33333 add read response header timeout case 2014-01-04 12:01:48 +08:00
jwilson
bc25934830 Move request line and status line out of RawHeaders.
The request line is now standalone because it depends
on the proxy (for full URL or not) and the connection
(for HTTP version). I may change this later and put
this info in the request.

The status line now moves into Response. I have a
helper class StatusLine that does the parsing. I may
later want to hide this or make it public; I'm not
quite sure yet!

The net result is that RawHeaders is getting dumber
and used in fewer places, which is good news. This
change also shows nice simplifications to the
authenticator (which needs fewer args) and to the
tunnel builder.

Also fold together HttpsEngine and HttpEngine; the
HTTPS subclass wasn't pulling its weight.
2013-12-30 23:39:04 -05:00
jwilson
e2bfa5dd6c Introduce Handshake as a value object.
I needed a non-terrible way to provide the HTTPS handshake
information to the async API. Previously we were passing the
live socket around, which was leaky and gross.

This creates a new value object that captures the relevant
bits of the handshake. We can use it in the response, the
connection, and also in the cache. It's plausible that in
the future we can use it to allow the application to block
requests if the handshake is insufficient.
2013-12-29 00:35:14 -05:00
Ignasi Barrera
d0e49527c7 Support PATCH requests in MockWebServer 2013-12-13 17:35:05 +01:00
Adrian Cole
4db7288561 Adjust hpack impl to be compliant with draft 3 examples, and enable http2 in MWS. 2013-12-08 21:54:06 -08:00
Adrian Cole
f7d96b2563 update http/2 implementation to draft 6 2013-12-02 10:18:19 -08:00
jwilson
29ab48bf0d Fix a race condition in Connection.isExpired().
This was causing some SPDY connections to be evicted early,
and preventing connection reuse.

The spdyConnectionReuse test becomes flaky with the
fix that makes MockWebServer use different sequenceNumbers
for different requests on the same socket. With the fix
the test is no longer flaky. The old test wasn't good enough
to detect what it wanted to detect!

This race has existed in the code since we added more
aggressive time-based expiration in January 2013. In my
basic tests the race impacted ~20% of connections on a
desktop VM. It may have been more on mobile.
2013-09-29 16:08:06 -04:00
jwilson
742cee9e41 Static HTTPS/SPDY3/HTTP2 server example 2013-09-07 11:21:14 -04:00
jwilson
8dee226c7c Write some HTTP/2.0 frames 2013-09-02 12:49:56 -04:00
jwilson
5663f815af Implement HPACK, HTTP header compression. 2013-08-27 07:25:05 -07:00
Jake Wharton
ca7d09b4e8 [maven-release-plugin] prepare for next development iteration 2013-08-23 23:19:52 -07:00
Jake Wharton
4eb81fee1f [maven-release-plugin] prepare release parent-1.2.1 2013-08-23 23:19:48 -07:00
Jake Wharton
83e77ea310 Merge pull request #277 from square/jwilson/http2_or_spdy3
Support multiple variants of the SPDY protocol.
2013-08-12 00:09:56 -07:00
Jake Wharton
db3b3f4d2a [maven-release-plugin] prepare for next development iteration 2013-08-12 00:01:30 -07:00
Jake Wharton
f7699d9243 [maven-release-plugin] prepare release parent-1.2.0 2013-08-12 00:01:26 -07:00
Jake Wharton
bc3aa64462 Revert "[maven-release-plugin] prepare release parent-1.2"
This reverts commit ad928c668d.
2013-08-11 23:45:35 -07:00
jwilson
21dc92f967 Support multiple variants of the SPDY protocol.
This behavior-free refactoring makes the first baby steps towards
supporting HTTP/2.0. It adds indirection on the framing layer so
we can frame either using SPDY/3's syntax or HTTP/2.0's.
2013-08-11 12:02:54 -04:00
jwilson
3626d69813 [maven-release-plugin] prepare for next development iteration 2013-08-11 10:30:12 -04:00
jwilson
ad928c668d [maven-release-plugin] prepare release parent-1.2 2013-08-11 10:30:06 -04:00
jwilson
d5ab35a272 Use the OkHttp code style in MockWebServer 2013-08-05 19:00:51 -04:00
jwilson
00a50d1919 Teach MockWebServer SPDY.
Kill MockSpdyServer in the process.
2013-08-05 18:32:54 -04:00
jwilson
8535f2447c Repackage mockwebserver in com.squareup.okhttp.mockwebserver. 2013-08-05 18:04:25 -04:00
jwilson
8508ae98fd Merge branch 'mockwebserver' into jwilson/import_mockwebserver 2013-08-04 09:03:29 -04:00
jwilson
6010229378 Imported mockwebserver source into mockwebserver/ 2013-08-04 09:03:08 -04:00
jwilson
3c0faa9ca1 Make a home for MockWebServer in OkHttp.
To build HTTP/2.0 support into OkHttp I'm going to simultaneously
build HTTP/2.0 support into MockWebServer. To make that possible,
I'm first going to fork MockWebServer and then combine it with
MockSpdyServer.
2013-08-03 12:50:04 -04:00