elecharny commented on code in PR #84:
URL: https://github.com/apache/mina/pull/84#discussion_r4660002748
##########
mina-core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java:
##########
@@ -210,35 +212,40 @@ public void filterWrite(final NextFilter nextFilter,
final IoSession session, fi
public void writeData(final NextFilter nextFilter, final IoSession
session, final WriteRequest writeRequest,
final boolean isHandshakeData) {
ProxyLogicHandler handler = getProxyHandler(session);
+ boolean forward;
synchronized (handler) {
if (handler.isHandshakeComplete()) {
// Handshake is done - write data as normal
- nextFilter.filterWrite(session, writeRequest);
+ forward = true;
} else if (isHandshakeData) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(" handshake data: {}",
writeRequest.getMessage());
}
-
- // Writing handshake data
- nextFilter.filterWrite(session, writeRequest);
+ forward = true;
} else {
// Writing non-handshake data before the handshake finished
if (!session.isConnected()) {
// Not even connected - ignore
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(" Write request on closed session.
Request ignored.");
}
+ forward = false;
} else {
// Queue the data to be sent as soon as the handshake
completes
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(" Handshaking is not complete yet.
Buffering write request.");
}
handler.enqueueWriteRequest(nextFilter, writeRequest);
+ forward = false;
Review Comment:
Move the forward = false out of the if, it's always false when the handshake
has not been completed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]