Closed glassfishrobot closed 7 years ago
Reported by pdudits
pdudits said: My humble attempt at fix would be to invoke doCommit in flushBinaryBuffers:
diff --git a/modules/http/src/main/java/org/glassfish/grizzly/http/io/OutputBuffer.java b/modules/http/src/main/java/org/glassfish/grizzly/http/io/OutputBuffer.java
index e6eda42..dc501d8 100644
--- a/modules/http/src/main/java/org/glassfish/grizzly/http/io/OutputBuffer.java
+++ b/modules/http/src/main/java/org/glassfish/grizzly/http/io/OutputBuffer.java
@@ -1043,6 +1043,7 @@ public class OutputBuffer {
}
if (bufferToFlush != null) {
+ doCommit();
flushBuffer(bufferToFlush, isLast, null);
return true;
@rlubke said: Changes applied:
2.3.x: 35b3977671c154ab81f2039bde25f69e38384f04 master: dbfe68e591ccec62853bfc2ba7e924b454546f93
This issue was imported from java.net JIRA GRIZZLY-1894
Marked as fixed on Tuesday, March 14th 2017, 12:19:27 pm
The fix for #1839 do not invoke lifecycle listeners in all code paths where the Http headers might be actually committed.
In Glassfish I observe OutputBuffer.write(String, int,int) invoking flushBinaryBuffers(false) that in turn commits underlying HttpHeader. Glassfish also has lifecycle listener org.apache.catalina.connector.OutputBuffer$SessionCookieChecker that wants to put in Set-Cookie header right before sending the header out. However, it is not invoked along this codepath, only later when the header is already committed.
The behaviour is also described in Payara issue 1447
Environment
All
Affected Versions
[2.3.26]