cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2005-04-19 Thread keith
keith   2005/04/19 07:49:26

  Modified:coyote/src/java/org/apache/coyote Tag: TOMCAT_5_0
Request.java
  Log:
  [33970] backport Remy's 1.31 fix into the 5.0 branch
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.27.2.2  +0 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.27.2.1
  retrieving revision 1.27.2.2
  diff -u -r1.27.2.1 -r1.27.2.2
  --- Request.java  25 Aug 2004 20:44:15 -  1.27.2.1
  +++ Request.java  19 Apr 2005 14:49:26 -  1.27.2.2
  @@ -74,7 +74,6 @@
   parameters.setURLDecoder(urlDecoder);
   parameters.setHeaders(headers);
   
  -schemeMB.setString(http);
   methodMB.setString(GET);
   uriMB.setString(/);
   queryMB.setString();
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2005-01-05 Thread remm
remm2005/01/05 16:46:37

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - 32781: Fix bad initialization of the scheme field of the request object, 
which messes up the first request.
This should only be set by the connector.
  
  Revision  ChangesPath
  1.31  +0 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Request.java  12 Aug 2004 21:46:41 -  1.30
  +++ Request.java  6 Jan 2005 00:46:37 -   1.31
  @@ -74,7 +74,6 @@
   parameters.setURLDecoder(urlDecoder);
   parameters.setHeaders(headers);
   
  -schemeMB.setString(http);
   methodMB.setString(GET);
   uriMB.setString(/);
   queryMB.setString();
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2004-07-07 Thread remm
remm2004/07/07 09:29:34

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - Remove deprecation by using Costin's factory pattern.
  
  Revision  ChangesPath
  1.28  +15 -15
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Request.java  24 Feb 2004 08:54:29 -  1.27
  +++ Request.java  7 Jul 2004 16:29:34 -   1.28
  @@ -87,31 +87,31 @@
   
   
   private int serverPort = -1;
  -private MessageBytes serverNameMB = new MessageBytes();
  +private MessageBytes serverNameMB = MessageBytes.newInstance();
   
   private String localHost;
   
   private int remotePort;
   private int localPort;
   
  -private MessageBytes schemeMB = new MessageBytes();
  +private MessageBytes schemeMB = MessageBytes.newInstance();
   
  -private MessageBytes methodMB = new MessageBytes();
  -private MessageBytes unparsedURIMB = new MessageBytes();
  -private MessageBytes uriMB = new MessageBytes();
  -private MessageBytes decodedUriMB = new MessageBytes();
  -private MessageBytes queryMB = new MessageBytes();
  -private MessageBytes protoMB = new MessageBytes();
  +private MessageBytes methodMB = MessageBytes.newInstance();
  +private MessageBytes unparsedURIMB = MessageBytes.newInstance();
  +private MessageBytes uriMB = MessageBytes.newInstance();
  +private MessageBytes decodedUriMB = MessageBytes.newInstance();
  +private MessageBytes queryMB = MessageBytes.newInstance();
  +private MessageBytes protoMB = MessageBytes.newInstance();
   
   // remote address/host
  -private MessageBytes remoteAddrMB = new MessageBytes();
  -private MessageBytes localNameMB = new MessageBytes();
  -private MessageBytes remoteHostMB = new MessageBytes();
  -private MessageBytes localAddrMB = new MessageBytes();
  +private MessageBytes remoteAddrMB = MessageBytes.newInstance();
  +private MessageBytes localNameMB = MessageBytes.newInstance();
  +private MessageBytes remoteHostMB = MessageBytes.newInstance();
  +private MessageBytes localAddrMB = MessageBytes.newInstance();

   private MimeHeaders headers = new MimeHeaders();
   
  -private MessageBytes instanceId = new MessageBytes();
  +private MessageBytes instanceId = MessageBytes.newInstance();
   
   /**
* Notes.
  @@ -143,8 +143,8 @@
   private Cookies cookies = new Cookies(headers);
   private Parameters parameters = new Parameters();
   
  -private MessageBytes remoteUser=new MessageBytes();
  -private MessageBytes authType=new MessageBytes();
  +private MessageBytes remoteUser=MessageBytes.newInstance();
  +private MessageBytes authType=MessageBytes.newInstance();
   private HashMap attributes=new HashMap();
   
   private Response response;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2004-02-03 Thread remm
remm2004/02/03 05:03:53

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - Hashtable - HashMap.
  
  Revision  ChangesPath
  1.26  +3 -3  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Request.java  2 Dec 2003 23:01:00 -   1.25
  +++ Request.java  3 Feb 2004 13:03:53 -   1.26
  @@ -61,7 +61,7 @@
   package org.apache.coyote;
   
   import java.io.IOException;
  -import java.util.Hashtable;
  +import java.util.HashMap;
   
   import org.apache.tomcat.util.buf.ByteChunk;
   import org.apache.tomcat.util.buf.MessageBytes;
  @@ -189,7 +189,7 @@
   
   private MessageBytes remoteUser=new MessageBytes();
   private MessageBytes authType=new MessageBytes();
  -private Hashtable attributes=new Hashtable();
  +private HashMap attributes=new HashMap();
   
   private Response response;
   private ActionHook hook;
  @@ -432,7 +432,7 @@
   attributes.put( name, o );
   }
   
  -public Hashtable getAttributes() {
  +public HashMap getAttributes() {
   return attributes;
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2003-09-07 Thread remm
remm2003/09/07 11:03:21

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - Make the update of the stats an explicit call (I believe it is valid to call
recycle multiple times, and it is hard to avoid with HTTP keepalive).
  
  Revision  ChangesPath
  1.23  +5 -3  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Request.java  5 Jun 2003 19:46:49 -   1.22
  +++ Request.java  7 Sep 2003 18:03:21 -   1.23
  @@ -195,7 +195,7 @@
   
   private int bytesRead=0;
   // Time of the request - usefull to avoid repeated calls to System.currentTime
  -private long startTime;
  +private long startTime = 0L;
   
   private RequestInfo reqProcessorMX=new RequestInfo(this);
   // - Properties
  @@ -494,8 +494,6 @@
   
   
   public void recycle() {
  -// Call RequestProcessorMX
  -reqProcessorMX.updateCounters();
   bytesRead=0;
   
contentLength = -1;
  @@ -533,6 +531,10 @@
   }
   
   //  Info  
  +public void updateCounters() {
  +reqProcessorMX.updateCounters();
  +}
  +
   public RequestInfo getRequestProcessor() {
   return reqProcessorMX;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2003-01-20 Thread costin
costin  2003/01/20 15:45:11

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  Update RequestInfo.
  
  Add a new field - start time. It's very usefull - it can be used
  in many places to avoid calling System.currentTimeMillis().
  
  Revision  ChangesPath
  1.18  +11 -3 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Request.java  16 Jan 2003 22:25:19 -  1.17
  +++ Request.java  20 Jan 2003 23:45:11 -  1.18
  @@ -190,8 +190,10 @@
   private ActionHook hook;
   
   private int bytesRead=0;
  +// Time of the request - usefull to avoid repeated calls to System.currentTime
  +private long startTime;
   
  -private RequestProcessor reqProcessorMX=new RequestProcessor(this);
  +private RequestInfo reqProcessorMX=new RequestInfo(this);
   // - Properties
   
   
  @@ -447,11 +449,17 @@
   
   //  debug 
   
  -
   public String toString() {
return R(  + requestURI().toString() + );
   }
   
  +public long getStartTime() {
  +return startTime;
  +}
  +
  +public void setStartTime(long startTime) {
  +this.startTime = startTime;
  +}
   
   //  Per-Request notes 
   
  @@ -509,7 +517,7 @@
   }
   
   //  Info  
  -public RequestProcessor getRequestProcessor() {
  +public RequestInfo getRequestProcessor() {
   return reqProcessorMX;
   }
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2003-01-16 Thread remm
remm2003/01/16 14:25:19

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - It doesn't seem useful to do a recycle on init. Rather, initialize the fields 
needed.
  
  Revision  ChangesPath
  1.17  +7 -3  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Request.java  16 Jan 2003 21:56:02 -  1.16
  +++ Request.java  16 Jan 2003 22:25:19 -  1.17
  @@ -114,12 +114,16 @@
   
   public Request() {
   
  - recycle();
  -
   parameters.setQuery(queryMB);
   parameters.setURLDecoder(urlDecoder);
   parameters.setHeaders(headers);
   
  +schemeMB.setString(http);
  +methodMB.setString(GET);
  +uriMB.setString(/);
  +queryMB.setString();
  +protoMB.setString(HTTP/1.0);
  +
   }
   
   
  @@ -516,4 +520,4 @@
   public void setBytesRead(int bytesRead) {
   this.bytesRead = bytesRead;
   }
  -}
  \ No newline at end of file
  +}
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-09-19 Thread remm

remm2002/09/18 23:39:43

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - Revert patch.
  
  Revision  ChangesPath
  1.15  +0 -16 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Request.java  18 Sep 2002 16:44:35 -  1.14
  +++ Request.java  19 Sep 2002 06:39:43 -  1.15
  @@ -73,8 +73,6 @@
   import org.apache.tomcat.util.http.ContentType;
   import org.apache.tomcat.util.http.Cookies;
   
  -import java.net.Socket;
  -
   /**
* This is a low-level, efficient representation of a server request. Most 
* fields are GC-free, expensive operations are delayed until the  user code 
  @@ -186,9 +184,6 @@
   
   private Response response;
   private ActionHook hook;
  -
  -private Socket socket;
  -
   // - Properties
   
   
  @@ -208,21 +203,10 @@
   return headers;
   }
   
  -/* Used to associate this Request with a socket.  Used later to do
  -   SSL related stuff. */
  -public Socket getSocket() {
  -return this.socket;
  -}
  -
  -public void setSocket(Socket socket) {
  -this.socket = socket;
  -}
  -
   
   public UDecoder getURLDecoder() {
   return urlDecoder;
   }
  -
   
   //  Request data 
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java Response.java

