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/service/http HttpConnectionHandler.java HttpRequestAdapter.java
Date Tue, 18 Apr 2000 19:36:06 GMT
costin      00/04/18 12:36:05

  Modified:    src/share/org/apache/tomcat/service/http
                        HttpConnectionHandler.java HttpRequestAdapter.java
  Removed:     src/share/org/apache/tomcat/service/connector
                        DoorConnectionHandler.java
  Log:
  - Removing the dead DoorConnector ( since JNI is working and we still have
  a lot of work to do).
  
  - minor fixes and re-using related changes.
  
  Revision  Changes    Path
  1.20      +5 -6      jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java
  
  Index: HttpConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HttpConnectionHandler.java	2000/04/17 21:02:30	1.19
  +++ HttpConnectionHandler.java	2000/04/18 19:36:05	1.20
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
1.19 2000/04/17 21:02:30 costin Exp $
  - * $Revision: 1.19 $
  - * $Date: 2000/04/17 21:02:30 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
1.20 2000/04/18 19:36:05 costin Exp $
  + * $Revision: 1.20 $
  + * $Date: 2000/04/18 19:36:05 $
    *
    * ====================================================================
    *
  @@ -170,10 +170,9 @@
   		    (BufferedServletInputStream)reqA.getInputStream();
   		sis.setLimit(contentLength);
   	    }
  -    
  -	    //	    System.out.print("3");
  +
   	    contextM.service( reqA, resA );
  -	    //	    System.out.print("4");
  +
   	    try {
                  InputStream is = socket.getInputStream();
                  int available = is.available ();
  
  
  
  1.9       +16 -16    jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HttpRequestAdapter.java	2000/03/28 03:40:00	1.8
  +++ HttpRequestAdapter.java	2000/04/18 19:36:05	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
1.8 2000/03/28 03:40:00 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/03/28 03:40:00 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
1.9 2000/04/18 19:36:05 costin Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/04/18 19:36:05 $
    *
    * ====================================================================
    *
  @@ -76,18 +76,24 @@
       private Socket socket;
       private boolean moreRequests = false;
       InputStream sin;
  +    byte[] buf;
       
       public HttpRequestAdapter() {
           super();
  +	buf=new byte[Constants.RequestBufferSize];
       }
   
       public void setSocket(Socket socket) throws IOException {
  -	sin = socket.getInputStream();
  +	sin = new BufferedInputStream ( socket.getInputStream());
   	in = new BufferedServletInputStream(this);
           this.socket = socket;
       	moreRequests = true;
       }
   
  +    public void recycle() {
  +	super.recycle();
  +    }
  +    
       public Socket getSocket() {
           return this.socket;
       }
  @@ -105,15 +111,13 @@
       }
   
       public void readNextRequest(Response response) throws IOException {
  -	String line="";
  -	// cut&paste from BufferedInputStream.
  -	// XXX reuse buff, avoid creating strings 
  -	byte[] buf = new byte[Constants.RequestBufferSize];
   	int count = in.readLine(buf, 0, buf.length);
  -	if (count >= 0) {
  -            line=new String(buf, 0, count, Constants.CharacterEncoding.Default);
  +	if (count < 0 ) {
  +	    response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
   	}
   
  +	String line=new String(buf, 0, count, Constants.CharacterEncoding.Default);
  +
   	processRequestLine(response,line);
   
   	// XXX
  @@ -131,16 +135,10 @@
   	if ((protocol!=null) &&
               !protocol.toLowerCase().startsWith("http/0."))
   	    headers.read(in);
  -	//	processCookies(); // called later
  -
  -	// 	contentLength = headers.getIntHeader("content-length");
  -	// 	contentType = headers.getHeader("content-type");
  -	//         charEncoding = getCharsetFromContentType(contentType);
   
   	// XXX
   	// detect for real whether or not we have more requests
   	// coming
  -
   	moreRequests = false;	
       }    
       
  @@ -243,4 +241,6 @@
   	    requestURI= requestString;
   	}
       }
  +
  +    
   }
  
  
  

Mime
View raw message