This can be reproduced by running test case org.reaktivity.nukleus.http.internal.streams.rfc7230.server.FlowControlIT.shouldFlowControlResponseWithContentLength(). This test case shows the HTTP nukleus acting as a server and responding to a request with a response with content length, with the client-side initial window set to 9 (so 2 less tthan the response content length). A trace of the relevant frames suggests we are unnecessarily fragmenting the encoded response:
Since the response headers are of size 39 bytes, the first 6 DATA frames (of lengths 9, 9, 9, 9, 3) contain the encoded headers. The inefficiency is arising from the fact that we send the last three bytes of the encoded headers and the first few bytes of the content in separate data frames. We should combine them into a data frame consuming all available window (i.e. 9 bytes) in order to reduce the overall number of data and window frames going back and forth.
This can be reproduced by running test case org.reaktivity.nukleus.http.internal.streams.rfc7230.server.FlowControlIT.shouldFlowControlResponseWithContentLength(). This test case shows the HTTP nukleus acting as a server and responding to a request with a response with content length, with the client-side initial window set to 9 (so 2 less tthan the response content length). A trace of the relevant frames suggests we are unnecessarily fragmenting the encoded response:
Since the response headers are of size 39 bytes, the first 6 DATA frames (of lengths 9, 9, 9, 9, 3) contain the encoded headers. The inefficiency is arising from the fact that we send the last three bytes of the encoded headers and the first few bytes of the content in separate data frames. We should combine them into a data frame consuming all available window (i.e. 9 bytes) in order to reduce the overall number of data and window frames going back and forth.