2002-04-09 Thread costin

costin  02/04/09 11:19:27

  Modified:coyote/src/java/org/apache/coyote Request.java Response.java
  Log:
  Add the second param in calling.
  The tomcat3 and 4 adapters are calling the request and response methods, it
  doesn't seem to be any other place to depend on this ( except the impl )
  
  Revision  ChangesPath
  1.13  +1 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Request.java  8 Apr 2002 22:56:22 -   1.12
  +++ Request.java  9 Apr 2002 18:19:27 -   1.13
  @@ -428,7 +428,7 @@
*/
   public int doRead(ByteChunk chunk) 
   throws IOException {
  -int n = inputBuffer.doRead(chunk);
  +int n = inputBuffer.doRead(chunk, this);
   if (n  0)
   available -= n;
   return n;
  
  
  
  1.11  +3 -3  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  
  Index: Response.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Response.java 8 Apr 2002 23:07:11 -   1.10
  +++ Response.java 9 Apr 2002 18:19:27 -   1.11
  @@ -475,14 +475,14 @@
*/
   public void doWrite(ByteChunk chunk/*byte buffer[], int pos, int count*/)
   throws IOException {
  -outputBuffer.doWrite(chunk);
  +outputBuffer.doWrite(chunk, this);
   }
   
   
   // 
   
   public void recycle() {
  -
  +
contentType = Constants.DEFAULT_CONTENT_TYPE;
contentLanguage = null;
   locale = Constants.DEFAULT_LOCALE;
  @@ -494,7 +494,7 @@
errorException = null;
errorURI = null;
headers.clear();
  -
  +
   }
   
   }
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-04-08 Thread remm

