Skip to content

Commit 0f73da4

Browse files
committed
Fix BZ 69982 Flush final block of TLS response payload
https://bz.apache.org/bugzilla/show_bug.cgi?id=69982
1 parent 1c95f0e commit 0f73da4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

java/org/apache/tomcat/util/net/NioEndpoint.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,25 @@ private boolean socketOrNetworkBufferHasDataLeft() {
13791379
return !socketBufferHandler.isWriteBufferEmpty() || getSocket().getOutboundRemaining() > 0;
13801380
}
13811381

1382+
/*
1383+
* https://bz.apache.org/bugzilla/show_bug.cgi?id=69982
1384+
*
1385+
* Similar to socketOrNetworkBufferHasDataLeft(), check the additional buffer for TLS
1386+
*/
1387+
@Override
1388+
public boolean hasDataToWrite() {
1389+
return super.hasDataToWrite() || getSocket().getOutboundRemaining() > 0;
1390+
}
1391+
1392+
/*
1393+
* https://bz.apache.org/bugzilla/show_bug.cgi?id=69982
1394+
*
1395+
* Similar to socketOrNetworkBufferHasDataLeft(), check the additional buffer for TLS
1396+
*/
1397+
@Override
1398+
public boolean canWrite() {
1399+
return super.canWrite() && getSocket().getOutboundRemaining() == 0;
1400+
}
13821401

13831402
@Override
13841403
protected void doWrite(boolean block, ByteBuffer buffer) throws IOException {

0 commit comments

Comments
 (0)