From fbdabf9b0aeb029963ee74114f0baf55e8af4eba Mon Sep 17 00:00:00 2001 From: fhanik Date: Mon, 24 Nov 2008 11:32:02 +0000 Subject: [PATCH] Fix NPE git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@720173 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/Http11NioProcessor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index 425d8c486..818b59440 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -1208,6 +1208,7 @@ public class Http11NioProcessor implements ActionHook { } else if (actionCode == ActionCode.ACTION_COMET_END) { comet = false; } else if (actionCode == ActionCode.ACTION_COMET_CLOSE) { + if (socket==null || socket.getAttachment(false)==null) return; NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getAttachment(false); attach.setCometOps(NioEndpoint.OP_CALLBACK); //notify poller if not on a tomcat thread @@ -1216,6 +1217,7 @@ public class Http11NioProcessor implements ActionHook { socket.getPoller().cometInterest(socket); } else if (actionCode == ActionCode.ACTION_COMET_SETTIMEOUT) { if (param==null) return; + if (socket==null || socket.getAttachment(false)==null) return; NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getAttachment(false); long timeout = ((Long)param).longValue(); //if we are not piggy backing on a worker thread, set the timeout -- 2.11.0