r1144391 switched the key for the processor map for this connector from the socket to the socket wrapper. That prevented Comet from being able to retrieve the processor from the map when processing a comet event.
This commit changes all the connectors to map the socket (or rather whatever the SocketWrapper wraps) to the processor rather than the SocketWrapper.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1144557 13f79535-47bb-0310-9956-
ffa450edef68
protected RequestGroupInfo global = new RequestGroupInfo();
protected AtomicLong registerCount = new AtomicLong(0);
- protected ConcurrentHashMap<SocketWrapper<S>,P> connections =
- new ConcurrentHashMap<SocketWrapper<S>,P>();
+ protected ConcurrentHashMap<S,P> connections =
+ new ConcurrentHashMap<S,P>();
protected RecycledProcessors<P,S> recycledProcessors =
new RecycledProcessors<P,S>(this);
public SocketState process(SocketWrapper<S> socket,
SocketStatus status) {
- P processor = connections.remove(socket);
+ P processor = connections.remove(socket.getSocket());
socket.setAsync(false);
@Override
protected void longPoll(SocketWrapper<S> socket, P processor) {
// Same requirements for all AJP connectors
- connections.put(socket, processor);
+ connections.put(socket.getSocket(), processor);
socket.setAsync(true);
}
}
if (log.isDebugEnabled())
log.debug("Iterating through our connections to release a socket channel:"+socket);
boolean released = false;
- Iterator<java.util.Map.Entry<SocketWrapper<NioChannel>, AjpNioProcessor>> it = connections.entrySet().iterator();
+ Iterator<java.util.Map.Entry<NioChannel, AjpNioProcessor>> it = connections.entrySet().iterator();
while (it.hasNext()) {
- java.util.Map.Entry<SocketWrapper<NioChannel>, AjpNioProcessor> entry = it.next();
- if (entry.getKey().getSocket().getIOChannel()==socket) {
+ java.util.Map.Entry<NioChannel, AjpNioProcessor> entry = it.next();
+ if (entry.getKey().getIOChannel()==socket) {
it.remove();
AjpNioProcessor result = entry.getValue();
result.recycle(true);
@Override
protected void longPoll(SocketWrapper<Long> socket,
Http11AprProcessor processor) {
- connections.put(socket, processor);
+ connections.put(socket.getSocket(), processor);
if (processor.isAsync()) {
socket.setAsync(true);
if (log.isDebugEnabled())
log.debug("Iterating through our connections to release a socket channel:"+socket);
boolean released = false;
- Iterator<java.util.Map.Entry<SocketWrapper<NioChannel>, Http11NioProcessor>> it = connections.entrySet().iterator();
+ Iterator<java.util.Map.Entry<NioChannel, Http11NioProcessor>> it = connections.entrySet().iterator();
while (it.hasNext()) {
- java.util.Map.Entry<SocketWrapper<NioChannel>, Http11NioProcessor> entry = it.next();
- if (entry.getKey().getSocket().getIOChannel()==socket) {
+ java.util.Map.Entry<NioChannel, Http11NioProcessor> entry = it.next();
+ if (entry.getKey().getIOChannel()==socket) {
it.remove();
Http11NioProcessor result = entry.getValue();
result.recycle();
@Override
protected void longPoll(SocketWrapper<NioChannel> socket,
Http11NioProcessor processor) {
- connections.put(socket, processor);
+ connections.put(socket.getSocket(), processor);
if (processor.isAsync()) {
socket.setAsync(true);
@Override
protected void longPoll(SocketWrapper<Socket> socket,
Http11Processor processor) {
- connections.put(socket, processor);
+ connections.put(socket.getSocket(), processor);
}
@Override