remm02/04/08 15:03:09

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - It seems that remoteHost and remoteAddr shouldn't be recycled after each
request, as the connection may last for more than one request/response
(and it would be the responsability of the protocol handler to set the value
whenever necessary).
  
  Revision  ChangesPath
  1.11  +4 -4  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Request.java  6 Apr 2002 17:57:35 -   1.10
  +++ Request.java  8 Apr 2002 22:03:08 -   1.11
  @@ -463,8 +463,8 @@
queryMB.recycle();
methodMB.recycle();
protoMB.recycle();
  - remoteAddrMB.recycle();
  - remoteHostMB.recycle();
  + //remoteAddrMB.recycle();
  + //remoteHostMB.recycle();
   
// XXX Do we need such defaults ?
   schemeMB.setString(http);
  @@ -472,8 +472,8 @@
   uriMB.setString(/);
   queryMB.setString();
   protoMB.setString(HTTP/1.0);
  -remoteAddrMB.setString(127.0.0.1);
  -remoteHostMB.setString(localhost);
  +//remoteAddrMB.setString(127.0.0.1);
  +//remoteHostMB.setString(localhost);
   
   instanceId.recycle();
   remoteUser.recycle();
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java Response.java

2002-04-08 Thread costin

costin  02/04/08 15:56:22

  Modified:coyote/src/java/org/apache/coyote Request.java Response.java
  Log:
  Allow Request to send callbacks - for lazy-evaluated attributes, and hopefully
  to request more data.
  
  Pass the Response/Request as the second param to Action - this allows
  stateless implementation of the hooks ( all this will be much cleaner when/if
  we move to generic Ctx ).
  
  Revision  ChangesPath
  1.12  +14 -0 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Request.java  8 Apr 2002 22:03:08 -   1.11
  +++ Request.java  8 Apr 2002 22:56:22 -   1.12
  @@ -183,6 +183,7 @@
   private Hashtable attributes=new Hashtable();
   
   private Response response;
  +private ActionHook hook;
   // - Properties
   
   
  @@ -354,8 +355,21 @@
   
   public void setResponse( Response response ) {
   this.response=response;
  +response.setRequest( this );
   }
   
  +public void action(ActionCode actionCode, Object param) {
  +if( hook==null  response!=null )
  +hook=response.getHook();
  +
  +if (hook != null) {
  +if( param==null ) 
  +hook.action(actionCode, this);
  +else
  +hook.action(actionCode, param);
  +}
  +}
  +
   
   //  Cookies 
   
  
  
  
  1.9   +16 -4 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  
  Index: Response.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Response.java 15 Mar 2002 19:07:35 -  1.8
  +++ Response.java 8 Apr 2002 22:56:22 -   1.9
  @@ -155,9 +155,17 @@
