Skip to content

Commit

Permalink
Pull up longPoll() to the base Protocol implementation
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1682164 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed May 28, 2015
1 parent d7d7c11 commit 0598f7e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
18 changes: 16 additions & 2 deletions java/org/apache/coyote/AbstractProtocol.java
Expand Up @@ -831,8 +831,22 @@ public SocketState process(SocketWrapperBase<S> wrapper,
}

protected abstract P createProcessor();
protected abstract void longPoll(SocketWrapperBase<?> socket,
Processor processor);


protected void longPoll(SocketWrapperBase<?> socket, Processor processor) {
if (processor.isAsync()) {
// Async
socket.setAsync(true);
} else {
// This branch is currently only used with HTTP
// Either:
// - this is an upgraded connection
// - the request line/headers have not been completely
// read
socket.registerReadInterest();
}
}


/**
* Expected to be used by the handler once the processor is no longer
Expand Down
6 changes: 0 additions & 6 deletions java/org/apache/coyote/ajp/AbstractAjpProtocol.java
Expand Up @@ -21,7 +21,6 @@
import javax.servlet.http.HttpUpgradeHandler;

import org.apache.coyote.AbstractProtocol;
import org.apache.coyote.Processor;
import org.apache.coyote.UpgradeProtocol;
import org.apache.tomcat.util.net.AbstractEndpoint;
import org.apache.tomcat.util.net.SSLHostConfig;
Expand Down Expand Up @@ -168,11 +167,6 @@ protected AjpProcessor createProcessor() {
return processor;
}

@Override
protected void longPoll(SocketWrapperBase<?> socket, Processor processor) {
// Same requirements for all AJP connectors
socket.setAsync(true);
}

@Override
protected AjpProcessor createUpgradeProcessor(SocketWrapperBase<?> socket,
Expand Down
15 changes: 0 additions & 15 deletions java/org/apache/coyote/http11/AbstractHttp11Protocol.java
Expand Up @@ -627,20 +627,5 @@ protected Processor createUpgradeProcessor(
return new UpgradeProcessorExternal(socket, leftoverInput, httpUpgradeHandler);
}
}


@Override
protected void longPoll(SocketWrapperBase<?> socket, Processor processor) {
if (processor.isAsync()) {
// Async
socket.setAsync(true);
} else {
// Either:
// - this is an upgraded connection
// - the request line/headers have not been completely
// read
socket.registerReadInterest();
}
}
}
}

0 comments on commit 0598f7e

Please sign in to comment.