cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2005-01-29 Thread pero
pero2005/01/29 11:30:44

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  recreate server Socket after stop!
  
  Revision  ChangesPath
  1.43  +1 -0  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- PoolTcpEndpoint.java  14 Oct 2004 08:07:48 -  1.42
  +++ PoolTcpEndpoint.java  29 Jan 2005 19:30:44 -  1.43
  @@ -350,6 +350,7 @@
   if (!lf) {
   threadStop();
   }
  +initialized=false ;
   }
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-10-14 Thread remm
remm2004/10/14 01:07:48

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Remove bad shutdown logic for ms strategy.
  
  Revision  ChangesPath
  1.42  +3 -7  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- PoolTcpEndpoint.java  5 Oct 2004 22:16:20 -   1.41
  +++ PoolTcpEndpoint.java  14 Oct 2004 08:07:48 -  1.42
  @@ -342,13 +342,14 @@
   if (running) {
   if (lf) {
   tp.shutdown();
  -} else {
  -threadStop();
   }
   running = false;
   if (serverSocket != null) {
   closeServerSocket();
   }
  +if (!lf) {
  +threadStop();
  +}
   }
   }
   
  @@ -668,11 +669,6 @@
* Stop the background processing thread.
*/
   private void threadStop() {
  -try {
  -threadSync.wait(5000);
  -} catch (InterruptedException e) {
  -;
  -}
   thread = null;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-10-05 Thread remm
remm2004/10/05 15:16:20

  Modified:util/java/org/apache/tomcat/util/net/res
LocalStrings.properties
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Improve i18n (help is needed to do this kind of work everywhere :) ).
  - Improve error message when a SocketException occurs in setSocketOptions.
  
  Revision  ChangesPath
  1.5   +6 -0  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalStrings.properties   11 Oct 2003 14:37:00 -  1.4
  +++ LocalStrings.properties   5 Oct 2004 22:16:20 -   1.5
  @@ -4,3 +4,9 @@
   endpoint.warn.reinit=Reinitializing ServerSocket
   endpoint.warn.restart=Restarting endpoint
   endpoint.warn.security=Endpoint {0} security exception: {1}
  +endpoint.err.socket=Socket error caused by remote host {0}
  +endpoint.err.handshake=Handshake failed
  +endpoint.err.unexpected=Unexpected error processing socket
  +endpoint.warn.nullSocket=Null socket returned by accept
  +endpoint.debug.unlock=Caught exception trying to unlock accept on port {0}
  +endpoint.err.close=Caught exception trying to close socket
  \ No newline at end of file
  
  
  
  1.41  +15 -15
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- PoolTcpEndpoint.java  3 Oct 2004 11:48:59 -   1.40
  +++ PoolTcpEndpoint.java  5 Oct 2004 22:16:20 -   1.41
  @@ -359,7 +359,7 @@
   if( serverSocket!=null)
   serverSocket.close();
   } catch(Exception e) {
  -log.error(Caught exception trying to close socket., e);
  +log.error(sm.getString(endpoint.err.close), e);
   }
   serverSocket = null;
   }
  @@ -369,16 +369,17 @@
   try {
   // Need to create a connection to unlock the accept();
   if (inet == null) {
  -s=new Socket(127.0.0.1, port );
  -}else{
  -s=new Socket(inet, port );
  +s = new Socket(127.0.0.1, port);
  +} else {
  +s = new Socket(inet, port);
   // setting soLinger to a small value will help shutdown the
   // connection quicker
   s.setSoLinger(true, 0);
   }
   } catch(Exception e) {
  -log.debug(Caught exception trying to unlock accept on  + port
  -  +   + e.toString());
  +if (log.isDebugEnabled()) {
  +log.debug(sm.getString(endpoint.debug.unlock,  + port), e);
  +}
   } finally {
   if (s != null) {
   try {
  @@ -404,7 +405,7 @@
   accepted = factory.acceptSocket(serverSocket);
   }
   if (null == accepted) {
  -log.warn(Null socket returned by accept);
  +log.warn(sm.getString(endpoint.warn.nullSocket));
   } else {
   if (!running) {
   accepted.close();  // rude, but unlikely!
  @@ -425,7 +426,7 @@
   // socket with SocketPermission's.
   // Log the unauthorized access and continue
   String msg = sm.getString(endpoint.warn.security,
  -  serverSocket,ace);
  +  serverSocket, ace);
   log.warn(msg);
   }
   catch (IOException e) {
  @@ -524,11 +525,8 @@
   getConnectionHandler().processConnection(con, threadData);
   
   } catch (SocketException se) {
  -PoolTcpEndpoint.log.error(
  -Remote Host 
  -+ s.getInetAddress()
  -+  SocketException: 
  -+ se.getMessage());
  +log.error(sm.getString(endpoint.err.socket, s.getInetAddress()),
  +se);
   // Try to close the socket
   try {
   s.close();
  @@ -536,9 +534,11 @@
   }
   } catch (Throwable t) {
   if (step == 2) {
  -PoolTcpEndpoint.log.debug(Handshake failed, t);
  +if (log.isDebugEnabled()) {
  +log.debug(sm.getString(endpoint.err.handshake), t);
  + 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-10-03 Thread remm
remm2004/10/03 04:48:59

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Oops, made a mistake with what the default should be. Probably I set that to the 
wrong value during early testing.
  
  Revision  ChangesPath
  1.40  +1 -1  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- PoolTcpEndpoint.java  1 Oct 2004 23:46:57 -   1.39
  +++ PoolTcpEndpoint.java  3 Oct 2004 11:48:59 -   1.40
  @@ -86,7 +86,7 @@
   protected boolean tcpNoDelay=false;
   protected int linger=100;
   protected int socketTimeout=-1;
  -private boolean lf = false;
  +private boolean lf = true;
   
   
   // -- Leader follower fields
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-05-27 Thread yoavs
yoavs   2004/05/27 09:12:46

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Added support for threadPriority attribute 
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28914).
  
  Revision  ChangesPath
  1.37  +9 -3  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- PoolTcpEndpoint.java  24 Feb 2004 08:50:05 -  1.36
  +++ PoolTcpEndpoint.java  27 May 2004 16:12:46 -  1.37
  @@ -52,6 +52,7 @@
* @author James Todd [EMAIL PROTECTED]
* @author [EMAIL PROTECTED]
* @author Gal Shachor [EMAIL PROTECTED]
  + * @author Yoav Shapira [EMAIL PROTECTED]
*/
   public class PoolTcpEndpoint { // implements Endpoint {
   
  @@ -84,8 +85,6 @@
   static final int debug=0;
   
   ThreadPool tp;
  -// XXX Do we need it for backward compat ?
  -//protected Log _log=Log.getLog(tc/PoolTcpEndpoint, PoolTcpEndpoint);
   
   static Log log=LogFactory.getLog(PoolTcpEndpoint.class );
   
  @@ -94,7 +93,6 @@
   protected int socketTimeout=-1;
   
   public PoolTcpEndpoint() {
  - //  super(tc_log);// initialize default logger
tp = new ThreadPool();
   }
   
  @@ -137,6 +135,14 @@
   
   public int getMinSpareThreads() {
   return tp.getMinSpareThreads();
  +}
  +
  +public void setThreadPriority(int threadPriority) {
  +  tp.setThreadPriority(threadPriority);
  +}
  +
  +public int getThreadPriority() {
  +  return tp.getThreadPriority();
   }
   
   public int getPort() {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-02-03 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
luehe   2004/02/02 15:08:29

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Expose handshake failure as error, so it gets logged unconditionally
-1. Unlike what occurs for normal sockets, errors at this point are 
rather common, because the process is fairly long. So this was done on 
purpose to minimise the amount of logging.

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-02-03 Thread luehe
luehe   2004/02/03 12:28:56

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Reverted change that was done in revision 1.34
  
  Revision  ChangesPath
  1.35  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- PoolTcpEndpoint.java  2 Feb 2004 23:08:29 -   1.34
  +++ PoolTcpEndpoint.java  3 Feb 2004 20:28:56 -   1.35
  @@ -633,7 +633,7 @@
   }
   } catch (Throwable t) {
   if (step == 2) {
  -PoolTcpEndpoint.log.error(Handshake failed, t);
  +PoolTcpEndpoint.log.debug(Handshake failed, t);
   } else {
   PoolTcpEndpoint.log.error(Unexpected error, t);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-02-02 Thread luehe
luehe   2004/02/02 15:08:29

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Expose handshake failure as error, so it gets logged unconditionally
  
  Revision  ChangesPath
  1.34  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- PoolTcpEndpoint.java  26 Jan 2004 19:49:18 -  1.33
  +++ PoolTcpEndpoint.java  2 Feb 2004 23:08:29 -   1.34
  @@ -633,7 +633,7 @@
   }
   } catch (Throwable t) {
   if (step == 2) {
  -PoolTcpEndpoint.log.debug(Handshake failed, t);
  +PoolTcpEndpoint.log.error(Handshake failed, t);
   } else {
   PoolTcpEndpoint.log.error(Unexpected error, t);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-26 Thread remm
remm2004/01/26 10:19:48

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Implement clean shutdown of the connectors (my third proposal).
  - Add pause and resume methods on the TCP endpoint.
  - The method I've choosen is to stop accepting to inform whatever the load balancer 
is
that the server is down. A plus: clients will wait until the connector is 
unpaused, up
to the configured backlog for the server socket. Another method would be to accept 
and
close the connection right away.
accept and close the socket right away
  
  Revision  ChangesPath
  1.32  +50 -12
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- PoolTcpEndpoint.java  13 Jan 2004 10:16:38 -  1.31
  +++ PoolTcpEndpoint.java  26 Jan 2004 18:19:48 -  1.32
  @@ -127,6 +127,7 @@
   
   ThreadPoolRunnable listener;
   private volatile boolean running = false;
  +private volatile boolean paused = false;
   private boolean initialized = false;
   private boolean reinitializing = false;
   static final int debug=0;
  @@ -227,6 +228,10 @@
return running;
   }
   
  +public boolean isPaused() {
  + return paused;
  +}
  +
   /**
* Allows the server developer to specify the backlog that
* should be used for server sockets. By default, this value
  @@ -322,6 +327,7 @@
tp.start();
}
running = true;
  +paused = false;
   if(isPool) {
listener = new TcpWorkerThread(this);
   tp.runIt(listener);
  @@ -330,6 +336,19 @@
}
   }
   
  +public void pauseEndpoint() {
  +if (running  !paused) {
  +paused = true;
  +unlockAccept();
  +}
  +}
  +
  +public void resumeEndpoint() {
  +if (running) {
  +paused = false;
  +}
  +}
  +
   public void stopEndpoint() {
if (running) {
tp.shutdown();
  @@ -341,6 +360,18 @@
   }
   
   protected void closeServerSocket() {
  +if (!paused)
  +unlockAccept();
  +try {
  +if( serverSocket!=null)
  +serverSocket.close();
  +} catch(Exception e) {
  +log.error(Caught exception trying to close socket., e);
  +}
  +serverSocket = null;
  +}
  +
  +protected void unlockAccept() {
   Socket s = null;
   try {
   // Need to create a connection to unlock the accept();
  @@ -353,8 +384,8 @@
   s.setSoLinger(true, 0);
   }
   } catch(Exception e) {
  -log.error(Caught exception trying to unlock accept on  + port
  -+   + e.toString());
  +log.debug(Caught exception trying to unlock accept on  + port
  +  +   + e.toString());
   } finally {
   if (s != null) {
   try {
  @@ -364,13 +395,6 @@
   }
   }
   }
  -try {
  -if( serverSocket!=null)
  -serverSocket.close();
  -} catch(Exception e) {
  -log.error(Caught exception trying to close socket., e);
  -}
  -serverSocket = null;
   }
   
   //  Private methods
  @@ -552,6 +576,17 @@
   
// Create per-thread cache
if (endpoint.isRunning()) {
  +
  +// Loop if endpoint is paused
  +while (endpoint.isPaused()) {
  +try {
  +Thread.sleep(1000);
  +} catch (InterruptedException e) {
  +// Ignore
  +}
  +}
  +
  +// Accept a new connection
Socket s = null;
try {
   s = endpoint.acceptSocket();
  @@ -561,6 +596,8 @@
   endpoint.tp.runIt(this);
   }
   }
  +
  +// Process the connection
if (null != s) {
   
   TcpConnection con = null;
  @@ -608,6 +645,7 @@
   }
   }
}
  +
}
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-26 Thread remm
remm2004/01/26 11:49:18

  Modified:util/java/org/apache/tomcat/util/threads Reaper.java
ThreadPool.java
   util/java/org/apache/tomcat/util/buf MessageBytes.java
UDecoder.java
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Remove compilation warnings.
  
  Revision  ChangesPath
  1.5   +54 -51
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/Reaper.java
  
  Index: Reaper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/Reaper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Reaper.java   2 Sep 2003 21:34:38 -   1.4
  +++ Reaper.java   26 Jan 2004 19:49:17 -  1.5
  @@ -68,91 +68,94 @@
* @author Costin Manolache
*/
   public class Reaper extends Thread {
  -private boolean daemon=false;
  +private boolean daemon = false;
   
   public Reaper() {
  - if( daemon )
  +if (daemon)
   this.setDaemon(true);
  - this.setName(TomcatReaper);
  +this.setName(TomcatReaper);
   }
   
   public Reaper(String name) {
  -if( daemon )
  +if (daemon)
   this.setDaemon(true);
  - this.setName(name);
  +this.setName(name);
   }
   
   private long interval = 1000 * 60; //ms
  -
  +
   // XXX TODO Allow per/callback interval, find next, etc
   // Right now the interval is used for all callbacks
   // and it represent a sleep between runs.
  -
  -ThreadPoolRunnable cbacks[]=new ThreadPoolRunnable[30]; // XXX max
  -Object tdata[][]=new Object[30][]; // XXX max
  -int count=0;
  +
  +ThreadPoolRunnable cbacks[] = new ThreadPoolRunnable[30]; // XXX max
  +Object tdata[][] = new Object[30][]; // XXX max
  +int count = 0;
   
   /** Adding and removing callbacks is synchronized
*/
  -Object lock=new Object();
  -static boolean running=true;
  +Object lock = new Object();
  +static boolean running = true;
   
   // XXX Should be called 'interval' not defaultInterval
   
  -public void setDefaultInterval( long t ) {
  - interval=t;
  +public void setDefaultInterval(long t) {
  +interval = t;
   }
   
   public long getDefaultIntervale() {
   return interval;
   }
   
  -public int addCallback( ThreadPoolRunnable c, int interval ) {
  - synchronized( lock ) {
  - cbacks[count]=c;
  - count++;
  - return count-1;
  - }
  +public int addCallback(ThreadPoolRunnable c, int interval) {
  +synchronized (lock) {
  +cbacks[count] = c;
  +count++;
  +return count - 1;
  +}
   }
   
  -public void removeCallback( int idx ) {
  - synchronized( lock ) {
  - count--;
  - cbacks[idx]=cbacks[count];
  - cbacks[count]=null;
  - }
  +public void removeCallback(int idx) {
  +synchronized (lock) {
  +count--;
  +cbacks[idx] = cbacks[count];
  +cbacks[count] = null;
  +}
   }
   
   public void startReaper() {
  - running=true;
  - this.start();
  +running = true;
  +this.start();
   }
   
   public synchronized void stopReaper() {
  - running=false;
  - System.out.println(Stop reaper );
  - this.interrupt(); // notify() doesn't stop sleep
  +running = false;
  +System.out.println(Stop reaper );
  +this.interrupt(); // notify() doesn't stop sleep
   }
  -
  +
   public void run() {
  - while (running) {
  - if( !running) break;
  - try {
  - this.sleep(interval);
  - } catch (InterruptedException ie) {
  - // sometimes will happen
  - }
  -
  - if( !running) break;
  - for( int i=0; i count; i++ ) {
  - ThreadPoolRunnable callB=cbacks[i];
  - // it may be null if a callback is removed.
  - //  I think the code is correct
  - if( callB!= null ) {
  - callB.runIt( tdata[i] );
  - }
  - if( !running) break;
  - }
  - }
  +while (running) {
  +if (!running)
  +break;
  +try {
  +Thread.sleep(interval);
  +} catch (InterruptedException ie) {
  +// sometimes will happen
  +}
  +
  +if (!running)
  +break;
  +for (int i = 0; i  count; i++) {
  +ThreadPoolRunnable callB = cbacks[i];
  +// it may be null if a callback is removed.
  +//  I think the code is correct
  +if (callB != 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-13 Thread remm
remm2004/01/13 01:56:24

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Fix build.
  - Also group evertything in a big try catch, with a small flag for the logging.
That way, this critical code will be less error prone. Logging will be, but it's
less important.
  
  Revision  ChangesPath
  1.30  +27 -21
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- PoolTcpEndpoint.java  13 Jan 2004 04:58:34 -  1.29
  +++ PoolTcpEndpoint.java  13 Jan 2004 09:56:24 -  1.30
  @@ -574,22 +574,22 @@
   }
   }
if (null != s) {
  -endpoint.setSocketOptions( s );
  - try {
  +
  +TcpConnection con = null;
  +int step = 1;
  +try {
  +
  +// 1: Set socket options: timeout, linger, etc
  +endpoint.setSocketOptions( s );
  +
  +// 2: SSL handshake
  +step = 2;
if(endpoint.getServerSocketFactory()!=null) {
   endpoint.getServerSocketFactory().handshake(s);
}
  -} catch (Throwable t) {
  -endpoint.log.debug(Handshake failed, t);
  -// Try to close the socket
  -try {
  -s.close();
  -} catch (IOException e) {}
  -return;
  -}
   
  -TcpConnection con = null;
  -try {
  +// 3: Process the connection
  +step = 3;
if( usePool ) {
con=(TcpConnection)connectionCache.get();
if( con == null ) 
  @@ -598,20 +598,26 @@
   con = (TcpConnection) perThrData[0];
   perThrData = (Object []) perThrData[1];
}
  - 
  +
con.setEndpoint(endpoint);
con.setSocket(s);
  - endpoint.getConnectionHandler().processConnection(con, perThrData);
  + endpoint.getConnectionHandler()
  +.processConnection(con, perThrData);
  +
   } catch (SocketException se) {
  -endpoint.log.error(
  -   Remote Host  + s.getInetAddress() +
  -SocketException:  + se.getMessage());
  +endpoint.log.error
  +(Remote Host  + s.getInetAddress() +
  +  SocketException:  + se.getMessage());
   // Try to close the socket
   try {
   s.close();
   } catch (IOException e) {}
   } catch (Throwable t) {
  -endpoint.log.error(Unexpected error, t);
  +if (step == 2) {
  +endpoint.log.debug(Handshake failed, t);
  +} else {
  +endpoint.log.error(Unexpected error, t);
  +}
   // Try to close the socket
   try {
   s.close();
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-13 Thread Remy Maucherat
   		if( usePool ) {
   			con=(TcpConnection)connectionCache.get();
   			if( con == null ) 
I would like to remove this pool thing. It is dead code (there's a 
static final flag to enable it at compile time), so I think it should go.

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-13 Thread remm
remm2004/01/13 02:16:39

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - So I'm removing the pool thing. Feel free to let me know if this was actually
useful.
  
  Revision  ChangesPath
  1.31  +10 -33
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- PoolTcpEndpoint.java  13 Jan 2004 09:56:24 -  1.30
  +++ PoolTcpEndpoint.java  13 Jan 2004 10:16:38 -  1.31
  @@ -535,29 +535,17 @@
  We also want to use per/thread data and avoid sync wherever possible.
   */
   PoolTcpEndpoint endpoint;
  -SimplePool connectionCache;
  -static final boolean usePool=false;
   
   public TcpWorkerThread(PoolTcpEndpoint endpoint) {
this.endpoint = endpoint;
  - if( usePool ) {
  - connectionCache = new SimplePool(endpoint.getMaxThreads());
  - for(int i = 0 ; i  endpoint.getMaxThreads()/2 ; i++) {
  - connectionCache.put(new TcpConnection());
  - }
  - }
   }
   
   public Object[] getInitData() {
  - if( usePool ) {
  - return endpoint.getConnectionHandler().init();
  - } else {
  - // no synchronization overhead, but 2 array access 
  - Object obj[]=new Object[2];
  - obj[1]= endpoint.getConnectionHandler().init();
  - obj[0]=new TcpConnection();
  - return obj;
  - }
  +// no synchronization overhead, but 2 array access 
  +Object obj[]=new Object[2];
  +obj[1]= endpoint.getConnectionHandler().init();
  +obj[0]=new TcpConnection();
  +return obj;
   }
   
   public void runIt(Object perThrData[]) {
  @@ -590,19 +578,11 @@
   
   // 3: Process the connection
   step = 3;
  - if( usePool ) {
  - con=(TcpConnection)connectionCache.get();
  - if( con == null ) 
  - con = new TcpConnection();
  - } else {
  -con = (TcpConnection) perThrData[0];
  -perThrData = (Object []) perThrData[1];
  - }
  -
  +con = (TcpConnection) perThrData[0];
con.setEndpoint(endpoint);
con.setSocket(s);
endpoint.getConnectionHandler()
  -.processConnection(con, perThrData);
  +.processConnection(con, (Object []) perThrData[1]);
   
   } catch (SocketException se) {
   endpoint.log.error
  @@ -625,9 +605,6 @@
   } finally {
   if (con != null) {
   con.recycle();
  -if (usePool) {
  -connectionCache.put(con);
  -}
   }
   }
}
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-12 Thread billbarker
billbarker2004/01/12 20:58:35

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Move the call to setSocketOptions to prevent a potential DoS condition when using 
SSL.
  
  Reported By: Alex Chan [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.29  +4 -5  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- PoolTcpEndpoint.java  24 Nov 2003 23:01:21 -  1.28
  +++ PoolTcpEndpoint.java  13 Jan 2004 04:58:34 -  1.29
  @@ -574,7 +574,7 @@
   }
   }
if (null != s) {
  - 
  +endpoint.setSocketOptions( s );
try {
if(endpoint.getServerSocketFactory()!=null) {
   endpoint.getServerSocketFactory().handshake(s);
  @@ -601,7 +601,6 @@

con.setEndpoint(endpoint);
con.setSocket(s);
  - endpoint.setSocketOptions( s );
endpoint.getConnectionHandler().processConnection(con, perThrData);
   } catch (SocketException se) {
   endpoint.log.error(
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-25 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
amyroh  2003/11/24 15:01:22

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Add getters for all attributes defined in MBeanInfo so getAttribute calls suceed.
Doing this is not good: these are attributes of the thread pool, not of 
the protocol. I believe each one has its MBean, so there's no problem.

I will not integrate your last two patches in my 5.0.15 tag.

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-25 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
amyroh  2003/11/24 15:01:22

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Add getters for all attributes defined in MBeanInfo so getAttribute calls suceed.
Rectification: I'll integrate your patch, but it would be best to remove 
the fields which are duplicated with the thread pool MBean.

Rémy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-25 Thread Bill Barker

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 12:27 AM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java


 [EMAIL PROTECTED] wrote:
  amyroh  2003/11/24 15:01:22
 
Modified:http11/src/java/org/apache/coyote/http11
Http11Protocol.java
 util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
Log:
Add getters for all attributes defined in MBeanInfo so getAttribute
calls suceed.

 Rectification: I'll integrate your patch, but it would be best to remove
 the fields which are duplicated with the thread pool MBean.


+1.  While I'm totally swamped right now to be able to properly review Amy's
original patch, the Endpoint is not the place for doing this type of JMX
configs.

 Rémy



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-25 Thread Amy Roh
- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 12:27 AM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java


 [EMAIL PROTECTED] wrote:
  amyroh  2003/11/24 15:01:22
 
Modified:http11/src/java/org/apache/coyote/http11
Http11Protocol.java
 util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
Log:
Add getters for all attributes defined in MBeanInfo so getAttribute
calls suceed.

 Rectification: I'll integrate your patch, but it would be best to remove
 the fields which are duplicated with the thread pool MBean.

Question...  How are the attributes for these MBeans in j-t-c get generated?
I don't see descriptor files.  It seems if you have setters, the
correspondent attributes get automatically added to MBeanInfo.  And you get
an error trying to getAttribute on the attribute which is included in
MBeanInfo because it's missing getter methods.

Thanks,
Amy

 Rémy



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-24 Thread amyroh
amyroh  2003/11/24 15:01:22

  Modified:http11/src/java/org/apache/coyote/http11 Http11Protocol.java
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Add getters for all attributes defined in MBeanInfo so getAttribute calls suceed.
  
  Revision  ChangesPath
  1.44  +143 -14   
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- Http11Protocol.java   17 Nov 2003 09:42:40 -  1.43
  +++ Http11Protocol.java   24 Nov 2003 23:01:21 -  1.44
  @@ -264,20 +264,36 @@
   
   //  Pool setup 
   
  +public boolean getPools(){
  +return ep.isPoolOn();
  +}
  +
   public void setPools( boolean t ) {
   ep.setPoolOn(t);
   setAttribute(pools,  + t);
   }
   
  +public int getMaxThreads() {
  +return ep.getMaxThreads();
  +}
  +
   public void setMaxThreads( int maxThreads ) {
   ep.setMaxThreads(maxThreads);
   setAttribute(maxThreads,  + maxThreads);
   }
   
  +public int getMaxSpareThreads() {
  +return ep.getMaxSpareThreads();
  +}
  +
   public void setMaxSpareThreads( int maxThreads ) {
   ep.setMaxSpareThreads(maxThreads);
   setAttribute(maxSpareThreads,  + maxThreads);
   }
  +
  +public int getMinSpareThreads() {
  +return ep.getMinSpareThreads();
  +}
   
   public void setMinSpareThreads( int minSpareThreads ) {
   ep.setMinSpareThreads(minSpareThreads);
  @@ -286,11 +302,19 @@
   
   //  Tcp setup 
   
  +public int getBacklog() {
  +return ep.getBacklog();
  +}
  +
   public void setBacklog( int i ) {
   ep.setBacklog(i);
   setAttribute(backlog,  + i);
   }
   
  +public int getPort() {
  +return ep.getPort();
  +}
  +
   public void setPort( int port ) {
   ep.setPort(port);
   setAttribute(port,  + port);
  @@ -301,123 +325,223 @@
   ep.setAddress( ia );
   setAttribute(address,  + ia);
   }
  -
  -public void setHostName( String name ) {
  +
  +// commenting out for now since it's not doing anything
  +//public void setHostName( String name ) {
   // ??? Doesn't seem to be used in existing or prev code
   // vhost=name;
  -}
  +//}
   
  +public String getSocketFactory() {
  +return socketFactoryName;
  +}
  +
   public void setSocketFactory( String valueS ) {
   socketFactoryName = valueS;
   setAttribute(socketFactory, valueS);
   }
  -
  +
  +public String getSSLImplementation() {
  +return sslImplementationName;
  +}
  +
   public void setSSLImplementation( String valueS) {
   sslImplementationName = valueS;
   setAttribute(sslImplementation, valueS);
   }
   
  +public boolean getTcpNoDelay() {
  +return ep.getTcpNoDelay();
  +}
  +
   public void setTcpNoDelay( boolean b ) {
   ep.setTcpNoDelay( b );
   setAttribute(tcpNoDelay,  + b);
   }
   
  +public boolean getDisableUploadTimeout() {
  +return disableUploadTimeout;
  +}
  +
   public void setDisableUploadTimeout(boolean isDisabled) {
   disableUploadTimeout = isDisabled;
   }
   
  +public int getSocketBuffer() {
  +return socketBuffer;
  +}
  +
   public void setSocketBuffer(int valueI) {
   socketBuffer = valueI;
   }
   
  +public String getCompression() {
  +return compression;
  +}
  +
   public void setCompression(String valueS) {
   compression = valueS;
   setAttribute(compression, valueS);
   }
   
  +public int getMaxPostSize() {
  +return maxPostSize;
  +}
  +
   public void setMaxPostSize(int valueI) {
   maxPostSize = valueI;
   setAttribute(maxPostSize,  + valueI);
   }
   
  +public String getRestrictedUserAgents() {
  +return restrictedUserAgents;
  +}
  +
   public void setRestrictedUserAgents(String valueS) {
   restrictedUserAgents = valueS;
   setAttribute(restrictedUserAgents, valueS);
   }
   
  +public String getNoCompressionUserAgents() {
  +return noCompressionUserAgents;
  +}
  +
   public void setNoCompressionUserAgents(String valueS) {
   noCompressionUserAgents = valueS;
   setAttribute(noCompressionUserAgents, valueS);
   }
   
  +public 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-03 Thread luehe
luehe   2003/11/03 13:13:01

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Reverted support for maxThreads=1
  
  Revision  ChangesPath
  1.27  +9 -24 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- PoolTcpEndpoint.java  30 Oct 2003 21:01:39 -  1.26
  +++ PoolTcpEndpoint.java  3 Nov 2003 21:13:01 -   1.27
  @@ -544,7 +544,7 @@
}
   }
   
  -public void runIt(Object[] perThrData) {
  +public void runIt(Object perThrData[]) {
   
// Create per-thread cache
if (endpoint.isRunning()) {
  @@ -552,16 +552,11 @@
try {
   s = endpoint.acceptSocket();
} finally {
  -/*
  - * Continue accepting on another thread, unless maxThreads has
  - * been set to 1, in which case we have to finish processing
  - * this request before we can accept a new request.
  - */
  -if (endpoint.isRunning()  endpoint.getMaxThreads()  1) {
  + // Continue accepting on another thread...
  +if (endpoint.isRunning()) {
   endpoint.tp.runIt(this);
   }
   }
  -
if (null != s) {

try {
  @@ -579,24 +574,19 @@
   
   TcpConnection con = null;
   try {
  -Object[] localPerThrData = null;
if( usePool ) {
con=(TcpConnection)connectionCache.get();
  - if( con == null ) {
  + if( con == null ) 
con = new TcpConnection();
  - }
  -localPerThrData = perThrData;
} else {
   con = (TcpConnection) perThrData[0];
  -localPerThrData = (Object[]) perThrData[1];
  +perThrData = (Object []) perThrData[1];
}

con.setEndpoint(endpoint);
con.setSocket(s);
endpoint.setSocketOptions( s );
  - endpoint.getConnectionHandler().processConnection(
  -con,
  -localPerThrData);
  + endpoint.getConnectionHandler().processConnection(con, perThrData);
   } catch (SocketException se) {
   endpoint.log.error(
  Remote Host  + s.getInetAddress() +
  @@ -620,11 +610,6 @@
   }
   }
}
  -
  -if (endpoint.getMaxThreads() == 1) {
  -// Ready to accept new request
  -runIt(perThrData);
  -}
}
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-01 Thread Remy Maucherat
Bill Barker wrote:
Jan Luehe [EMAIL PROTECTED] wrote in message

Remy,

I think we should make any maxThreads setting work, as my patch
attempts to do, and update the documentation to make users aware of
the limitations they will run into when picking a low maxThreads.
I think that would be the cleanest solution.
The rationale is that there's no point adding complexity and checks into
the very critical algorithm, simply to be able to support broken cases.
I think we have 2 options:
1. Support any maxThreads setting (including 1, 2, etc.).
2. Reject any maxThreads values that are smaller than some
   threshold and throw an error.
The problem with 2. is that picking a value for the threshold (10? 20?)
seems
rather arbitrary. Therefore, I think we should do 1. The complexity it
is adding is not significant and is well-documented.
Please tell me you agree. :)
Well, I don't agree :).  There is no reason to accept a config value that
won't work, and it is cheaper and safer to handle in the config code then in
the critical runtime code (although, in this particular case, I admit that
the perfomance hit should be minimal).  Personally, I would be perfectly
happy with an enforced min setting of '2' (but Remy's suggestion is much
more practical, given that TC 5 does so much hand-holding already :).  As
long as the override is logged at WARN level, I don't see any problem with
enforcing a minimum.
I agree with Bill.
Hand holding is good :)
Remy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-01 Thread Tim Funk
Could a simple compromise be
- Die (with error message) if  2
- Warn if less than 10 (or ??). Letting the user be stupid, but warn them 
about it.

-Tim

Bill Barker wrote:

Jan Luehe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Remy,


I agree we should help users come up with reasonable config values,
but I'm just afraid rejecting any maxThreads  10 or  20 will send the
wrong message, as if there was a bug in the way we dispatch incoming
requests that requires at least 10 threads.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-01 Thread Remy Maucherat
Tim Funk wrote:
Could a simple compromise be
- Die (with error message) if  2
- Warn if less than 10 (or ??). Letting the user be stupid, but warn 
them about it.
I don't agree with that behavior. Why should we fail or (worse) allow 
bad values ? Good defaults and being tolerant is a quality of good software.

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-11-01 Thread Sriram N
+1 on that.

I'd rather that TC defaulted to safe values over my idotically low or even
absent settings.

-- Sriram

--- Remy Maucherat [EMAIL PROTECTED] wrote:
 Tim Funk wrote:
  Could a simple compromise be
  - Die (with error message) if  2
  - Warn if less than 10 (or ??). Letting the user be stupid, but warn 
  them about it.
 
 I don't agree with that behavior. Why should we fail or (worse) allow 
 bad values ? Good defaults and being tolerant is a quality of good software.
 
 Remy
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-31 Thread Remy Maucherat
Jan Luehe wrote:
Remy Maucherat wrote:
I guess I don't understand what makes 1 bad but 2 OK. Where do we 
draw the line of what is a stupid config?
Yes, definitely, 2 is nearly as stupid as 1. We need a reasonable 
minimal value for maxThreads; let's say 10 - 20.

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-31 Thread Jan Luehe
Remy Maucherat wrote:
Jan Luehe wrote:

Remy Maucherat wrote:
I guess I don't understand what makes 1 bad but 2 OK. Where do we 
draw the line of what is a stupid config?


Yes, definitely, 2 is nearly as stupid as 1. We need a reasonable 
minimal value for maxThreads; let's say 10 - 20.
Remy,

I agree we should help users come up with reasonable config values,
but I'm just afraid rejecting any maxThreads  10 or  20 will send the
wrong message, as if there was a bug in the way we dispatch incoming
requests that requires at least 10 threads.
I think we should make any maxThreads setting work, as my patch
attempts to do, and update the documentation to make users aware of
the limitations they will run into when picking a low maxThreads.
I think that would be the cleanest solution.
Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-31 Thread Remy Maucherat
Jan Luehe wrote:
I agree we should help users come up with reasonable config values,
but I'm just afraid rejecting any maxThreads  10 or  20 will send the
wrong message, as if there was a bug in the way we dispatch incoming
requests that requires at least 10 threads.
Nope, I disagree. If maxThreads  (say) 10, then set it to 10. Allowing 
broken settings is bad, as there will be people out there who will use 
them, and then will assume Tomcat is broken.

I think we should make any maxThreads setting work, as my patch
attempts to do, and update the documentation to make users aware of
the limitations they will run into when picking a low maxThreads.
I think that would be the cleanest solution.
The rationale is that there's no point adding complexity and checks into 
the very critical algorithm, simply to be able to support broken cases.

Rémy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-31 Thread Jan Luehe
Remy,

I agree we should help users come up with reasonable config values,
but I'm just afraid rejecting any maxThreads  10 or  20 will send the
wrong message, as if there was a bug in the way we dispatch incoming
requests that requires at least 10 threads.


Nope, I disagree. If maxThreads  (say) 10, then set it to 10. Allowing 
broken settings is bad, as there will be people out there who will use 
them, and then will assume Tomcat is broken.
I think changing people's config values behind their backs is not such
a good idea in general.
I think we should make any maxThreads setting work, as my patch
attempts to do, and update the documentation to make users aware of
the limitations they will run into when picking a low maxThreads.
I think that would be the cleanest solution.


The rationale is that there's no point adding complexity and checks into 
the very critical algorithm, simply to be able to support broken cases.
I think we have 2 options:
1. Support any maxThreads setting (including 1, 2, etc.).
2. Reject any maxThreads values that are smaller than some
   threshold and throw an error.
The problem with 2. is that picking a value for the threshold (10? 20?) 
seems
rather arbitrary. Therefore, I think we should do 1. The complexity it 
is adding is not significant and is well-documented.

Please tell me you agree. :)

Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-31 Thread Bill Barker

Jan Luehe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Remy,

  I agree we should help users come up with reasonable config values,
  but I'm just afraid rejecting any maxThreads  10 or  20 will send the
  wrong message, as if there was a bug in the way we dispatch incoming
  requests that requires at least 10 threads.
 
 
  Nope, I disagree. If maxThreads  (say) 10, then set it to 10. Allowing
  broken settings is bad, as there will be people out there who will use
  them, and then will assume Tomcat is broken.

 I think changing people's config values behind their backs is not such
 a good idea in general.

  I think we should make any maxThreads setting work, as my patch
  attempts to do, and update the documentation to make users aware of
  the limitations they will run into when picking a low maxThreads.
  I think that would be the cleanest solution.
 
 
  The rationale is that there's no point adding complexity and checks into
  the very critical algorithm, simply to be able to support broken cases.

 I think we have 2 options:
 1. Support any maxThreads setting (including 1, 2, etc.).
 2. Reject any maxThreads values that are smaller than some
 threshold and throw an error.

 The problem with 2. is that picking a value for the threshold (10? 20?)
 seems
 rather arbitrary. Therefore, I think we should do 1. The complexity it
 is adding is not significant and is well-documented.

 Please tell me you agree. :)


Well, I don't agree :).  There is no reason to accept a config value that
won't work, and it is cheaper and safer to handle in the config code then in
the critical runtime code (although, in this particular case, I admit that
the perfomance hit should be minimal).  Personally, I would be perfectly
happy with an enforced min setting of '2' (but Remy's suggestion is much
more practical, given that TC 5 does so much hand-holding already :).  As
long as the override is logged at WARN level, I don't see any problem with
enforcing a minimum.

I'm still -1 on this patch at heart, but I could be talked down to an
official -0 if enough of the rest of the community thinks that it is useful.

 Jan




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-30 Thread luehe
luehe   2003/10/30 13:01:39

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Fixed problem where if maxThreads is set to 1,
  ThreadPool.findControlRunnable() will log this error on the first
  request:
  
SEVERE: All threads (1) are currently busy, waiting. Increase
maxThreads (1) or check the servlet status
  
  and then block forever
  
  Revision  ChangesPath
  1.26  +24 -9 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- PoolTcpEndpoint.java  22 Oct 2003 13:46:28 -  1.25
  +++ PoolTcpEndpoint.java  30 Oct 2003 21:01:39 -  1.26
  @@ -544,7 +544,7 @@
}
   }
   
  -public void runIt(Object perThrData[]) {
  +public void runIt(Object[] perThrData) {
   
// Create per-thread cache
if (endpoint.isRunning()) {
  @@ -552,11 +552,16 @@
try {
   s = endpoint.acceptSocket();
} finally {
  - // Continue accepting on another thread...
  -if (endpoint.isRunning()) {
  +/*
  + * Continue accepting on another thread, unless maxThreads has
  + * been set to 1, in which case we have to finish processing
  + * this request before we can accept a new request.
  + */
  +if (endpoint.isRunning()  endpoint.getMaxThreads()  1) {
   endpoint.tp.runIt(this);
   }
   }
  +
if (null != s) {

try {
  @@ -574,19 +579,24 @@
   
   TcpConnection con = null;
   try {
  +Object[] localPerThrData = null;
if( usePool ) {
con=(TcpConnection)connectionCache.get();
  - if( con == null ) 
  + if( con == null ) {
con = new TcpConnection();
  + }
  +localPerThrData = perThrData;
} else {
   con = (TcpConnection) perThrData[0];
  -perThrData = (Object []) perThrData[1];
  +localPerThrData = (Object[]) perThrData[1];
}

con.setEndpoint(endpoint);
con.setSocket(s);
endpoint.setSocketOptions( s );
  - endpoint.getConnectionHandler().processConnection(con, perThrData);
  + endpoint.getConnectionHandler().processConnection(
  +con,
  +localPerThrData);
   } catch (SocketException se) {
   endpoint.log.error(
  Remote Host  + s.getInetAddress() +
  @@ -610,6 +620,11 @@
   }
   }
}
  +
  +if (endpoint.getMaxThreads() == 1) {
  +// Ready to accept new request
  +runIt(perThrData);
  +}
}
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-30 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:

luehe   2003/10/30 13:01:39

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Fixed problem where if maxThreads is set to 1,
  ThreadPool.findControlRunnable() will log this error on the first
  request:
  
SEVERE: All threads (1) are currently busy, waiting. Increase
maxThreads (1) or check the servlet status
  
  and then block forever
-1 for this patch.
1 is obviously a stupid configuration value, so the pool should refuse it.
Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-30 Thread Bill Barker

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 1:45 PM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java


 [EMAIL PROTECTED] wrote:

  luehe   2003/10/30 13:01:39
 
Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
Log:
Fixed problem where if maxThreads is set to 1,
ThreadPool.findControlRunnable() will log this error on the first
request:
 
  SEVERE: All threads (1) are currently busy, waiting. Increase
  maxThreads (1) or check the servlet status
 
and then block forever

 -1 for this patch.
 1 is obviously a stupid configuration value, so the pool should refuse it.


I agree with Remy:  The place to check this is ThreadPool.


 Remy



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-30 Thread Remy Maucherat
Bill Barker wrote:
[EMAIL PROTECTED] wrote:


luehe   2003/10/30 13:01:39

 Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
 Log:
 Fixed problem where if maxThreads is set to 1,
 ThreadPool.findControlRunnable() will log this error on the first
 request:
   SEVERE: All threads (1) are currently busy, waiting. Increase
   maxThreads (1) or check the servlet status
 and then block forever
-1 for this patch.
1 is obviously a stupid configuration value, so the pool should refuse it.
I agree with Remy:  The place to check this is ThreadPool.
I'd like to add that my -1 is not because the patch is bad (the revised 
algorithm seems ok), but because the 1 value doesn't make sense, so I 
don't think there's a point adding a special case for it.

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-30 Thread Jan Luehe
Remy Maucherat wrote:
Bill Barker wrote:

[EMAIL PROTECTED] wrote:


luehe   2003/10/30 13:01:39

 Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
 Log:
 Fixed problem where if maxThreads is set to 1,
 ThreadPool.findControlRunnable() will log this error on the first
 request:
   SEVERE: All threads (1) are currently busy, waiting. Increase
   maxThreads (1) or check the servlet status
 and then block forever


-1 for this patch.
1 is obviously a stupid configuration value, so the pool should 
refuse it.


I agree with Remy:  The place to check this is ThreadPool.


I'd like to add that my -1 is not because the patch is bad (the revised 
algorithm seems ok), but because the 1 value doesn't make sense, so I 
don't think there's a point adding a special case for it.
I guess I don't understand what makes 1 bad but 2 OK. Where do we 
draw the line of what is a stupid config?

Jan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-22 Thread glenn
glenn   2003/10/22 06:46:28

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  SocketExceptions can occur in a networked app.
  No need to log a stack trace, just log the remote host
  name/ip and the exception message. Then there is less
  cruft in the logs.
  
  Revision  ChangesPath
  1.25  +11 -3 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- PoolTcpEndpoint.java  12 Oct 2003 21:15:53 -  1.24
  +++ PoolTcpEndpoint.java  22 Oct 2003 13:46:28 -  1.25
  @@ -587,6 +587,14 @@
con.setSocket(s);
endpoint.setSocketOptions( s );
endpoint.getConnectionHandler().processConnection(con, perThrData);
  +} catch (SocketException se) {
  +endpoint.log.error(
  +   Remote Host  + s.getInetAddress() +
  +SocketException:  + se.getMessage());
  +// Try to close the socket
  +try {
  +s.close();
  +} catch (IOException e) {}
   } catch (Throwable t) {
   endpoint.log.error(Unexpected error, t);
   // Try to close the socket
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-22 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:

glenn   2003/10/22 06:46:28

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  SocketExceptions can occur in a networked app.
  No need to log a stack trace, just log the remote host
  name/ip and the exception message. Then there is less
  cruft in the logs.
I'd like more details :)
With HTTP/1.1, an exception can only occur while setting the socket 
options. I don't consider that very normal, though. What was your 
motivation for the change ? Did you see many logs coming out of here ?

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-22 Thread Glenn Nielsen
Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:

glenn   2003/10/22 06:46:28

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  SocketExceptions can occur in a networked app.
  No need to log a stack trace, just log the remote host
  name/ip and the exception message. Then there is less
  cruft in the logs.


I'd like more details :)
With HTTP/1.1, an exception can only occur while setting the socket 
options. I don't consider that very normal, though. What was your 
motivation for the change ? Did you see many logs coming out of here ?

Yes, that is where I saw the Exception:

[ERROR] PoolTcpEndpoint - -Unexpected error java.net.SocketException: Socket 
closedjava.net.SocketException: Socket close
d
at java.net.PlainSocketImpl.socketSetOption(Native Method)
at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:187)
at java.net.Socket.setTcpNoDelay(Socket.java:372)
at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.setTcpNoDelay([DashoPro-V1.2-120198])
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.setSocketOptions(PoolTcpEndpoint.java:495)
at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:587)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:479)

This was due to simple external system monitoring that would periodically
connect to the Coyote port to verify that the port was accepting connections,
then immediately disconnect.  So the stack trace would end up in the logs
each time the system monitoring did its checks.  In this case the Coyote
connector implemented SSL so there was no easy way to get the system
monitoring software to do an actual HTTPS negotiation with it.
Regards,

Glenn

--
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder|
MOREnet System Programming   |  * if iz ina coment.  |
Missouri Research and Education Network  |  */   |
--
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-12 Thread billbarker
billbarker2003/10/12 14:08:22

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Don't pretend that we are going to do something if the SSL handshake fails.
  
  Revision  ChangesPath
  1.23  +4 -3  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PoolTcpEndpoint.java  11 Oct 2003 14:37:00 -  1.22
  +++ PoolTcpEndpoint.java  12 Oct 2003 21:08:22 -  1.23
  @@ -569,6 +569,7 @@
   try {
   s.close();
   } catch (IOException e) {}
  + return;
   }
   
   TcpConnection con = null;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-12 Thread billbarker
billbarker2003/10/12 14:15:53

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Don't pretend that the tab-police won't come after you.
  
  Revision  ChangesPath
  1.24  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- PoolTcpEndpoint.java  12 Oct 2003 21:08:22 -  1.23
  +++ PoolTcpEndpoint.java  12 Oct 2003 21:15:53 -  1.24
  @@ -569,7 +569,7 @@
   try {
   s.close();
   } catch (IOException e) {}
  - return;
  +return;
   }
   
   TcpConnection con = null;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-04 Thread remm
remm2003/10/04 11:05:29

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - No bug fix !
  - Use the appropriate exception for killing the thread,
  - Improve ifs.
  - Replace while + break with a simpler (IMO) if.
  - Please let me know ASAP if there's a problem.
  
  Revision  ChangesPath
  1.21  +17 -18
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- PoolTcpEndpoint.java  3 Oct 2003 10:48:45 -   1.20
  +++ PoolTcpEndpoint.java  4 Oct 2003 18:05:29 -   1.21
  @@ -369,12 +369,16 @@
   } else {
   accepted = factory.acceptSocket(serverSocket);
   }
  -if(!running  (null != accepted)) {
  +if (null == accepted) {
  +log.warn(Null socket returned by accept);
  +} else {
  +if (!running) {
   accepted.close();  // rude, but unlikely!
   accepted = null;
  +} else if (factory != null) {
  +factory.initSocket( accepted );
  +}
   }
  -if( factory != null  accepted != null)
  -factory.initSocket( accepted );
   }
   catch(InterruptedIOException iioe) {
   // normal part -- should happen regularly so
  @@ -533,20 +537,17 @@
   public void runIt(Object perThrData[]) {
   
// Create per-thread cache
  - while(endpoint.isRunning()) {
  + if (endpoint.isRunning()) {
Socket s = null;
try {
   s = endpoint.acceptSocket();
  - } catch (ThreadDeath t) {
  - endpoint.log.error(Shutdown thread:  
  -   + Thread.currentThread().getName());
  -throw t;
  - } catch (Throwable t) {
  - endpoint.log.error(Exception in acceptSocket, t);
  - }
  - if(null != s) {
  + } finally {
// Continue accepting on another thread...
  - endpoint.tp.runIt(this);
  +if (endpoint.isRunning()) {
  +endpoint.tp.runIt(this);
  +}
  +}
  + if (null != s) {

try {
if(endpoint.getServerSocketFactory()!=null) {
  @@ -558,7 +559,6 @@
   try {
   s.close();
   } catch (IOException e) {}
  -break;
   }
   
   TcpConnection con = null;
  @@ -590,7 +590,6 @@
   }
   }
   }
  -break;
}
}
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-04 Thread Bill Barker

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 04, 2003 11:05 AM
Subject: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java


 remm2003/10/04 11:05:29

   Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
   Log:
   - No bug fix !
   - Use the appropriate exception for killing the thread,
   - Improve ifs.
   - Replace while + break with a simpler (IMO) if.
   - Please let me know ASAP if there's a problem.

+1 for the patch.  But you still need to recycle the connection if the
ServerSocket is re-started.


This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-04 Thread Bill Barker

- Original Message - 
From: Bill Barker [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Saturday, October 04, 2003 3:10 PM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java



 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, October 04, 2003 11:05 AM
 Subject: cvs commit:
 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
 PoolTcpEndpoint.java


  remm2003/10/04 11:05:29
 
Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
Log:
- No bug fix !
- Use the appropriate exception for killing the thread,
- Improve ifs.
- Replace while + break with a simpler (IMO) if.
- Please let me know ASAP if there's a problem.

 +1 for the patch.  But you still need to recycle the connection if the
 ServerSocket is re-started.


Never mind. I'm blind today.









 This message is intended only for the use of the person(s) listed above as
the intended recipient(s), and may contain information that is PRIVILEGED
and CONFIDENTIAL.  If you are not an intended recipient, you may not read,
copy, or distribute this message or any attachment. If you received this
communication in error, please notify us immediately by e-mail and then
delete all copies of this message and any attachments.

 In addition you should be aware that ordinary (unencrypted) e-mail sent
through the Internet is not secure. Do not send confidential or sensitive
information, such as social security numbers, account numbers, personal
identification numbers and passwords, to us via ordinary (unencrypted)
e-mail.








 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-10-03 Thread remm
remm2003/10/03 03:48:45

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Change the way to kill the thread after a server socket restart.
  
  Revision  ChangesPath
  1.20  +10 -8 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- PoolTcpEndpoint.java  23 Sep 2003 06:37:07 -  1.19
  +++ PoolTcpEndpoint.java  3 Oct 2003 10:48:45 -   1.20
  @@ -285,7 +285,7 @@
   throw new BindException(be.getMessage() + : + port);
   }
}
  - if( serverTimeout = 0 )
  +if( serverTimeout = 0 )
serverSocket.setSoTimeout( serverTimeout );
} catch( IOException ex ) {
//  log(couldn't start endpoint, ex, Logger.DEBUG);
  @@ -435,8 +435,7 @@
   log.error(msg, t);
   } finally {
   // Current thread is now invalid: kill it
  -throw new IllegalStateException
  -(Terminating thread);
  +throw new ThreadDeath();
   }
   }
   }
  @@ -537,10 +536,13 @@
while(endpoint.isRunning()) {
Socket s = null;
try {
  - s = endpoint.acceptSocket();
  +s = endpoint.acceptSocket();
  + } catch (ThreadDeath t) {
  + endpoint.log.error(Shutdown thread:  
  +   + Thread.currentThread().getName());
  +throw t;
} catch (Throwable t) {
endpoint.log.error(Exception in acceptSocket, t);
  -throw new IllegalStateException(Terminating thread);
}
if(null != s) {
// Continue accepting on another thread...
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-23 Thread remm
remm2003/09/22 23:37:08

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Fix logging of errors which occur in setSocketOptions.
  - This will also cause the connection to not be processed (which is a good
thing, obviously).
  
  Revision  ChangesPath
  1.19  +10 -14
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- PoolTcpEndpoint.java  18 Sep 2003 16:09:16 -  1.18
  +++ PoolTcpEndpoint.java  23 Sep 2003 06:37:07 -  1.19
  @@ -475,17 +475,13 @@
   }
   
   void setSocketOptions(Socket socket)
  -{
  - try {
  - if(linger = 0 ) 
  - socket.setSoLinger( true, linger);
  - if( tcpNoDelay )
  - socket.setTcpNoDelay(tcpNoDelay);
  - if( socketTimeout  0 )
  - socket.setSoTimeout( socketTimeout );
  - } catch(  SocketException se ) {
  - se.printStackTrace();
  - }
  +throws SocketException {
  +if(linger = 0 ) 
  +socket.setSoLinger( true, linger);
  +if( tcpNoDelay )
  +socket.setTcpNoDelay(tcpNoDelay);
  +if( socketTimeout  0 )
  +socket.setSoTimeout( socketTimeout );
   }
   
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-23 Thread remm
remm2003/09/23 00:09:55

  Modified:util/java/org/apache/tomcat/util/net Tag: coyote_10
PoolTcpEndpoint.java
  Log:
  - Port patch.
  - Don't catch SocketException when setting the socket options, so that when
it happens the socket is discarded right away. The exception will also be
properly logged.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.12.2.3  +10 -14
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.12.2.2
  retrieving revision 1.12.2.3
  diff -u -r1.12.2.2 -r1.12.2.3
  --- PoolTcpEndpoint.java  13 Sep 2003 04:01:24 -  1.12.2.2
  +++ PoolTcpEndpoint.java  23 Sep 2003 07:09:54 -  1.12.2.3
  @@ -460,17 +460,13 @@
   }
   
   void setSocketOptions(Socket socket)
  -{
  - try {
  - if(linger = 0 ) 
  - socket.setSoLinger( true, linger);
  - if( tcpNoDelay )
  - socket.setTcpNoDelay(tcpNoDelay);
  - if( socketTimeout  0 )
  - socket.setSoTimeout( socketTimeout );
  - } catch(  SocketException se ) {
  - se.printStackTrace();
  - }
  +throws SocketException {
  +if(linger = 0 ) 
  +socket.setSoLinger( true, linger);
  +if( tcpNoDelay )
  +socket.setTcpNoDelay(tcpNoDelay);
  +if( socketTimeout  0 )
  +socket.setSoTimeout( socketTimeout );
   }
   
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-18 Thread hgomez
hgomez  2003/09/18 09:09:16

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Clean Import, the first one
  
  Revision  ChangesPath
  1.18  +15 -10
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- PoolTcpEndpoint.java  13 Sep 2003 03:59:57 -  1.17
  +++ PoolTcpEndpoint.java  18 Sep 2003 16:09:16 -  1.18
  @@ -64,15 +64,20 @@
   
   package org.apache.tomcat.util.net;
   
  -import org.apache.tomcat.util.res.*;
  -import org.apache.tomcat.util.collections.SimplePool;
  -import org.apache.tomcat.util.threads.*;
  -//import org.apache.tomcat.util.log.*;
  +import java.io.IOException;
  +import java.io.InterruptedIOException;
  +import java.net.BindException;
  +import java.net.InetAddress;
  +import java.net.ServerSocket;
  +import java.net.Socket;
  +import java.net.SocketException;
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
  -import java.io.*;
  -import java.net.*;
  +import org.apache.tomcat.util.collections.SimplePool;
  +import org.apache.tomcat.util.res.StringManager;
  +import org.apache.tomcat.util.threads.ThreadPool;
  +import org.apache.tomcat.util.threads.ThreadPoolRunnable;
   
   /* Similar with MPM module in Apache2.0. Handles all the details related with
  tcp server functionality - thread management, accept policy, etc.
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread Stefan Bodewig
On 12 Sep 2003, [EMAIL PROTECTED] wrote:

  +++ PoolTcpEndpoint.java 12 Sep 2003 03:51:36 -  1.16
  @@ -389,12 +389,12 @@
   if (accepted != null) {
   try {
   accepted.close();
  -accepted = null;
   } catch(Exception ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
   log.warn(msg, ex);
   }
  +accepted = null;
   }
   
   if( ! running ) return null;

wouldn't it be better to put the accepted = null into a finally
block so you clean up even in the (unlikely but possible) case where
close throws an Error (or Throwable) instead of an Exception?

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread Bill Barker

- Original Message - 
From: Stefan Bodewig [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 12, 2003 12:58 AM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net
PoolTcpEndpoint.java


 On 12 Sep 2003, [EMAIL PROTECTED] wrote:

   +++ PoolTcpEndpoint.java 12 Sep 2003 03:51:36 - 1.16
   @@ -389,12 +389,12 @@
if (accepted != null) {
try {
accepted.close();
   -accepted = null;
} catch(Exception ex) {
msg = sm.getString(endpoint.err.nonfatal,
   accepted, ex);
log.warn(msg, ex);
}
   +accepted = null;
}
 
if( ! running ) return null;

 wouldn't it be better to put the accepted = null into a finally
 block so you clean up even in the (unlikely but possible) case where
 close throws an Error (or Throwable) instead of an Exception?


Wouldn't do anything.  The 'accepted' variable is local to the stack-frame,
so it goes away if I throw clear of the method.  In this case you just get a
DoS condition where no threads are listening on the ServerSocket.  I briefly
thought about changing the catch to 'Throwable', but is it really possible
for Socket.close to throw anything other than an Exception?


 Stefan

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread Remy Maucherat
Bill Barker wrote:
On 12 Sep 2003, [EMAIL PROTECTED] wrote:


+++ PoolTcpEndpoint.java 12 Sep 2003 03:51:36 - 1.16
@@ -389,12 +389,12 @@
 if (accepted != null) {
 try {
 accepted.close();
-accepted = null;
 } catch(Exception ex) {
 msg = sm.getString(endpoint.err.nonfatal,
accepted, ex);
 log.warn(msg, ex);
 }
+accepted = null;
 }
 if( ! running ) return null;
wouldn't it be better to put the accepted = null into a finally
block so you clean up even in the (unlikely but possible) case where
close throws an Error (or Throwable) instead of an Exception?
Wouldn't do anything.  The 'accepted' variable is local to the stack-frame,
so it goes away if I throw clear of the method.  In this case you just get a
DoS condition where no threads are listening on the ServerSocket.  I briefly
thought about changing the catch to 'Throwable', but is it really possible
for Socket.close to throw anything other than an Exception?
I don't know. From traces I saw, there are conditions where there could 
be no thread listening on the socket (at that point, the connector was 
dead, of course), while everything else in the TP was looking ok 
(including no deadlock). There didn't seem to be anything in the logs 
related to an error during accept.

I'd catch throwable just to be safe, personally :)

Remy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread Stefan Bodewig
On Fri, 12 Sep 2003, Bill Barker [EMAIL PROTECTED] wrote:
 From: Stefan Bodewig [EMAIL PROTECTED]

 wouldn't it be better to put the accepted = null into a finally
 block
 
 Wouldn't do anything.  The 'accepted' variable is local to the
 stack-frame, so it goes away if I throw clear of the method.

OK, thanks.  I just looked at the commit mail as I suspect that one of
our customer production systems gets bitten by the bug - I didn't look
at the complete code.  Makes sense, then.

 I briefly thought about changing the catch to 'Throwable', but is it
 really possible for Socket.close to throw anything other than an
 Exception?

Everything is possible ;-)

I have no idea what the Socket implementation does if shutdown(2) sets
errno to ENOTCONN for example (I'd guess, throw a plain
SocketException).

I don't think that non-Exceptions are too likely to happen and if they
do it probably happens in a situation where you can't recover anyway
(OutOfMemory, StackOverflow, ThreadDeath ...).  Catching Throwable may
be the savest thing to do.

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread billbarker
billbarker2003/09/12 20:59:57

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Catch all throwables when trying to close the socket.
  
  Revision  ChangesPath
  1.17  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PoolTcpEndpoint.java  12 Sep 2003 03:51:36 -  1.16
  +++ PoolTcpEndpoint.java  13 Sep 2003 03:59:57 -  1.17
  @@ -389,7 +389,7 @@
   if (accepted != null) {
   try {
   accepted.close();
  -} catch(Exception ex) {
  +} catch(Throwable ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
   log.warn(msg, ex);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-12 Thread billbarker
billbarker2003/09/12 21:01:24

  Modified:util/java/org/apache/tomcat/util/net Tag: coyote_10
PoolTcpEndpoint.java
  Log:
  Port patch.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.12.2.2  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.12.2.1
  retrieving revision 1.12.2.2
  diff -u -r1.12.2.1 -r1.12.2.2
  --- PoolTcpEndpoint.java  12 Sep 2003 03:53:03 -  1.12.2.1
  +++ PoolTcpEndpoint.java  13 Sep 2003 04:01:24 -  1.12.2.2
  @@ -380,7 +380,7 @@
   if (accepted != null) {
   try {
   accepted.close();
  -} catch(Exception ex) {
  +} catch(Throwable ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
   log.warn(msg, ex);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-11 Thread billbarker
billbarker2003/09/11 20:51:36

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Make certain that we don't return a bad Socket.
  
  Fix for Bug #21763
  Reported By: Rex Young [EMAIL PROTECTED]
  Reported By: wendy69 [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.16  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- PoolTcpEndpoint.java  26 Jul 2003 15:04:35 -  1.15
  +++ PoolTcpEndpoint.java  12 Sep 2003 03:51:36 -  1.16
  @@ -389,12 +389,12 @@
   if (accepted != null) {
   try {
   accepted.close();
  -accepted = null;
   } catch(Exception ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
   log.warn(msg, ex);
   }
  +accepted = null;
   }
   
   if( ! running ) return null;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-09-11 Thread billbarker
billbarker2003/09/11 20:53:03

  Modified:util/java/org/apache/tomcat/util/net Tag: coyote_10
PoolTcpEndpoint.java
  Log:
  Make certain that we don't return a bad Socket.
  
  Fix for Bug #21763
  Reported By: Rex Young [EMAIL PROTECTED]
  Reported By: wendy69 [EMAIL PROTECTED]
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.12.2.1  +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- PoolTcpEndpoint.java  10 Jan 2003 20:22:37 -  1.12
  +++ PoolTcpEndpoint.java  12 Sep 2003 03:53:03 -  1.12.2.1
  @@ -380,12 +380,12 @@
   if (accepted != null) {
   try {
   accepted.close();
  -accepted = null;
   } catch(Exception ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
   log.warn(msg, ex);
   }
  +accepted = null;
   }
   
   reinitializing = true;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-07-26 Thread remm
remm2003/07/26 08:04:35

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Close socket inside a finally block.
  
  Revision  ChangesPath
  1.15  +12 -5 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- PoolTcpEndpoint.java  27 Mar 2003 04:08:20 -  1.14
  +++ PoolTcpEndpoint.java  26 Jul 2003 15:04:35 -  1.15
  @@ -319,9 +319,9 @@
   }
   
   protected void closeServerSocket() {
  +Socket s = null;
   try {
   // Need to create a connection to unlock the accept();
  -Socket s;
   if (inet == null) {
   s=new Socket(127.0.0.1, port );
   }else{
  @@ -330,10 +330,17 @@
   // connection quicker
   s.setSoLinger(true, 0);
   }
  -s.close();
   } catch(Exception e) {
   log.error(Caught exception trying to unlock accept on  + port
   +   + e.toString());
  +} finally {
  +if (s != null) {
  +try {
  +s.close();
  +} catch (Exception e) {
  +// Ignore
  +}
  +}
   }
   try {
   if( serverSocket!=null)
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-03-26 Thread costin
costin  2003/03/26 20:08:20

  Modified:util/java tomcat-util.manifest
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Fix bug that prevented clean shutdown.
  
  Remove ClassPath from manifest, added spec version and the other entries
  so it may be useable with a loader that uses the manifest.
  
  Revision  ChangesPath
  1.3   +7 -1  jakarta-tomcat-connectors/util/java/tomcat-util.manifest
  
  Index: tomcat-util.manifest
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/tomcat-util.manifest,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tomcat-util.manifest  5 Jun 2002 21:13:37 -   1.2
  +++ tomcat-util.manifest  27 Mar 2003 04:08:19 -  1.3
  @@ -1 +1,7 @@
  -Class-Path: commons-logging.jar log4j.jar log4j-core.jar mx4j.jar
  +Manifest-version: 1.0
  +Extension-Name: org.apache.tomcat.util
  +Specification-Vendor: Apache Software Foundation
  +Specification-Version: 3.0
  +Implementation-Vendor-Id: org.apache
  +Implementation-Vendor: Apache Software Foundation
  +Implementation-Version: 5.1
  
  
  
  1.14  +4 -3  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PoolTcpEndpoint.java  4 Mar 2003 18:20:36 -   1.13
  +++ PoolTcpEndpoint.java  27 Mar 2003 04:08:20 -  1.14
  @@ -390,6 +390,7 @@
   }
   }
   
  +if( ! running ) return null;
   reinitializing = true;
   // Restart endpoint when getting an IOException during accept
   synchronized (threadSync) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-03-04 Thread costin
costin  2003/03/04 10:20:36

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Reduce verbosity and add more info to the message
  
  Revision  ChangesPath
  1.13  +7 -5  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PoolTcpEndpoint.java  10 Jan 2003 20:22:37 -  1.12
  +++ PoolTcpEndpoint.java  4 Mar 2003 18:20:36 -   1.13
  @@ -332,10 +332,12 @@
   }
   s.close();
   } catch(Exception e) {
  -log.error(Caught exception trying to unlock accept., e);
  +log.error(Caught exception trying to unlock accept on  + port
  ++   + e.toString());
   }
   try {
  -serverSocket.close();
  +if( serverSocket!=null)
  +serverSocket.close();
   } catch(Exception e) {
   log.error(Caught exception trying to close socket., e);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2003-01-01 Thread remm
remm2003/01/01 05:55:22

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Don't check for null on the connection (it should never be null, and should be
caught by the throwable and logged if it happens).
  - Fix a problem when using SSL: when an exception occurs during the handshake,
if continue is used, the thread will immediately start to listen on the socket,
for no good reason. I found that patch on tomcat-user, alledgedly submitted
by Xiaojian Wang (I couldn't find the original message), and reposted
by Carl Zetterberg.
  
  Revision  ChangesPath
  1.11  +5 -7  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PoolTcpEndpoint.java  19 Dec 2002 15:55:45 -  1.10
  +++ PoolTcpEndpoint.java  1 Jan 2003 13:55:22 -   1.11
  @@ -519,12 +519,12 @@
   endpoint.getServerSocketFactory().handshake(s);
}
   } catch (Throwable t) {
  -endpoint.log.info(Handshake failed, t);
  +endpoint.log.debug(Handshake failed, t);
   // Try to close the socket
   try {
   s.close();
   } catch (IOException e) {}
  -continue;
  +break;
   }
   
   TcpConnection con = null;
  @@ -536,8 +536,6 @@
} else {
   con = (TcpConnection) perThrData[0];
   perThrData = (Object []) perThrData[1];
  -if ( con == null )
  -continue;
}

con.setEndpoint(endpoint);
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-12-18 Thread costin
costin  2002/12/18 21:31:47

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Use commons-loggign directly.
  
  This way any logger can be used ( and the same logger config ).
  
  Revision  ChangesPath
  1.9   +42 -25
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PoolTcpEndpoint.java  28 Nov 2002 15:16:31 -  1.8
  +++ PoolTcpEndpoint.java  19 Dec 2002 05:31:46 -  1.9
  @@ -67,10 +67,12 @@
   import org.apache.tomcat.util.res.*;
   import org.apache.tomcat.util.collections.SimplePool;
   import org.apache.tomcat.util.threads.*;
  -import org.apache.tomcat.util.log.*;
  +//import org.apache.tomcat.util.log.*;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   import java.io.*;
   import java.net.*;
  -import java.util.*;
   
   /* Similar with MPM module in Apache2.0. Handles all the details related with
  tcp server functionality - thread management, accept policy, etc.
  @@ -123,7 +125,10 @@
   static final int debug=0;
   
   ThreadPool tp;
  -protected Log _log=Log.getLog(tc/PoolTcpEndpoint, PoolTcpEndpoint);
  +// XXX Do we need it for backward compat ?
  +//protected Log _log=Log.getLog(tc/PoolTcpEndpoint, PoolTcpEndpoint);
  +
  +static Log log=LogFactory.getLog(PoolTcpEndpoint.class );
   
   protected boolean tcpNoDelay=false;
   protected int linger=100;
  @@ -133,7 +138,11 @@
//  super(tc_log);// initialize default logger
tp = new ThreadPool();
   }
  -
  +
  +public PoolTcpEndpoint( ThreadPool tp ) {
  +this.tp=tp;
  +}
  +
   //  Configuration 
   
   public void setPoolOn(boolean isPool) {
  @@ -294,7 +303,7 @@
listener = new TcpWorkerThread(this);
   tp.runIt(listener);
   } else {
  - log(XXX Error - need pool !, null, Log.ERROR);
  + log.error(XXX Error - need pool !);
}
   }
   
  @@ -315,12 +324,12 @@
}
s.close();
} catch(Exception e) {
  -log(Caught exception trying to unlock accept., e);
  +log.error(Caught exception trying to unlock accept., e);
}
try {
serverSocket.close();
} catch(Exception e) {
  -log(Caught exception trying to close socket., e);
  +log.error(Caught exception trying to close socket., e);
}
serverSocket = null;
}
  @@ -362,7 +371,7 @@
   
String msg = sm.getString(endpoint.err.nonfatal,
  serverSocket, e);
  - log(msg, e, Log.ERROR);
  + log.error(msg, e);
   
   if (accepted != null) {
   try {
  @@ -371,7 +380,7 @@
   } catch(Exception ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  accepted, ex);
  -log(msg, ex, Log.INFORMATION);
  +log.warn(msg, ex);
   }
   }
   // Restart endpoint when getting an IOException during accept
  @@ -381,7 +390,7 @@
   } catch(Exception ex) {
   msg = sm.getString(endpoint.err.nonfatal,
  serverSocket, ex);
  -log(msg, ex, Log.INFORMATION);
  +log.warn(msg, ex);
   }
   serverSocket = null;
   try {
  @@ -396,7 +405,7 @@
   } catch (Throwable t) {
   msg = sm.getString(endpoint.err.fatal, 
  serverSocket, t);
  -log(msg, t, Log.ERROR);
  +log.error(msg, t);
   stopEndpoint();
   }
   }
  @@ -408,23 +417,31 @@
return accepted;
   }
   
  -public void log(String msg) 
  +/** @deprecated
  + */
  +public void log(String msg)
   {
  - _log.log(msg, null, Log.INFORMATION);
  + log.info(msg);
   }
  -
  -public void log(String msg, Throwable t) 
  +
  +/** @deprecated
  + */
  +public void log(String msg, Throwable t)
   {
  - _log.log(msg, t, Log.ERROR);
  + log.error( msg, t );
   }
   
  -public void log(String msg, int level) 
  +/** 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-11-28 Thread remm
remm2002/11/28 03:24:29

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Experiment with not using the pool.
  
  Revision  ChangesPath
  1.7   +4 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PoolTcpEndpoint.java  22 Oct 2002 09:42:48 -  1.6
  +++ PoolTcpEndpoint.java  28 Nov 2002 11:24:28 -  1.7
  @@ -464,7 +464,7 @@
   */
   PoolTcpEndpoint endpoint;
   SimplePool connectionCache;
  -static final boolean usePool=true;
  +static final boolean usePool=false;
   
   public TcpWorkerThread(PoolTcpEndpoint endpoint) {
this.endpoint = endpoint;
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-11-28 Thread remm
remm2002/11/28 07:16:32

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Small reorganization of the code so that the next accept is called sooner
when not using the connection cache.
  
  Revision  ChangesPath
  1.8   +9 -12 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PoolTcpEndpoint.java  28 Nov 2002 11:24:28 -  1.7
  +++ PoolTcpEndpoint.java  28 Nov 2002 15:16:31 -  1.8
  @@ -489,13 +489,7 @@
   }
   
   public void runIt(Object perThrData[]) {
  - TcpConnection con=null;
  - if( ! usePool ) {
  - // extract the original.
  - con=(TcpConnection) perThrData[0];
  - perThrData = (Object []) perThrData[1];
  - }
  - 
  +
// Create per-thread cache
while(endpoint.isRunning()) {
Socket s = null;
  @@ -521,14 +515,17 @@
   continue;
   }
   
  +TcpConnection con = null;
   try {
if( usePool ) {
con=(TcpConnection)connectionCache.get();
if( con == null ) 
con = new TcpConnection();
} else {
  - if( con==null )
  - continue;
  +con = (TcpConnection) perThrData[0];
  +perThrData = (Object []) perThrData[1];
  +if ( con == null )
  +continue;
}

con.setEndpoint(endpoint);
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-10-19 Thread remm
remm2002/10/19 02:30:37

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Attempts to address bug 13736.
  - Add code for recovery if the serverSocket dies. Needs testing (I tested with
an exception thrown according to a random value after the socket has been
accepted, and it *seems* to work).
  - There was similar code in Tomcat 4.0, and it is not needed unless there's
a huge amount of accepts being made. It is also likely caused by JVM's
network code deficiencies. If running on Unix without root on 80, recovery is
not possible.
  
  Revision  ChangesPath
  1.5   +56 -36
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PoolTcpEndpoint.java  16 May 2002 18:57:39 -  1.4
  +++ PoolTcpEndpoint.java  19 Oct 2002 09:30:37 -  1.5
   -102,6 +102,8 
   private static final int BACKLOG = 100;
   private static final int TIMEOUT = 1000;
   
  +private final Object threadSync = new Object();
  +
   private boolean isPool = true;
   
   private int backlog = BACKLOG;
   -312,11 +314,14 
   s.setSoLinger(true, 0);
}
s.close();
  - //  System.out.println(Closing socket  + port );
  - serverSocket.close(); // XXX?
} catch(Exception e) {
   log(Caught exception trying to unlock accept., e);
}
  + try {
  + serverSocket.close();
  + } catch(Exception e) {
  +log(Caught exception trying to close socket., e);
  + }
serverSocket = null;
}
   }
   -325,6 +330,7 
   
   Socket acceptSocket() {
   Socket accepted = null;
  +
try {
if (running) {
if(null!= serverSocket) {
   -343,48 +349,62 
if( factory != null  accepted != null)
factory.initSocket( accepted );
}
  - }   
  + }
}
catch(InterruptedIOException iioe) {
// normal part -- should happen regularly so
// that the endpoint can release if the server
// is shutdown.
}
  - catch (SocketException e) {
  + catch (IOException e) {
  +
  + if (running) {
   
  - // TCP stacks can throw SocketExceptions when the client
  - // disconnects.  We don't want this to shut down the
  - // endpoint, so ignore it. Is there a more robust
  - // solution?  Should we compare the message string to
  - // Connection reset by peer?
  -
  - // socket exceptions just after closing endpoint (when
  - // running=false) aren't even logged
  - if (running != false) {
String msg = sm.getString(endpoint.err.nonfatal,
  serverSocket, e);
  - log(msg, e, Log.INFORMATION);
  - }
  + log(msg, e, Log.ERROR);
   
  - } 
  - 
  - // Future developers: if you identify any other nonfatal
  - // exceptions, catch them here and log as above
  +if (accepted != null) {
  +try {
  +accepted.close();
  +accepted = null;
  +} catch(Exception ex) {
  +msg = sm.getString(endpoint.err.nonfatal,
  +   accepted, ex);
  +log(msg, ex, Log.INFORMATION);
  +}
  +}
  +// Restart endpoint when getting an IOException during accept
  +synchronized (threadSync) {
  +try {
  +serverSocket.close();
  +} catch(Exception ex) {
  +msg = sm.getString(endpoint.err.nonfatal,
  +   serverSocket, ex);
  +log(msg, ex, Log.INFORMATION);
  +}
  +serverSocket = null;
  +try {
  +if (inet == null) {
  +serverSocket = factory.createSocket(port, backlog);
  +} else {
  +serverSocket = 
  +factory.createSocket(port, backlog, inet);
  +}
  +if (serverTimeout = 0)
  +serverSocket.setSoTimeout(serverTimeout);
  +} catch (Throwable t) {
  + 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-05-16 Thread remm

remm02/05/16 11:57:39

  Modified:coyote/src/java/org/apache/coyote ProtocolHandler.java
   coyote/src/java/org/apache/coyote/tomcat4
CoyoteConnector.java LocalStrings.properties
   http11/src/java/org/apache/coyote/http11 Http11Protocol.java
   jk/java/org/apache/jk/server JkCoyoteHandler.java
   util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Add support for a two phase protocol init (init where the port binding occurs,
and start where the connector is actually started). This allows to run TC on port
80 without root on Unix, as it was possible with the old HTTP/1.1 connector.
  - The modified endpoint should be 100% compatible with all existing code using
it (the start method calls the init method if it hasn't been called before).
  
  Revision  ChangesPath
  1.3   +8 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ProtocolHandler.java
  
  Index: ProtocolHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ProtocolHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProtocolHandler.java  5 Apr 2002 15:52:45 -   1.2
  +++ ProtocolHandler.java  16 May 2002 18:57:39 -  1.3
  @@ -93,9 +93,16 @@
   
   
   /**
  - * Start the protocol.
  + * Init the protocol.
*/
   public void init()
  +throws Exception;
  +
  +
  +/**
  + * Start the protocol.
  + */
  +public void start()
   throws Exception;
   
   
  
  
  
  1.14  +14 -6 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CoyoteConnector.java  6 May 2002 21:43:29 -   1.13
  +++ CoyoteConnector.java  16 May 2002 18:57:39 -  1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
 1.13 2002/05/06 21:43:29 remm Exp $
  - * $Revision: 1.13 $
  - * $Date: 2002/05/06 21:43:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
 1.14 2002/05/16 18:57:39 remm Exp $
  + * $Revision: 1.14 $
  + * $Date: 2002/05/16 18:57:39 $
*
* 
*
  @@ -112,7 +112,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.13 $ $Date: 2002/05/06 21:43:29 $
  + * @version $Revision: 1.14 $ $Date: 2002/05/16 18:57:39 $
*/
   
   
  @@ -995,6 +995,14 @@
   + false);
   }
   
  +try {
  +protocolHandler.init();
  +} catch (Exception e) {
  +throw new LifecycleException
  +(sm.getString
  + (coyoteConnector.protocolHandlerInitializationFailed, e));
  +}
  +
   }
   
   
  @@ -1013,11 +1021,11 @@
   started = true;
   
   try {
  -protocolHandler.init();
  +protocolHandler.start();
   } catch (Exception e) {
   throw new LifecycleException
   (sm.getString
  - (coyoteConnector.protocolHandlerInitializationFailed, e));
  + (coyoteConnector.protocolHandlerStartFailed, e));
   }
   
   }
  
  
  
  1.4   +1 -0  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/LocalStrings.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalStrings.properties   18 Apr 2002 18:12:46 -  1.3
  +++ LocalStrings.properties   16 May 2002 18:57:39 -  1.4
  @@ -9,6 +9,7 @@
   coyoteConnector.protocolHandlerDestroyFailed=Protocol handler destroy failed: {0}
   coyoteConnector.protocolHandlerInitializationFailed=Protocol handler initialization 
failed: {0}
   coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation 
failed: {0}
  +coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed: {0}
   
   #
   # CoyoteAdapter
  
  
  
  1.12  +13 -3 
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2002-05-15 Thread keith

keith   02/05/15 11:53:46

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Wrap acceptSocket in a try to be more robust
  
  Revision  ChangesPath
  1.3   +9 -4  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PoolTcpEndpoint.java  6 Apr 2002 16:34:02 -   1.2
  +++ PoolTcpEndpoint.java  15 May 2002 18:53:46 -  1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
 1.2 2002/04/06 16:34:02 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/06 16:34:02 $
  + * $Header: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
 1.3 2002/05/15 18:53:46 keith Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/05/15 18:53:46 $
*
* 
*
  @@ -470,7 +470,12 @@

// Create per-thread cache
while(endpoint.isRunning()) {
  - Socket s = endpoint.acceptSocket();
  + Socket s = null;
  + try {
  + s = endpoint.acceptSocket();
  + } catch (Throwable t) {
  + endpoint.log(Exception in acceptSocket, t);
  + }   
if(null != s) {
// Continue accepting on another thread...
endpoint.tp.runIt(this);
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]