Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 20103 invoked from network); 14 Apr 2007 16:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Apr 2007 16:32:15 -0000 Received: (qmail 70622 invoked by uid 500); 14 Apr 2007 16:32:14 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 70568 invoked by uid 500); 14 Apr 2007 16:32:14 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 70557 invoked by uid 500); 14 Apr 2007 16:32:14 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 70554 invoked by uid 99); 14 Apr 2007 16:32:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Apr 2007 09:32:14 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Apr 2007 09:32:07 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 67F621A9838; Sat, 14 Apr 2007 09:31:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r528832 - in /tomcat/tc6.0.x/trunk/java/org/apache: coyote/http11/Http11NioProcessor.java tomcat/util/net/NioEndpoint.java tomcat/util/net/SocketProperties.java Date: Sat, 14 Apr 2007 16:31:47 -0000 To: tomcat-dev@jakarta.apache.org From: fhanik@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070414163147.67F621A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fhanik Date: Sat Apr 14 09:31:45 2007 New Revision: 528832 URL: http://svn.apache.org/viewvc?view=rev&rev=528832 Log: Revert to revision 528735, something is broken and I'm losing my mind Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?view=diff&rev=528832&r1=528831&r2=528832 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sat Apr 14 09:31:45 2007 @@ -950,14 +950,7 @@ rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); - if (!error && keepAlive && !comet) { - //we're at a keep alive stage, - openSocket = true; - //Add the socket to the poller - socket.getPoller().add(socket); - //free up the thread - break; - } + } rp.setStage(org.apache.coyote.Constants.STAGE_ENDED); Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=528832&r1=528831&r2=528832 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Sat Apr 14 09:31:45 2007 @@ -1116,11 +1116,21 @@ workers.notify(); } } + /** + * Process given socket. + */ + protected boolean processSocket(NioChannel socket) { + return processSocket(socket,null); + } /** * Process given socket for an event. */ + protected boolean processSocket(NioChannel socket, SocketStatus status) { + return processSocket(socket,status,true); + } + protected boolean processSocket(NioChannel socket, SocketStatus status, boolean dispatch) { try { if (executor == null) { @@ -1316,7 +1326,7 @@ public void addEvent(Runnable event) { events.offer(event); - if ( wakeupCounter.incrementAndGet() == 1 || wakeupCounter.get() > 5 ) selector.wakeup(); + if ( wakeupCounter.incrementAndGet() < 3 ) selector.wakeup(); } /** @@ -1418,10 +1428,7 @@ int keyCount = 0; try { if ( !close ) { - if ( wakeupCounter.get() > 0 ) - keyCount = selector.selectNow(); //we have events that need to be processed - else - keyCount = selector.select(selectorTimeout); + keyCount = selector.select(selectorTimeout); wakeupCounter.set(0); } if (close) { @@ -1494,8 +1501,8 @@ //check if thread is available if ( isWorkerAvailable() ) { unreg(sk, attachment); - if (!processSocket(channel, SocketStatus.OPEN,true)) - processSocket(channel, SocketStatus.DISCONNECT,true); + if (!processSocket(channel, SocketStatus.OPEN)) + processSocket(channel, SocketStatus.DISCONNECT); attachment.setFairness(0); } else { //increase the fairness counter @@ -1509,7 +1516,7 @@ //later on, improve latch behavior if ( isWorkerAvailable() ) { unreg(sk, attachment); - boolean close = (!processSocket(channel,null,true)); + boolean close = (!processSocket(channel)); if (close) { cancelledKey(sk,SocketStatus.DISCONNECT,false); } @@ -1622,6 +1629,7 @@ cancelledKey(key, SocketStatus.ERROR,false); } }//for + if ( log.isDebugEnabled() ) log.debug("Poller processed "+keycount+" keys through timeout"); } } @@ -1911,8 +1919,6 @@ } finally { //dereference socket to let GC do its job socket = null; - this.socket = null; - key = null; // Finish up this request recycleWorkerThread(this); } Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java?view=diff&rev=528832&r1=528831&r2=528832 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Sat Apr 14 09:31:45 2007 @@ -82,7 +82,7 @@ * The application write buffer size in bytes * Default value is txBufSize */ - protected int appWriteBufSize = txBufSize; + protected int appWriteBufSize = 8192; /** * NioChannel pool size for the endpoint, --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org