*/
   protected String errorURI = null;
   
  +protected Request req;
   
   // - Properties
   
  +public Request getRequest() {
  +return req;
  +}
  +
  +public void setRequest( Request req ) {
  +this.req=req;
  +}
   
   public OutputBuffer getOutputBuffer() {
return outputBuffer;
  @@ -202,7 +210,10 @@
   
   public void action(ActionCode actionCode, Object param) {
   if (hook != null) {
  -hook.action(actionCode, param);
  +if( param==null ) 
  +hook.action(actionCode, this);
  +else
  +hook.action(actionCode, param);
   }
   }
   
  @@ -317,17 +328,17 @@
throw new IllegalStateException();
}
   
  -action(ActionCode.ACTION_RESET, null);
  +action(ActionCode.ACTION_RESET, this);
   }
   
   
   public void finish() throws IOException {
  -action(ActionCode.ACTION_CLOSE, null);
  +action(ActionCode.ACTION_CLOSE, this);
   }
   
   
   public void acknowledge() throws IOException {
  -action(ActionCode.ACTION_ACK, null);
  +action(ActionCode.ACTION_ACK, this);
   }
   
   
  @@ -392,6 +403,7 @@
*  interceptors to fix headers.
*/
   public void sendHeaders() throws IOException {
  +// XXX This code doesn't send any notification :-)
commited = true;
   }
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-04-06 Thread costin

