ari-ban / issue-test

0 stars 0 forks source link

Regression: not possible to turn off chunking response #1882

Closed arinban closed 7 years ago

arinban commented 7 years ago

Currently, it's impossible to turn off response chunking in Grizzly.

The offending line of code is here - HttpServletFilter.java, line 649 and 650:

// set the default chunking mode
        request.getResponse().setChunkingAllowed(
!request.getUpgradeDC().isNull() || isChunkingEnabled());

I believe this should be && instead of ||

// set the default chunking mode
        request.getResponse().setChunkingAllowed(
!request.getUpgradeDC().isNull() && isChunkingEnabled());

This way, when chunking is disabled, chunking is actually disabled in this code.

Thank you!

Environment

Any

Affected Versions

[2.3.28]

arinban commented 6 years ago
arinban commented 7 years ago

@glassfishrobot Commented Reported by lprimak

arinban commented 7 years ago

@glassfishrobot Commented @rlubke said: Between what versions did the regression occur? Those two lines of code have been in there since Aug 2014.

I've tried the change, but this triggered some OOM issues in the HTTP/2 test suite. Working on understanding why.

arinban commented 7 years ago

@glassfishrobot Commented lprimak said: Not sure. It was a regression from a customer perspective.

arinban commented 7 years ago

@glassfishrobot Commented @rlubke said: Looks like that check against the UpgradeDC is completely unnecessary based on code added in 2015. Removed that check. Tests appear to be okay. Would be great if you could validate it against Payara.

arinban commented 7 years ago

@glassfishrobot Commented lprimak said: Validated. Just plain isChunkingEnabled() there works correctly.

arinban commented 7 years ago

@glassfishrobot Commented @rlubke said: Changes applied. If you could give tonight's nightly a shot, I'd appreciate it.

arinban commented 7 years ago

@glassfishrobot Commented lprimak said: Thanks! will do

arinban commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GRIZZLY-1882

arinban commented 7 years ago

@glassfishrobot Commented Marked as fixed on Tuesday, January 3rd 2017, 5:03:20 pm