Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OkBuffer in spdy/3 source stream. #519

Merged
merged 1 commit into from
Feb 11, 2014

Conversation

swankjesse
Copy link
Collaborator

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.

@@ -99,7 +102,7 @@
}

@Override public FrameReader newReader(InputStream in, boolean client) {
return new Reader(in, client);
return new Reader(OkBuffers.source(in), client);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an adapter on the way in.

@codefromthecrypt
Copy link

LG only editorial comments. tested via ExternalSpdyExample

@codefromthecrypt
Copy link

also tested with okcurl

~/Development/okhttp/okcurl jwilson_0209_okbuffer_in_spdy3_source ./target/okcurl-2.0.0-SNAPSHOT-jar-with-dependencies.jar -p spdy/3 -i https://google.ca
HTTP/1.1 301 Moved Permanently
OkHttp-Selected-Transport: spdy/3.1
OkHttp-Selected-Protocol: spdy/3.1
alternate-protocol: 443:quic
cache-control: public, max-age=2592000
content-length: 219
content-type: text/html; charset=UTF-8
date: Tue, 11 Feb 2014 16:49:04 GMT
expires: Thu, 13 Mar 2014 16:49:04 GMT
location: https://www.google.ca/
server: gws
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
OkHttp-Sent-Millis: 1392137345635
OkHttp-Received-Millis: 1392137345749
OkHttp-Response-Source: NETWORK 301

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.ca/">here</A>.
</BODY></HTML>

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.
swankjesse added a commit that referenced this pull request Feb 11, 2014
…urce

Use OkBuffer in spdy/3 source stream.
@swankjesse swankjesse merged commit a2cb34d into master Feb 11, 2014
@swankjesse swankjesse deleted the jwilson_0209_okbuffer_in_spdy3_source branch February 14, 2014 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants