envoyproxy / envoyproxy/envoy-mobile
BiDi Stream delayRequestHeadersUntilFirstFlush for QUIC
- Dominant language
- Java
- Stars
- 566
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Cronet exposes a feature that is not supported by EM: delayRequestHeadersUntilFirstFlush
```
/**
* Delays sending request headers until {@link BidirectionalStream#flush()}
* is called. This flag is currently only respected when QUIC is negotiated.
* When true, QUIC will send request header frame along with data frame(s)
* as a single packet when possible.
*
* @param delayRequestHeadersUntilFirstFlush if true, sending request headers will
* be delayed until flush() is called.
* @return the builder to facilitate chaining.
*/
public abstract Builder delayRequestHeadersUntilFirstFlush(
boolean delayRequestHeadersUntilFirstFlush);
```
Implementing the delayed request headers is easy to do in Java. What is currently impossible to mimic is the ability to send more than one ByteBuffer inside that "single packet".
Cronet solved that difficulty by allowing to write one or more ByteBuffers in a single "write" operation:
```
boolean writevData(long nativePtr, CronetBidirectionalStream caller, ByteBuffer[] buffers,
int[] positions, int[] limits, boolean endOfStream);
```
Contributor guide
Assessment
This issue has not been assessed yet.