costin  02/04/06 09:57:35

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  Remy, I changed the fields from protected to private - the class
  is declared final, so protected doesn't make too much sense.
  
  Also added a response field - they work in pair and it's easier
  for recycling to store only one reference instead of 2.
  
  Revision  ChangesPath
  1.10  +38 -27
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Request.java  4 Apr 2002 22:29:53 -   1.9
  +++ Request.java  6 Apr 2002 17:57:35 -   1.10
  @@ -127,61 +127,62 @@
   // - Instance Variables
   
   
  -protected int serverPort = -1;
  -protected MessageBytes serverNameMB = new MessageBytes();
  +private int serverPort = -1;
  +private MessageBytes serverNameMB = new MessageBytes();
   
  -protected String localHost;
  +private String localHost;
   
  -protected MessageBytes schemeMB = new MessageBytes();
  +private MessageBytes schemeMB = new MessageBytes();
   
  -protected MessageBytes methodMB = new MessageBytes();
  -protected MessageBytes unparsedURIMB = new MessageBytes();
  -protected MessageBytes uriMB = new MessageBytes();
  -protected MessageBytes decodedUriMB = new MessageBytes();
  -protected MessageBytes queryMB = new MessageBytes();
  -protected MessageBytes protoMB = new MessageBytes();
  +private MessageBytes methodMB = new MessageBytes();
  +private MessageBytes unparsedURIMB = new MessageBytes();
  +private MessageBytes uriMB = new MessageBytes();
  +private MessageBytes decodedUriMB = new MessageBytes();
  +private MessageBytes queryMB = new MessageBytes();
  +private MessageBytes protoMB = new MessageBytes();
   
   // remote address/host
  -protected MessageBytes remoteAddrMB = new MessageBytes();
  -protected MessageBytes remoteHostMB = new MessageBytes();
  +private MessageBytes remoteAddrMB = new MessageBytes();
  +private MessageBytes remoteHostMB = new MessageBytes();
   
  -protected MimeHeaders headers = new MimeHeaders();
  +private MimeHeaders headers = new MimeHeaders();
   
  -protected MessageBytes instanceId = new MessageBytes();
  +private MessageBytes instanceId = new MessageBytes();
   
   /**
* Notes.
*/
  -protected Object notes[] = new Object[Constants.MAX_NOTES];
  +private Object notes[] = new Object[Constants.MAX_NOTES];
   
   
   /**
* Associated input buffer.
*/
  -protected InputBuffer inputBuffer = null;
  +private InputBuffer inputBuffer = null;
   
   
   /**
* URL decoder.
*/
  -protected UDecoder urlDecoder = new UDecoder();
  +private UDecoder urlDecoder = new UDecoder();
   
   
   /**
* HTTP specific fields. (remove them ?)
*/
  -protected int contentLength = -1;
  +private int contentLength = -1;
   // how much body we still have to read.
  -protected int available = -1; 
  -protected MessageBytes contentTypeMB = null;
  -protected String charEncoding = null;
  -protected Cookies cookies = new Cookies(headers);
  -protected Parameters parameters = new Parameters();
  -
  -protected MessageBytes remoteUser=new MessageBytes();
  -protected MessageBytes authType=new MessageBytes();
  -protected Hashtable attributes=new Hashtable();
  +private int available = -1; 
  +private MessageBytes contentTypeMB = null;
  +private String charEncoding = null;
  +private Cookies cookies = new Cookies(headers);
  +private Parameters parameters = new Parameters();
  +
  +private MessageBytes remoteUser=new MessageBytes();
  +private MessageBytes authType=new MessageBytes();
  +private Hashtable attributes=new Hashtable();
   
  +private Response response;
   // - Properties
   
   
  @@ -345,6 +346,16 @@
   return headers.getHeader(name);
   }
   
  +//  Associated response 
  +
  +public Response getResponse() {
  +return response;
  +}
  +
  +public void setResponse( Response response ) {
  +this.response=response;
  +}
  +
   
   //  Cookies 
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-04-04 Thread costin

