seongsu shin created HTTPCORE-804:
-------------------------------------

             Summary: H2Config.copy() does not copy maxContinuations
                 Key: HTTPCORE-804
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-804
             Project: HttpComponents HttpCore
          Issue Type: Bug
            Reporter: seongsu shin


H2Config.copy(config) leaves out maxContinuations, so the copied builder goes 
back to the default of 100.

{code:java}
H2Config config = H2Config.custom().setMaxContinuations(5).build();
H2Config.copy(config).build().getMaxContinuations(); // 100, expected 5
{code}

I ran into this through WebSocketH2ServerBootstrap in httpclient5-websocket. 
When push is enabled, setH2Config() does 
{{H2Config.copy(h2Config).setPushEnabled(false).build()}}. Push is on by 
default, so a server set up with 
{{H2Config.custom().setMaxContinuations(2).build()}} actually runs with a limit 
of 100.

To check it end to end I started a WebSocketH2ServerBootstrap server 
(FORCE_HTTP_2, maxContinuations=2) and sent one HEADERS frame followed by 14 
CONTINUATION frames from a plain socket:

||H2Config passed to setH2Config()||result||
|pushEnabled=true (goes through copy())|header block accepted, server responds 
on stream 1|
|pushEnabled=false (used as is)|GOAWAY ENHANCE_YOUR_CALM "Excessive number of 
continuation frames"|

After adding {{.setMaxContinuations(config.getMaxContinuations())}} to copy(), 
both cases get the GOAWAY.

Tested with core master (2f7e88e88) and client master (724cf0044).

The same line is also in PR #695 (ORIGIN frame), but that one is a larger 
change. I can send a small PR with a test for just this if that helps.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to