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

Flush control frames; don't flush user frames.

This commit is contained in:
Adrian Cole
2014-02-01 12:52:12 -08:00
parent f2ef66fd22
commit 15099af480
2 changed files with 5 additions and 1 deletions

View File

@@ -317,6 +317,7 @@ public final class Http20Draft09 implements Variant {
@Override public synchronized void connectionHeader() throws IOException {
if (!client) return; // Nothing to write; servers don't send connection headers!
out.write(CONNECTION_HEADER);
out.flush();
}
@Override
@@ -409,6 +410,7 @@ public final class Http20Draft09 implements Variant {
out.writeInt(i & 0xffffff);
out.writeInt(settings.get(i));
}
out.flush();
}
@Override public synchronized void ping(boolean ack, int payload1, int payload2)
@@ -420,6 +422,7 @@ public final class Http20Draft09 implements Variant {
frameHeader(length, type, flags, streamId);
out.writeInt(payload1);
out.writeInt(payload2);
out.flush();
}
@Override
@@ -436,6 +439,7 @@ public final class Http20Draft09 implements Variant {
if (debugData.length > 0) {
out.write(debugData);
}
out.flush();
}
@Override public synchronized void windowUpdate(int streamId, long windowSizeIncrement)
@@ -449,6 +453,7 @@ public final class Http20Draft09 implements Variant {
byte flags = FLAG_NONE;
frameHeader(length, type, flags, streamId);
out.writeInt((int) windowSizeIncrement);
out.flush();
}
@Override public void close() throws IOException {

View File

@@ -369,7 +369,6 @@ final class Spdy3 implements Variant {
out.writeInt((flags & 0xff) << 24 | length & 0xffffff);
out.writeInt(streamId & 0x7fffffff);
headerBlockBuffer.writeTo(out);
out.flush();
}
@Override public synchronized void rstStream(int streamId, ErrorCode errorCode)