tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util ByteBuffer.java ThreadPool.java
Date Tue, 30 May 2000 15:40:15 GMT
costin      00/05/30 08:40:15

  Modified:    src/share/org/apache/tomcat/adapter HttpAdapter.java
               src/share/org/apache/tomcat/facade
                        HttpServletRequestFacade.java
                        ServletContextFacade.java SimpleFacadeManager.java
               src/share/org/apache/tomcat/servlets InvokerServlet.java
               src/share/org/apache/tomcat/util ByteBuffer.java
                        ThreadPool.java
  Log:
  Small fixes.
  
  We need to fix error handling, after that we can remove the hack from Facade.
  
  Revision  Changes    Path
  1.2       +4 -2      jakarta-tomcat/src/share/org/apache/tomcat/adapter/HttpAdapter.java
  
  Index: HttpAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/adapter/HttpAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpAdapter.java	2000/05/30 06:16:45	1.1
  +++ HttpAdapter.java	2000/05/30 15:40:06	1.2
  @@ -205,7 +205,9 @@
   	    }
   	    sout.write( ev.getByteBuffer(), ev.getOffset(), ev.getLength() );
   	} catch( IOException ex ) {
  -	    ex.printStackTrace();
  +	    if( ! "Broken pipe".equals(ex.getMessage())) {
  +		ex.printStackTrace();
  +	    }
   	}
       }
   
  @@ -312,7 +314,7 @@
   	count = BuffTool.readLine(in, buf, 0, buf.length);
   	
   	if (count < 0  ) {
  -	    System.out.println("No request");
  +	    //	    System.out.println("No request");
   	    // 	    System.out.println("Request too long ");
   	    response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
   	    return;
  
  
  
  1.5       +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletRequestFacade.java
  
  Index: HttpServletRequestFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletRequestFacade.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpServletRequestFacade.java	2000/05/30 06:16:47	1.4
  +++ HttpServletRequestFacade.java	2000/05/30 15:40:09	1.5
  @@ -61,6 +61,7 @@
   package org.apache.tomcat.facade;
   
   import org.apache.tomcat.util.*;
  +import org.apache.tomcat.util.RequestUtil;
   import org.apache.tomcat.core.*;
   import org.apache.tomcat.facade.*;
   import java.io.*;
  
  
  
  1.3       +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/facade/ServletContextFacade.java
  
  Index: ServletContextFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/ServletContextFacade.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServletContextFacade.java	2000/05/23 20:58:22	1.2
  +++ ServletContextFacade.java	2000/05/30 15:40:09	1.3
  @@ -61,6 +61,7 @@
   package org.apache.tomcat.facade;
   
   import org.apache.tomcat.core.*;
  +import org.apache.tomcat.core.Constants;
   import org.apache.tomcat.util.*;
   import java.io.*;
   import java.net.*;
  
  
  
  1.2       +4 -2      jakarta-tomcat/src/share/org/apache/tomcat/facade/SimpleFacadeManager.java
  
  Index: SimpleFacadeManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/SimpleFacadeManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleFacadeManager.java	2000/05/23 16:56:52	1.1
  +++ SimpleFacadeManager.java	2000/05/30 15:40:10	1.2
  @@ -104,12 +104,14 @@
       }
   
       public HttpServletRequest createHttpServletRequestFacade(Request req) {
  -	if( req.getContext() != ctx ) return null; // throw
  +	Context reqCtx=req.getContext();
  +	if( reqCtx != ctx && reqCtx != null ) return null; // throw
   	return new HttpServletRequestFacade(req);
       }
   
       public HttpServletResponse createHttpServletResponseFacade(Response res) {
  -	if( res.getRequest().getContext() != ctx ) return null; // throw
  +	Context resCtx=res.getRequest().getContext();
  +	if( resCtx != ctx && resCtx != null ) return null; // throw
   	return new HttpServletResponseFacade(res);
       }
   
  
  
  
  1.12      +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/servlets/InvokerServlet.java
  
  Index: InvokerServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/servlets/InvokerServlet.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- InvokerServlet.java	2000/05/23 16:57:03	1.11
  +++ InvokerServlet.java	2000/05/30 15:40:12	1.12
  @@ -155,6 +155,7 @@
           // try the easy one -- lookup by name
   	if( context == null ) {
   	    System.out.println("Servlet called before init. Need to keep it disabled, sync at
startup");
  +	    return;
   	}
           ServletWrapper wrapper = context.getServletByName(servletName);
   
  
  
  
  1.3       +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/util/ByteBuffer.java
  
  Index: ByteBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/ByteBuffer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ByteBuffer.java	2000/05/30 06:16:55	1.2
  +++ ByteBuffer.java	2000/05/30 15:40:13	1.3
  @@ -122,6 +122,7 @@
       public void recycle() {
   	bytesWritten=0;
   	count=0;
  +	pos=0;
       }
   
       public Object getParent() {
  
  
  
  1.8       +21 -3     jakarta-tomcat/src/share/org/apache/tomcat/util/ThreadPool.java
  
  Index: ThreadPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/ThreadPool.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ThreadPool.java	2000/05/30 14:08:23	1.7
  +++ ThreadPool.java	2000/05/30 15:40:14	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/ThreadPool.java,v
1.7 2000/05/30 14:08:23 costin Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/05/30 14:08:23 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/ThreadPool.java,v
1.8 2000/05/30 15:40:14 costin Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/05/30 15:40:14 $
    *
    * ====================================================================
    *
  @@ -124,6 +124,8 @@
        */
       protected boolean stopThePool;
   
  +    static int debug=0;
  +    
       public ThreadPool() {
           maxThreads      = MAX_THREADS;
           maxSpareThreads = MAX_SPARE_THREADS;
  @@ -334,6 +336,10 @@
           currentThreadCount = toOpen;
       }
   
  +    void log( String s ) {
  +	System.out.println("ThreadPool: " + s );
  +    }
  +    
       /** Periodically execute an action - cleanup in this case
        */
       class MonitorRunnable implements Runnable {
  @@ -428,10 +434,19 @@
                               this.wait();
                           }
                       }
  +		    if( toRun == null ) {
  +			if( p.debug>0) p.log( "No toRun ???");
  +		    }
  +		    
  +		    if( shouldTerminate ) {
  +			if( p.debug>0) p.log( "Terminate");
  +			break;
  +		    }
   
                       // Check if should execute a runnable.
                       try {
   			if( noThData ) {
  +			    if( p.debug>0) p.log( "Getting new thread data");
   			    thData=toRun.getInitData();
   			    noThData=false;
   			}
  @@ -460,6 +475,9 @@
           }
   
           public synchronized void runIt(ThreadPoolRunnable toRun) {
  +	    if( toRun == null ) {
  +		throw new NullPointerException("No Runnable");
  +	    }
               this.toRun = toRun;
               shouldRun = true;
               this.notify();
  
  
  

Mime
View raw message