costin  02/04/04 14:29:53

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  Remove workerId, use the existing instanceId
  
  Revision  ChangesPath
  1.9   +4 -7  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Request.java  3 Apr 2002 23:55:05 -   1.8
  +++ Request.java  4 Apr 2002 22:29:53 -   1.9
  @@ -179,7 +179,6 @@
   protected Parameters parameters = new Parameters();
   
   protected MessageBytes remoteUser=new MessageBytes();
  -protected MessageBytes workerId=new MessageBytes();
   protected MessageBytes authType=new MessageBytes();
   protected Hashtable attributes=new Hashtable();
   
  @@ -187,7 +186,9 @@
   
   
   /**
  - * Get the instance id (or JVM route).
  + * Get the instance id (or JVM route). Curently Ajp is sending it with each
  + * request. In future this should be fixed, and sent only once ( or
  + * 'negociated' at config time so both tomcat and apache share the same name.
* 
* @return the instance id
*/
  @@ -384,10 +385,6 @@
   return authType;
   }
   
  -public MessageBytes getWorkerId() {
  -return workerId;
  -}
  -
   //  Input Buffer 
   
   
  @@ -467,9 +464,9 @@
   remoteAddrMB.setString(127.0.0.1);
   remoteHostMB.setString(localhost);
   
  +instanceId.recycle();
   remoteUser.recycle();
   authType.recycle();
  -workerId.recycle();
   attributes.clear();
   }
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-04-03 Thread costin

costin  02/04/03 15:55:05

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  Added 4 more fields to Request.
  
  Let me know if you think they shouldn't be exposed, I can use
  notes. All are required to support non-http protocols ( i.e. ajp )
  and reuse the same connector/interceptor and low level code.
  
  Revision  ChangesPath
  1.8   +35 -1 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Request.java  11 Mar 2002 00:26:50 -  1.7
  +++ Request.java  3 Apr 2002 23:55:05 -   1.8
  @@ -178,6 +178,10 @@
   protected Cookies cookies = new Cookies(headers);
   protected Parameters parameters = new Parameters();
   
  +protected MessageBytes remoteUser=new MessageBytes();
  +protected MessageBytes workerId=new MessageBytes();
  +protected MessageBytes authType=new MessageBytes();
  +protected Hashtable attributes=new Hashtable();
   
   // - Properties
   
  @@ -201,7 +205,6 @@
   return urlDecoder;
   }
   
  -
   //  Request data 
   
   
  @@ -358,6 +361,33 @@
   }
   
   
  +//  Other attributes 
  +// We can use notes for most - need to discuss what is of general interest
  +
  +public void setAttribute( String name, Object o ) {
  +attributes.put( name, o );
  +}
  +
  +public Hashtable getAttributes() {
  +return attributes;
  +}
  +
  +public Object getAttribute(String name ) {
  +return attributes.get(name);
  +}
  +
  +public MessageBytes getRemoteUser() {
  +return remoteUser;
  +}
  +
  +public MessageBytes getAuthType() {
  +return authType;
  +}
  +
  +public MessageBytes getWorkerId() {
  +return workerId;
  +}
  +
   //  Input Buffer 
   
   
  @@ -437,6 +467,10 @@
   remoteAddrMB.setString(127.0.0.1);
   remoteHostMB.setString(localhost);
   
  +remoteUser.recycle();
  +authType.recycle();
  +workerId.recycle();
  +attributes.clear();
   }
   
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-03-10 Thread remm

remm02/03/10 16:26:50

  Modified:coyote/src/java/org/apache/coyote Request.java
  Log:
  - Add a field to store the decoded URI.
  
  Revision  ChangesPath
  1.7   +6 -0  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Request.java  8 Mar 2002 18:50:41 -   1.6
  +++ Request.java  11 Mar 2002 00:26:50 -  1.7
  @@ -137,6 +137,7 @@
   protected MessageBytes methodMB = new MessageBytes();
   protected MessageBytes unparsedURIMB = new MessageBytes();
   protected MessageBytes uriMB = new MessageBytes();
  +protected MessageBytes decodedUriMB = new MessageBytes();
   protected MessageBytes queryMB = new MessageBytes();
   protected MessageBytes protoMB = new MessageBytes();
   
  @@ -220,6 +221,10 @@
   return uriMB;
   }
   
  +public MessageBytes decodedURI() {
  +return decodedUriMB;
  +}
  +
   public MessageBytes query() {
   return queryMB;
   }
  @@ -416,6 +421,7 @@
   
   unparsedURIMB.recycle();
   uriMB.recycle();
  +decodedUriMB.recycle();
