We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8667f2 commit 6f04325Copy full SHA for 6f04325
okhttp/src/main/java/io/grpc/okhttp/OkHttpWritableBufferAllocator.java
@@ -43,9 +43,8 @@ class OkHttpWritableBufferAllocator implements WritableBufferAllocator {
43
*/
44
@Override
45
public WritableBuffer allocate(int capacityHint) {
46
- capacityHint = (capacityHint + Segment.SIZE - 1) / Segment.SIZE * Segment.SIZE;
47
- capacityHint = Math.min(MAX_BUFFER, capacityHint);
48
- return new OkHttpWritableBuffer(new Buffer(), capacityHint);
+ // okio buffer uses fixed size Segments, round capacityHint up
+ return allocateKnownLength((capacityHint + Segment.SIZE - 1) / Segment.SIZE * Segment.SIZE);
49
}
50
51
0 commit comments