queryMB.recycle();
methodMB.recycle();
protoMB.recycle();
  
  
  

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




Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-03-08 Thread Remy Maucherat

 I've just started the 3.3.x port of Coyote.  I can manage to set this one,
 but who uses it?  The Processor (currently) doesn't look at it (AFAIK).

That's the problem at the moment. I'm still undecided as to what goes where.
The 'secure' flag may be Catalina specific (and the processor has no clue
whether or not the connection is secure; it's the connector which knows
that), so I moving it to the adapter.

The API may change a bit. Maybe it will become closer to the one used by TC
3.3. I hope you don't mind the API stability problems too much ...
Hopefully, it will be stable soon.

Remy


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




Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-03-08 Thread Bill Barker


- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, March 08, 2002 11:40 AM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java




 On Fri, 8 Mar 2002, Remy Maucherat wrote:

  Date: Fri, 8 Mar 2002 11:20:57 -0800
  From: Remy Maucherat [EMAIL PROTECTED]
  Reply-To: Tomcat Developers List [EMAIL PROTECTED]
  To: Tomcat Developers List [EMAIL PROTECTED]
  Subject: Re: cvs commit:
  jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote
Request.java
 
   I've just started the 3.3.x port of Coyote.  I can manage to set this
one,
   but who uses it?  The Processor (currently) doesn't look at it
(AFAIK).
 
  That's the problem at the moment. I'm still undecided as to what goes
where.
  The 'secure' flag may be Catalina specific (and the processor has no
clue
  whether or not the connection is secure; it's the connector which knows
  that), so I moving it to the adapter.
 
I was just asking. :)  3.3.x has the flag as well, since isSecure() is also
in 2.2.  It's just that I wasn't planning on exposing the o.a.c.Request to
the rest of Tomcat so if nobody was ever going to look at the flag, I could
ignore it.

 Catalina uses the secure property of the current HTTP connector to give
 the right answer to ServletRequest.isSecure().  I imagine the same thing
 will need to be done for Coyote (and the secure flag would also need to
 be sent along for a JK request because it can vary each time???).

  The API may change a bit. Maybe it will become closer to the one used by
TC
  3.3. I hope you don't mind the API stability problems too much ...
  Hopefully, it will be stable soon.
 
I don't mind at all. :)
  Remy
 

 Craig


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



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




Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-03-08 Thread Remy Maucherat

   That's the problem at the moment. I'm still undecided as to what goes
 where.
   The 'secure' flag may be Catalina specific (and the processor has no
 clue
   whether or not the connection is secure; it's the connector which
knows
   that), so I moving it to the adapter.
  
 I was just asking. :)  3.3.x has the flag as well, since isSecure() is
also
 in 2.2.  It's just that I wasn't planning on exposing the o.a.c.Request to
 the rest of Tomcat so if nobody was ever going to look at the flag, I
could
 ignore it.

Maybe I'll put it back then :-)

  Catalina uses the secure property of the current HTTP connector to
give
  the right answer to ServletRequest.isSecure().  I imagine the same thing
  will need to be done for Coyote (and the secure flag would also need
to
  be sent along for a JK request because it can vary each time???).
 
   The API may change a bit. Maybe it will become closer to the one used
by
 TC
   3.3. I hope you don't mind the API stability problems too much ...
   Hopefully, it will be stable soon.
  
 I don't mind at all. :)

Good. I did a few changes, so that the 3.3 adapter can use the tc-util
provided cookie and parameter parsing. The TC 4 adapter doesn't use that
cookie parser, because there's no incentive performance wise (the object
would have to be wrapped by facades, which would create some GC).

Given the tester results (only one 'real' failure, on a really nasty test),
I'd say the new HTTP stack is ready for some testing. The next TC 4 nightly
should have a usable version.
To use it, install the nightly, and access port 8081 instead on 8080.

Remy


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




Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java

2002-03-07 Thread Bill Barker

I've just started the 3.3.x port of Coyote.  I can manage to set this one,
but who uses it?  The Processor (currently) doesn't look at it (AFAIK).
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 07, 2002 9:15 PM
Subject: cvs commit:
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java


 remm02/03/07 21:15:51

   Modified:coyote/src/java/org/apache/coyote Request.java
   Log:
   - Add a secure flag on the request.

   Revision  ChangesPath
   1.5   +15 -4
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java

   Index: Request.java
   ===
   RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Reques
t.java,v
   retrieving revision 1.4
   retrieving revision 1.5
   diff -u -r1.4 -r1.5
   --- Request.java 31 Jan 2002 18:42:29 - 1.4
   +++ Request.java 8 Mar 2002 05:15:51 - 1.5
   @@ -121,10 +121,13 @@
// - Instance
Variables


   -protected int serverPort;
   +protected int serverPort = -1;
   +protected MessageBytes serverNameMB = new MessageBytes();
   +
protected String localHost;

protected MessageBytes schemeMB = new MessageBytes();
   +protected boolean secure = false;

protected MessageBytes methodMB = new MessageBytes();
protected MessageBytes unparsedURIMB = new MessageBytes();
   @@ -166,7 +169,6 @@
protected int available = -1;
protected MessageBytes contentTypeMB = null;
protected String charEncoding = null;
   -protected MessageBytes serverNameMB = new MessageBytes();
protected Cookies cookies = new Cookies(headers);


   @@ -233,14 +235,15 @@
public MessageBytes serverName() {
return serverNameMB;
}
   -
   +
public int getServerPort() {
return serverPort;
}
   -
   +
public void setServerPort(int serverPort ) {
this.serverPort=serverPort;
}
   +
public MessageBytes remoteAddr() {
return remoteAddrMB;
}
   @@ -257,6 +260,13 @@
this.localHost = host;
}

   +public boolean isSecure() {
   +return secure;
   +}
   +
   +public void setSecure(boolean secure) {
   +this.secure = secure;
   +}

//  encoding/type 

   @@ -398,6 +408,7 @@

// XXX Do we need such defaults ?
schemeMB.setString(http);
   +secure = false;
methodMB.setString(GET);
uriMB.setString(/);
queryMB.setString();




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



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




cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java Response.java

2001-09-16 Thread remm

remm01/09/16 22:29:09

  Modified:coyote/src/java/org/apache/coyote Request.java Response.java
  Log:
  - Use some byte chunks instead of passing arrays. That allows all sorts of
tricks since it's fully possible to replace the internal array, append data, ...
  
  Revision  ChangesPath
  1.3   +4 -3  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Request.java  2001/07/10 02:55:02 1.2
  +++ Request.java  2001/09/17 05:29:09 1.3
  @@ -64,6 +64,7 @@
   import java.util.Enumeration;
   import java.util.Hashtable;
   
  +import org.apache.tomcat.util.buf.ByteChunk;
   import org.apache.tomcat.util.buf.MessageBytes;
   import org.apache.tomcat.util.buf.UDecoder;
   
  @@ -327,11 +328,11 @@
   
   
   /**
  - * Read data from the input buffer and put it into a byte array.
  + * Read data from the input buffer and put it into a byte chunk.
*/
  -public int doRead(byte b[], int off, int len) 
  +public int doRead(ByteChunk chunk/*byte b[], int off, int len*/) 
   throws IOException {
  -int n = inputBuffer.doRead(b, off, len);
  +int n = inputBuffer.doRead(chunk);
   if (n  0)
   available -= n;
   return n;
  
  
  
  1.3   +4 -2  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  
  Index: Response.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Response.java 2001/07/10 02:55:02 1.2
  +++ Response.java 2001/09/17 05:29:09 1.3
  @@ -63,6 +63,8 @@
   import java.io.IOException;
   import java.util.Locale;
   
  +import org.apache.tomcat.util.buf.ByteChunk;
  +
   import org.apache.tomcat.util.res.StringManager;
   
   import org.apache.tomcat.util.http.MimeHeaders;
  @@ -414,9 +416,9 @@
   /** 
* Write a chunk of bytes.
*/
  -public void doWrite(byte buffer[], int pos, int count)
  +public void doWrite(ByteChunk chunk/*byte buffer[], int pos, int count*/)
   throws IOException {
  -outputBuffer.doWrite(buffer, pos, count);
  +outputBuffer.doWrite(chunk);
   }