cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java CoyoteRequest.java

2004-01-05 Thread larryi
larryi  2004/01/05 18:06:26

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteRequest.java
  Log:
  Port convertURI() method so URIEncoding setting has the desired effect.
  
  Revision  ChangesPath
  1.25  +62 -6 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- CoyoteAdapter.java11 Dec 2003 21:35:24 -  1.24
  +++ CoyoteAdapter.java6 Jan 2004 02:06:26 -   1.25
  @@ -68,6 +68,7 @@
   import javax.servlet.http.Cookie;
   import javax.servlet.http.HttpServletRequest;
   
  +import org.apache.tomcat.util.buf.B2CConverter;
   import org.apache.tomcat.util.buf.ByteChunk;
   import org.apache.tomcat.util.buf.CharChunk;
   import org.apache.tomcat.util.buf.MessageBytes;
  @@ -220,7 +221,7 @@
*/
   protected void postParseRequest(Request req, CoyoteRequest request,
   Response res, CoyoteResponse response)
  -throws IOException {
  +throws Exception {
   // XXX the processor needs to set a correct scheme and port prior to this 
point, 
   // in ajp13 protocols dont make sense to get the port from the connector..
   // XXX the processor may have set a correct scheme and port prior to this 
point, 
  @@ -268,7 +269,6 @@
   res.setMessage(Invalid URI);
   throw ioe;
   }
  -req.decodedURI().setEncoding(UTF-8);
   
   // Normalize decoded URI
   if (!normalize(req.decodedURI())) {
  @@ -277,6 +277,9 @@
   throw new IOException(Invalid URI);
   }
   
  +// URI character decoding
  +convertURI(req.decodedURI(), request);
  +
   // Parse session Id
   parseSessionId(req, request);
   
  @@ -293,6 +296,7 @@
   // Redoing the URI decoding
   req.decodedURI().duplicate(req.requestURI());
   req.getURLDecoder().convert(req.decodedURI(), true);
  +convertURI(req.decodedURI(), request);
   }
   }
   
  @@ -512,6 +516,58 @@
   
   // Return the normalized path that we have completed
   return (normalized);
  +
  +}
  +
  +
  +/**
  + * Character conversion of the URI.
  + */
  +protected void convertURI(MessageBytes uri, CoyoteRequest request) 
  +throws Exception {
  +
  +ByteChunk bc = uri.getByteChunk();
  +CharChunk cc = uri.getCharChunk();
  +cc.allocate(bc.getLength(), -1);
  +
  +String enc = connector.getURIEncoding();
  +if (enc != null) {
  +B2CConverter conv = request.getURIConverter();
  +try {
  +if (conv == null) {
  +conv = new B2CConverter(enc);
  +request.setURIConverter(conv);
  +} else {
  +conv.recycle();
  +}
  +} catch (IOException e) {
  +// Ignore
  +log(Invalid URI encoding; using HTTP default, e);
  +connector.setURIEncoding(null);
  +}
  +if (conv != null) {
  +try {
  +conv.convert(bc, cc);
  +uri.setChars(cc.getBuffer(), cc.getStart(), 
  + cc.getLength());
  +return;
  +} catch (IOException e) {
  +if (debug = 1) {
  +log(Invalid URI character encoding; trying ascii, e);
  +}
  +cc.recycle();
  +}
  +}
  +}
  +
  +// Default encoding: fast conversion
  +byte[] bbuf = bc.getBuffer();
  +char[] cbuf = cc.getBuffer();
  +int start = bc.getStart();
  +for (int i = 0; i  bc.getLength(); i++) {
  +cbuf[i] = (char) (bbuf[i + start]  0xff);
  +}
  +uri.setChars(cbuf, 0, bc.getLength());
   
   }
   
  
  
  
  1.36  +27 -4 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- CoyoteRequest.java12 Dec 2003 02:44:34 -  1.35
  +++ CoyoteRequest.java6 Jan 2004 02:06:26 -   1.36
  @@ -110,6 +110,7 @@
   import 

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

2003-12-11 Thread markt
markt   2003/12/11 13:35:24

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - Fix bug 24283. Process uri as characters not bytes to ensure correct handling of 
unicode characters.
  
  Revision  ChangesPath
  1.24  +36 -24
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- CoyoteAdapter.java19 Nov 2003 23:23:18 -  1.23
  +++ CoyoteAdapter.java11 Dec 2003 21:35:24 -  1.24
  @@ -69,6 +69,7 @@
   import javax.servlet.http.HttpServletRequest;
   
   import org.apache.tomcat.util.buf.ByteChunk;
  +import org.apache.tomcat.util.buf.CharChunk;
   import org.apache.tomcat.util.buf.MessageBytes;
   import org.apache.tomcat.util.http.Cookies;
   import org.apache.tomcat.util.http.ServerCookie;
  @@ -299,14 +300,14 @@
   parseCookies(req, request);
   
   // Set the SSL properties
  - if( request.isSecure() ) {
  - res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  +if( request.isSecure() ) {
  +res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  request.getCoyoteRequest());
  - //Set up for getAttributeNames
  - request.getAttribute(Globals.CERTIFICATES_ATTR);
  - request.getAttribute(Globals.CIPHER_SUITE_ATTR);
  - request.getAttribute(Globals.KEY_SIZE_ATTR);
  - }
  +//Set up for getAttributeNames
  +request.getAttribute(Globals.CERTIFICATES_ATTR);
  +request.getAttribute(Globals.CIPHER_SUITE_ATTR);
  +request.getAttribute(Globals.KEY_SIZE_ATTR);
  +}
   
   // Set the remote principal
   String principal = req.getRemoteUser().toString();
  @@ -322,31 +323,42 @@
*/
   protected void parseSessionId(Request req, CoyoteRequest request) {
   
  -ByteChunk uriBC = req.decodedURI().getByteChunk();
  -int semicolon = uriBC.indexOf(match, 0, match.length(), 0);
  +req.decodedURI().toChars();
  +CharChunk uriCC = req.decodedURI().getCharChunk();
  +int semicolon = uriCC.indexOf(match, 0, match.length(), 0);
   
   if (semicolon  0) {
   
   // Parse session ID, and extract it from the decoded request URI
  -String uri = uriBC.toString();
  -String rest = uri.substring(semicolon + match.length());
  -int semicolon2 = rest.indexOf(';');
  +int start = uriCC.getStart();
  +int end = uriCC.getEnd();
  +
  +int sessionIdStart = start + semicolon + match.length();
  +int semicolon2 = uriCC.indexOf(';', sessionIdStart);
   if (semicolon2 = 0) {
  -request.setRequestedSessionId(rest.substring(0, semicolon2));
  -rest = rest.substring(semicolon2);
  +request.setRequestedSessionId
  +(new String(uriCC.getBuffer(), sessionIdStart, 
  +semicolon2 - semicolon - match.length()));
  +req.decodedURI().setString
  +(new String(uriCC.getBuffer(), start, semicolon) + 
  +new String(uriCC.getBuffer(),
  +semicolon2,
  +end-semicolon2));
   } else {
  -request.setRequestedSessionId(rest);
  -rest = ;
  +request.setRequestedSessionId
  +(new String(uriCC.getBuffer(), sessionIdStart, 
  +end - sessionIdStart));
  +req.decodedURI().setString
  +(new String(uriCC.getBuffer(), start, semicolon));
   }
   request.setRequestedSessionURL(true);
  -req.decodedURI().setString(uri.substring(0, semicolon) + rest);
   
   // Extract session ID from request URI
  -uri = req.requestURI().toString();
  +String uri = req.requestURI().toString();
   semicolon = uri.indexOf(match);
   
   if (semicolon  0) {
  -rest = uri.substring(semicolon + match.length());
  +String rest = uri.substring(semicolon + match.length());
   semicolon2 = rest.indexOf(';');
   if (semicolon2 = 0) {
   rest = rest.substring(semicolon2);
  @@ -376,7 +388,7 @@
   
   Cookie[] cookies = new Cookie[count];
   
  - int idx=0;
  +int idx=0;
   for (int i = 0; i  count; i++) {
   ServerCookie scookie = serverCookies.getCookie(i);
   

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

2003-12-11 Thread Remy Maucherat
Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:

markt   2003/12/11 13:35:24

  Modified:coyote/src/java/org/apache/coyote/tomcat4 
CoyoteAdapter.java
  Log:
  - Fix bug 24283. Process uri as characters not bytes to ensure 
correct handling of unicode characters.


-1 for this patch. Character decoding should occur afterwards. Mapping 
should be done as bytes.
Oops, forget it, I thought this was in the TC 5 branch.
I need to think before pressing send.
Rémy



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


cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java CoyoteConnector.java

2003-11-19 Thread remm
remm2003/11/19 15:23:18

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector.java
  Log:
  - Add URI encoding field.
  
  Revision  ChangesPath
  1.23  +8 -4  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CoyoteAdapter.java1 Oct 2003 15:05:09 -   1.22
  +++ CoyoteAdapter.java19 Nov 2003 23:23:18 -  1.23
  @@ -183,6 +183,10 @@
   req.setNote(ADAPTER_NOTES, request);
   res.setNote(ADAPTER_NOTES, response);
   
  +// Set query string encoding
  +req.getParameters().setQueryStringEncoding
  +(connector.getURIEncoding());
  +
   }
   
   try {
  
  
  
  1.27  +32 -4 
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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- CoyoteConnector.java  3 May 2003 01:05:56 -   1.26
  +++ CoyoteConnector.java  19 Nov 2003 23:23:18 -  1.27
  @@ -351,6 +351,12 @@
   private Adapter adapter = null;
   
   
  + /**
  +  * URI encoding.
  +  */
  + private String URIEncoding = null;
  +
  +
   // - Properties
   
   
  @@ -946,6 +952,28 @@
   this.tcpNoDelay = tcpNoDelay;
   
   }
  +
  +
  + /**
  +  * Return the character encoding to be used for the URI.
  +  */
  + public String getURIEncoding() {
  +
  + return (this.URIEncoding);
  +
  + }
  +
  +
  + /**
  +  * Set the URI encoding to be used for the URI.
  +  *
  +  * @param URIEncoding The new URI character encoding.
  +  */
  + public void setURIEncoding(String URIEncoding) {
  +
  + this.URIEncoding = URIEncoding;
  +
  + }
   
   
   /**
  
  
  

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



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

2003-10-01 Thread remm
remm2003/10/01 04:44:24

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - Port missing URL normalization patch.
  
  Revision  ChangesPath
  1.21  +9 -7  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- CoyoteAdapter.java18 Sep 2003 20:53:01 -  1.20
  +++ CoyoteAdapter.java1 Oct 2003 11:44:24 -   1.21
  @@ -533,9 +533,11 @@
   
   // Replace // with /
   for (pos = start; pos  (end - 1); pos++) {
  -if ((b[pos] == (byte) '/')  (b[pos + 1] == (byte) '/')) {
  -copyBytes(b, pos, pos + 1, end - pos - 1);
  -end--;
  +if (b[pos] == (byte) '/') {
  +while ((pos + 1  end)  (b[pos + 1] == (byte) '/')) {
  +copyBytes(b, pos, pos + 1, end - pos - 1);
  +end--;
  +}
   }
   }
   
  
  
  

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



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

2003-10-01 Thread remm
remm2003/10/01 08:05:09

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - Port a cookie patch (I have no idea if it's really needed).
  
  Revision  ChangesPath
  1.22  +12 -6 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CoyoteAdapter.java1 Oct 2003 11:44:24 -   1.21
  +++ CoyoteAdapter.java1 Oct 2003 15:05:09 -   1.22
  @@ -391,9 +391,15 @@
   }
   try {
   Cookie cookie = new Cookie(scookie.getName().toString(),
  -   scookie.getValue().toString());
  +   scookie.getValue().toString());
  +cookie.setPath(scookie.getPath().toString());
  +cookie.setVersion(scookie.getVersion());
  +String domain = scookie.getDomain().toString();
  +if (domain != null) {
  +cookie.setDomain(scookie.getDomain().toString());
  +}
   cookies[idx++] = cookie;
  -} catch (Exception ex) {
  +} catch(Exception ex) {
   log(Bad Cookie Name:  + scookie.getName() + 
/Value:  + scookie.getValue(),ex);
   }
  
  
  

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



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

2003-09-18 Thread keith
keith   2003/09/18 13:53:01

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Respond 400 to requests which contain '%' with no or invalid trailing hex digits
  
  Revision  ChangesPath
  1.20  +11 -5 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CoyoteAdapter.java3 Jul 2003 00:15:16 -   1.19
  +++ CoyoteAdapter.java18 Sep 2003 20:53:01 -  1.20
  @@ -256,7 +256,13 @@
   
   // URI decoding
   req.decodedURI().duplicate(req.requestURI());
  -req.getURLDecoder().convert(req.decodedURI(), false);
  +try {
  +  req.getURLDecoder().convert(req.decodedURI(), false);
  +} catch (IOException ioe) {
  +res.setStatus(400);
  +res.setMessage(Invalid URI);
  +throw ioe;
  +}
   req.decodedURI().setEncoding(UTF-8);
   
   // Normalize decoded URI
  
  
  

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



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

2003-07-29 Thread remm
remm2003/07/29 10:19:29

  Modified:coyote/src/java/org/apache/coyote/tomcat4 Tag: coyote_10
CoyoteAdapter.java
  Log:
  - Port patch.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.13.2.5  +9 -7  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.13.2.4
  retrieving revision 1.13.2.5
  diff -u -r1.13.2.4 -r1.13.2.5
  --- CoyoteAdapter.java23 Mar 2003 09:04:06 -  1.13.2.4
  +++ CoyoteAdapter.java29 Jul 2003 17:19:29 -  1.13.2.5
  @@ -549,9 +549,11 @@
   
   // Replace // with /
   for (pos = start; pos  (end - 1); pos++) {
  -if ((b[pos] == (byte) '/')  (b[pos + 1] == (byte) '/')) {
  -copyBytes(b, pos, pos + 1, end - pos - 1);
  -end--;
  +if (b[pos] == (byte) '/') {
  +while ((pos + 1  end)  (b[pos + 1] == (byte) '/')) {
  +copyBytes(b, pos, pos + 1, end - pos - 1);
  +end--;
  +}
   }
   }
   
  
  
  

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



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

2003-07-02 Thread keith
keith   2003/07/02 17:15:16

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Allow * as a valid url
  
  Revision  ChangesPath
  1.19  +8 -4  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- CoyoteAdapter.java23 Mar 2003 08:57:49 -  1.18
  +++ CoyoteAdapter.java3 Jul 2003 00:15:16 -   1.19
  @@ -504,6 +504,10 @@
   int start = uriBC.getStart();
   int end = uriBC.getEnd();
   
  +// URL * is acceptable
  +if ((end - start == 1)  b[start] == (byte) '*')
  +  return true;
  +
   int pos = 0;
   int index = 0;
   
  
  
  

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



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

2003-03-23 Thread billbarker
billbarker2003/03/23 01:04:06

  Modified:coyote/src/java/org/apache/coyote Tag: coyote_10
Request.java
   coyote/src/java/org/apache/coyote/tomcat4 Tag: coyote_10
CoyoteAdapter.java
  Log:
  Port Patch from main branch.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.15.2.1  +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.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- Request.java  19 Sep 2002 06:39:43 -  1.15
  +++ Request.java  23 Mar 2003 09:04:06 -  1.15.2.1
  @@ -481,7 +481,7 @@
//remoteHostMB.recycle();
   
// XXX Do we need such defaults ?
  -schemeMB.setString(http);
  +schemeMB.recycle();
methodMB.setString(GET);
   uriMB.setString(/);
   queryMB.setString();
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.13.2.4  +16 -5 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.13.2.3
  retrieving revision 1.13.2.4
  diff -u -r1.13.2.3 -r1.13.2.4
  --- CoyoteAdapter.java16 Mar 2003 01:56:27 -  1.13.2.3
  +++ CoyoteAdapter.java23 Mar 2003 09:04:06 -  1.13.2.4
  @@ -248,7 +248,18 @@
   throws IOException {
   // XXX the processor needs to set a correct scheme and port prior to this 
point, 
   // in ajp13 protocols dont make sense to get the port from the connector..
  -request.setSecure(req.scheme().equals(https));
  +// XXX the processor may have set a correct scheme and port prior to this 
point, 
  +// in ajp13 protocols dont make sense to get the port from the connector...
  +// otherwise, use connector configuration
  +if (! req.scheme().isNull()) {
  +// use processor specified scheme to determine secure state
  +request.setSecure(req.scheme().equals(https));
  +} else {
  +// use connector scheme and secure configuration, (defaults to
  +// http and false respectively)
  +req.scheme().setString(connector.getScheme());
  +request.setSecure(connector.getSecure());
  +}
   
   request.setAuthorization
   (req.getHeader(Constants.AUTHORIZATION_HEADER));
  
  
  

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



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

2003-03-15 Thread billbarker
billbarker2003/03/15 17:43:47

  Modified:coyote/src/java/org/apache/coyote/tomcat4 Tag: coyote_10
CoyoteAdapter.java
  Log:
  Was just reminded that I forgot to port the bad-cookie patch to this branch.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.13.2.2  +12 -7 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- CoyoteAdapter.java15 Mar 2003 11:37:38 -  1.13.2.1
  +++ CoyoteAdapter.java16 Mar 2003 01:43:47 -  1.13.2.2
  @@ -382,7 +382,7 @@
   return;
   
   Cookie[] cookies = new Cookie[count];
  -
  +int idx=0;
   for (int i = 0; i  count; i++) {
   ServerCookie scookie = serverCookies.getCookie(i);
   if (scookie.getName().equals(Globals.SESSION_COOKIE_NAME)) {
  @@ -399,9 +399,14 @@
   .getRequestedSessionId());
   }
   }
  -Cookie cookie = new Cookie(scookie.getName().toString(),
  +try {
  +Cookie cookie = new Cookie(scookie.getName().toString(),
  scookie.getValue().toString());
  -cookies[i] = cookie;
  +cookies[idx++] = cookie;
  +} catch (Exception ex) {
  +log(Bad Cookie Name:  + scookie.getName() + 
  + /Value:  + scookie.getValue(),ex);
  +}
   }
   
   request.setCookies(cookies);
  
  
  

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



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

2003-03-15 Thread billbarker
billbarker2003/03/15 17:56:27

  Modified:coyote/src/java/org/apache/coyote/tomcat4 Tag: coyote_10
CoyoteAdapter.java
  Log:
  Small improvement on the bad-cookie case.  Leave out the null cookies when bad ones 
are detected.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.13.2.3  +9 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- CoyoteAdapter.java16 Mar 2003 01:43:47 -  1.13.2.2
  +++ CoyoteAdapter.java16 Mar 2003 01:56:27 -  1.13.2.3
  @@ -408,7 +408,11 @@
/Value:  + scookie.getValue(),ex);
   }
   }
  -
  +if( idx  count ) {
  +Cookie [] ncookies = new Cookie[idx];
  +System.arraycopy(cookies, 0, ncookies, 0, idx);
  +cookies = ncookies;
  +}
   request.setCookies(cookies);
   
   }
  
  
  

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



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

2003-03-15 Thread billbarker
billbarker2003/03/15 17:57:57

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Port patch.
  
  Revision  ChangesPath
  1.17  +16 -11
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CoyoteAdapter.java15 Mar 2003 11:37:05 -  1.16
  +++ CoyoteAdapter.java16 Mar 2003 01:57:57 -  1.17
  @@ -370,14 +370,19 @@
   .getRequestedSessionId());
   }
   }
  - try {
  - Cookie cookie = new Cookie(scookie.getName().toString(),
  +try {
  +Cookie cookie = new Cookie(scookie.getName().toString(),
  scookie.getValue().toString());
  - cookies[idx++] = cookie;
  - } catch (Exception ex) {
  - log(Bad Cookie Name:  + scookie.getName() + 
  -  /Value:  + scookie.getValue(),ex);
  - }
  +cookies[idx++] = cookie;
  +} catch (Exception ex) {
  +log(Bad Cookie Name:  + scookie.getName() + 
  + /Value:  + scookie.getValue(),ex);
  +}
  +}
  +if( idx  count ) {
  +Cookie [] ncookies = new Cookie[idx];
  +System.arraycopy(cookies, 0, ncookies, 0, idx);
  +cookies = ncookies;
   }
   
   request.setCookies(cookies);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java CoyoteConnector.java

2003-02-18 Thread costin
costin  2003/02/18 14:51:40

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector.java
  Log:
  Merged few changes from 5.0 to enable JMX on thread pools and connector.
  
  This is in the HEAD - jk and http adapters already have the dependency on
  JMX and modeler. Note that the code is called only if the connector is registered
  with JMX - if not, nothing will happen.
  
  Revision  ChangesPath
  1.14  +4 -34 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CoyoteAdapter.java10 Dec 2002 08:43:21 -  1.13
  +++ CoyoteAdapter.java18 Feb 2003 22:51:39 -  1.14
  @@ -64,53 +64,23 @@
   package org.apache.coyote.tomcat4;
   
   
  -import java.io.BufferedInputStream;
  -import java.io.EOFException;
  -import java.io.InterruptedIOException;
  -import java.io.InputStream;
   import java.io.IOException;
  -import java.io.OutputStream;
  -import java.net.InetAddress;
  -import java.net.Socket;
  -import java.util.ArrayList;
  -import java.util.Enumeration;
  -import java.util.Iterator;
  -import java.util.Locale;
  -import java.util.StringTokenizer;
  -import java.util.TreeMap;
  -import javax.servlet.ServletException;
   import javax.servlet.http.Cookie;
   import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.http.HttpServletResponse;
   
   import org.apache.tomcat.util.buf.ByteChunk;
  -import org.apache.tomcat.util.buf.HexUtils;
   import org.apache.tomcat.util.buf.MessageBytes;
   import org.apache.tomcat.util.http.Cookies;
   import org.apache.tomcat.util.http.ServerCookie;
   
   import org.apache.coyote.ActionCode;
  -import org.apache.coyote.ActionHook;
   import org.apache.coyote.Adapter;
  -import org.apache.coyote.InputBuffer;
  -import org.apache.coyote.OutputBuffer;
   import org.apache.coyote.Request;
   import org.apache.coyote.Response;
   
  -import org.apache.catalina.Connector;
  -import org.apache.catalina.Container;
   import org.apache.catalina.Globals;
  -import org.apache.catalina.HttpRequest;
  -import org.apache.catalina.HttpResponse;
  -import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
  -import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
  -import org.apache.catalina.util.LifecycleSupport;
  -import org.apache.catalina.util.RequestUtil;
   import org.apache.catalina.util.StringManager;
  -import org.apache.catalina.util.StringParser;
   
   
   /**
  
  
  
  1.23  +85 -59
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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CoyoteConnector.java  10 Feb 2003 09:57:37 -  1.22
  +++ CoyoteConnector.java  18 Feb 2003 22:51:39 -  1.23
  @@ -65,36 +65,15 @@
   package org.apache.coyote.tomcat4;
   
   
  -import java.io.IOException;
  -import java.net.InetAddress;
  -import java.net.ServerSocket;
  -import java.net.Socket;
  -import java.net.UnknownHostException;
  -import java.security.AccessControlException;
  -import java.util.Stack;
   import java.util.Vector;
  -import java.util.Enumeration;
  -import java.security.KeyStoreException;
  -import java.security.NoSuchAlgorithmException;
  -import java.security.cert.CertificateException;
  -import java.security.UnrecoverableKeyException;
  -import java.security.KeyManagementException;
  -
   import org.apache.tomcat.util.IntrospectionUtils;
   
  -import org.apache.coyote.ActionCode;
  -import org.apache.coyote.ActionHook;
   import org.apache.coyote.Adapter;
  -import org.apache.coyote.InputBuffer;
  -import org.apache.coyote.OutputBuffer;
   import org.apache.coyote.ProtocolHandler;
   
   import org.apache.catalina.Connector;
   import org.apache.catalina.Container;
  -import org.apache.catalina.HttpRequest;
  -import org.apache.catalina.HttpResponse;
   import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
  @@ -105,6 +84,11 @@
   import org.apache.catalina.net.ServerSocketFactory;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
  +import org.apache.commons.modeler.Registry;
  +
  

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

2002-12-10 Thread remm
remm2002/12/10 00:43:21

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - getCoyoteRequest needs to be used here (JK expects a Coyote Request,
not the facade).
  - Fix bug 15201.
  
  Revision  ChangesPath
  1.13  +6 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CoyoteAdapter.java20 Oct 2002 22:48:49 -  1.12
  +++ CoyoteAdapter.java10 Dec 2002 08:43:21 -  1.13
  @@ -307,7 +307,8 @@
   
   // Set the SSL properties
if( request.isSecure() ) {
  - res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,request.getRequest());
  + res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  +   request.getCoyoteRequest());
//Set up for getAttributeNames
request.getAttribute(Globals.CERTIFICATES_ATTR);
request.getAttribute(Globals.CIPHER_SUITE_ATTR);
  
  
  

--
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/tomcat4 CoyoteAdapter.java CoyoteRequest.java

2002-10-20 Thread billbarker
billbarker2002/10/20 15:48:49

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteRequest.java
  Log:
  Arrange to have the SSL attributes in the CoyoteRequest so that they show up for 
getAttributeNames.
  
  Fix for bug #13658
  Reported By: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.12  +11 -5 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CoyoteAdapter.java2 Oct 2002 05:29:53 -   1.11
  +++ CoyoteAdapter.java20 Oct 2002 22:48:49 -  1.12
  @@ -306,7 +306,13 @@
   parseCookies(req, request);
   
   // Set the SSL properties
  - res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,request.getRequest());
  + if( request.isSecure() ) {
  + res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,request.getRequest());
  + //Set up for getAttributeNames
  + request.getAttribute(Globals.CERTIFICATES_ATTR);
  + request.getAttribute(Globals.CIPHER_SUITE_ATTR);
  + request.getAttribute(Globals.KEY_SIZE_ATTR);
  + }
   
   // Set the remote principal
   String principal = req.getRemoteUser().toString();
  
  
  
  1.27  +7 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- CoyoteRequest.java23 Sep 2002 00:12:26 -  1.26
  +++ CoyoteRequest.java20 Oct 2002 22:48:49 -  1.27
  @@ -790,8 +790,10 @@
   return(attr);
   
   attr =  coyoteRequest.getAttribute(name);
  -if(attr != null)
  +if(attr != null) {
  +attributes.put(name, attr);
   return attr;
  +}
   // XXX Should move to Globals
   if(Constants.SSL_CERTIFICATE_ATTR.equals(name)) {
   coyoteRequest.action(ActionCode.ACTION_REQ_SSL_CERTIFICATE, null);
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




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

2002-10-01 Thread billbarker

billbarker2002/10/01 22:29:53

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Decode the URI as a URI, not as a query-string.
  
  Fix for bug #13162
  
  Reported By: Mark Hampton [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.11  +5 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CoyoteAdapter.java29 Sep 2002 17:07:44 -  1.10
  +++ CoyoteAdapter.java2 Oct 2002 05:29:53 -   1.11
  @@ -273,7 +273,7 @@
   
   // URI decoding
   req.decodedURI().duplicate(req.requestURI());
  -req.getURLDecoder().convert(req.decodedURI(), true);
  +req.getURLDecoder().convert(req.decodedURI(), false);
   req.decodedURI().setEncoding(UTF-8);
   
   // Normalize decoded URI
  
  
  

--
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/tomcat4 CoyoteAdapter.java

2002-09-29 Thread nacho

nacho   2002/09/29 10:07:44

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Bug#12998 HTTPS gets changed to HTTP://servername:443
  Reported by marcus.kellermann at bentley.com
  
  The processor (HTTP11 or ajp13) should set the scheme and port prior
  to this point, in an ajp13 connection doesnt make sense to get the secure
  flag from the connector secure flag.
  
  Revision  ChangesPath
  1.10  +9 -14 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CoyoteAdapter.java9 Sep 2002 07:56:22 -   1.9
  +++ CoyoteAdapter.java29 Sep 2002 17:07:44 -  1.10
  @@ -246,19 +246,14 @@
   protected void postParseRequest(Request req, CoyoteRequest request,
   Response res, CoyoteResponse response)
   throws IOException {
  -
  -request.setSecure(connector.getSecure());
  -req.scheme().setString(connector.getScheme());
  +// XXX the processor needs to set a correct scheme and port prior to this 
point, 
  +// in ajp13 protocols dont make sense to get the port from the connector..
  +request.setSecure(req.scheme().equals(https));
   
   request.setAuthorization
   (req.getHeader(Constants.AUTHORIZATION_HEADER));
  -
  -// Replace the default port if we are in secure mode
  -if (req.getServerPort() == 80 
  - connector.getScheme().equals(https)) {
  -req.setServerPort(443);
  -}
  -
  +// FIXME: the code below doesnt belongs to here, this is only  have sense 
  +// in Http11, not in ajp13..
   // At this point the Host header has been processed.
   // Override if the proxyPort/proxyHost are set 
   String proxyName = connector.getProxyName();
  
  
  

--
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/tomcat4 CoyoteAdapter.java

2002-09-29 Thread Ignacio J. Ortega

 De: Remy Maucherat [mailto:[EMAIL PROTECTED]]
 Enviado el: 29 de septiembre de 2002 19:32
 
 -1 for this unless you explain. The idea was to redirect to 
 the default 
 port for the protocol. Bill can probably give additional information 
 (ignore the -1 if he agrees with the change).
 

Ok, no problem, i feel this code like a swarm :)), but i think that in
any case to get the secure flag from the connector is a nonsense in
ajp13, in addition the flag is never setted in the connector so i doubt
redirections in SSL had worked anytime before with HTTP11, i reviewed
the code at the HTTP1Processor and it sets the scheme and port prior to
that point, just like ajp13 does, so shouldnt have any problems.. But
who knows, waiting for Bill..


Saludos ,
Ignacio J. Ortega


--
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/tomcat4 CoyoteAdapter.java

2002-09-29 Thread Remy Maucherat

Ignacio J. Ortega wrote:
De: Remy Maucherat [mailto:[EMAIL PROTECTED]]
Enviado el: 29 de septiembre de 2002 19:32

-1 for this unless you explain. The idea was to redirect to 
the default 
port for the protocol. Bill can probably give additional information 
(ignore the -1 if he agrees with the change).

 
 
 Ok, no problem, i feel this code like a swarm :)), but i think that in
 any case to get the secure flag from the connector is a nonsense in
 ajp13, in addition the flag is never setted in the connector so i doubt
 redirections in SSL had worked anytime before with HTTP11, i reviewed
 the code at the HTTP1Processor and it sets the scheme and port prior to
 that point, just like ajp13 does, so shouldnt have any problems.. But
 who knows, waiting for Bill..

Well, that particular part of the code was very tricky to get right, so 
the change is dangerous by itself. I don't have time to look much into 
it (I'll be away for 3 days; someone please handle bugzilla during that 
time ;-)).

I think we should implement proxyPort and proxyHost if it doesn't work. 
That's supposed to be there, and would solve the problem I think, so 
it's better than trying to change working code.

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/tomcat4 CoyoteAdapter.java

2002-09-29 Thread Bill Barker


- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Sunday, September 29, 2002 10:31 AM
Subject: Re: cvs commit:
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4
CoyoteAdapter.java


 [EMAIL PROTECTED] wrote:
  nacho   2002/09/29 10:07:44
 
Modified:coyote/src/java/org/apache/coyote/tomcat4
CoyoteAdapter.java
Log:
Bug#12998 HTTPS gets changed to HTTP://servername:443
Reported by marcus.kellermann at bentley.com
 
The processor (HTTP11 or ajp13) should set the scheme and port prior
to this point, in an ajp13 connection doesnt make sense to get the
secure
flag from the connector secure flag.
 

 -1 for this unless you explain. The idea was to redirect to the default
 port for the protocol. Bill can probably give additional information
 (ignore the -1 if he agrees with the change).


Sorry, I've been out all day.

At the moment, for the HTTP11 connector, the Processor sets the ServerPort
and the Scheme correctly (even for the Servlet 2.4 spec :).  Nacho's patch
shouldn't break anything.  IMHO, low-level things like ServerPort and Scheme
belong in the Processor, and not in the Adapter.

I'll give my +1 to Nacho's patch.

 Remy


 --
 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/tomcat4 CoyoteAdapter.java

2002-06-20 Thread costin

costin  2002/06/20 11:53:44

  Modified:coyote/src/java/org/apache/coyote ActionCode.java
   coyote/src/java/org/apache/coyote/tomcat3
CoyoteInterceptor2.java
   coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  Added a new ActionCode, to be called after the request.
  
  Added the calls to the POST_REQUEST action code.
  
  It can be used for cleanup and logging ( and timings )
  
  This is called _before_ the request is recycled, so both req and res
  should be valid ( and you can get the uri and lengths )
  
  Revision  ChangesPath
  1.8   +8 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java
  
  Index: ActionCode.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ActionCode.java   17 May 2002 19:49:03 -  1.7
  +++ ActionCode.java   20 Jun 2002 18:53:44 -  1.8
  @@ -79,7 +79,8 @@
   public static final ActionCode ACTION_COMMIT = new ActionCode();
   
   
  -/* A flush() operation originated by the client
  +/* A flush() operation originated by the client ( i.e. a flush() on
  +   the servlet output stream or writer, called by a servlet ).
*/
   public static final ActionCode ACTION_CLIENT_FLUSH = new ActionCode();
   
  @@ -97,6 +98,12 @@
   
   
   public static final ActionCode ACTION_WEBAPP = new ActionCode();
  +
  +/** Hook called after request, but before recycling. Can be used
  +for logging, to update counters, custom cleanup - the request
  +is still visible
  +*/
  +public static final ActionCode ACTION_POST_REQUEST = new ActionCode();
   
   /**
* Callback for lazy evaluation - extract the remote host address.
  
  
  
  1.12  +13 -0 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/CoyoteInterceptor2.java
  
  Index: CoyoteInterceptor2.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/CoyoteInterceptor2.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CoyoteInterceptor2.java   1 Jun 2002 05:14:02 -   1.11
  +++ CoyoteInterceptor2.java   20 Jun 2002 18:53:44 -  1.12
  @@ -205,6 +205,19 @@
return 0;
   }
   
  +public int postRequest(org.apache.tomcat.core.Request request,
  +   org.apache.tomcat.core.Response response) {
  + if(request instanceof Tomcat3Request) {
  + try {
  +Tomcat3Request httpReq=(Tomcat3Request)request;
  +org.apache.coyote.Request cReq = httpReq.getCoyoteRequest();
  +cReq.action( ActionCode.ACTION_POST_REQUEST , null);
  + } catch(Exception ex) {
  + log(Can't send ACK, ex);
  + }
  + }
  +return 0;
  +}
   
   /**
  getInfo calls for SSL data
  
  
  
  1.8   +6 -4  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CoyoteAdapter.java28 May 2002 14:24:31 -  1.7
  +++ CoyoteAdapter.java20 Jun 2002 18:53:44 -  1.8
  @@ -222,6 +222,8 @@
   // Calling the container
   connector.getContainer().invoke(request, response);
   response.finishResponse();
  +
  +req.action( ActionCode.ACTION_POST_REQUEST , null);
   } catch (IOException e) {
   ;
   } catch (Throwable t) {
  
  
  

--
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/tomcat4 CoyoteAdapter.java CoyoteConnector.java CoyoteRequest.java CoyoteServerSocketFactory.java

2002-05-28 Thread ekr

ekr 02/05/28 07:24:32

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector.java CoyoteRequest.java
CoyoteServerSocketFactory.java
  Log:
  CoyoteConnector.java: pass through the configuration directives that PureTLS
  needs.
  CoyoteServerSocket: more passthrough for the configuration directives PureTLS
  needs
  CoyoteAdapter.java: call the action to set the SSL attributes
  CoyoteRequest.java: get attributes from the coyoteRequest if they're not
  available locally. The coyoteRequest is where the SSL attributes all get set.
  
  Revision  ChangesPath
  1.7   +7 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CoyoteAdapter.java18 Apr 2002 18:12:46 -  1.6
  +++ CoyoteAdapter.java28 May 2002 14:24:31 -  1.7
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.6 2002/04/18 18:12:46 remm Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/04/18 18:12:46 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.7 2002/05/28 14:24:31 ekr Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/05/28 14:24:31 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.6 $ $Date: 2002/04/18 18:12:46 $
  + * @version $Revision: 1.7 $ $Date: 2002/05/28 14:24:31 $
*/
   
   final class CoyoteAdapter
  @@ -307,7 +307,9 @@
   
   // Parse cookies
   parseCookies(req, request);
  -
  + 
  + // Set the SSL properties
  + res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,request.getRequest());
   }
   
   /**
  
  
  
  1.15  +9 -7  
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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CoyoteConnector.java  16 May 2002 18:57:39 -  1.14
  +++ CoyoteConnector.java  28 May 2002 14:24:31 -  1.15
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
 1.15 2002/05/28 14:24:31 ekr Exp $
  + * $Revision: 1.15 $
  + * $Date: 2002/05/28 14:24:31 $
*
* 
*
  @@ -112,7 +112,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.14 $ $Date: 2002/05/16 18:57:39 $
  + * @version $Revision: 1.15 $ $Date: 2002/05/28 14:24:31 $
*/
   
   
  @@ -979,6 +979,11 @@
   }
   IntrospectionUtils.setProperty(protocolHandler, keystore, 
  ssf.getKeystoreFile());
  +IntrospectionUtils.setProperty(protocolHandler, randomfile, 
  +   ssf.getRandomFile());
  +IntrospectionUtils.setProperty(protocolHandler, rootfile, 
  +   ssf.getRootFile());
  + 
   IntrospectionUtils.setProperty(protocolHandler, keypass, 
  ssf.getKeystorePass());
   IntrospectionUtils.setProperty(protocolHandler, keytype, 
  @@ -988,8 +993,6 @@
   IntrospectionUtils.setProperty(protocolHandler, 
  sSLImplementation, 
  ssf.getSSLImplementation());
  -IntrospectionUtils.setProperty(protocolHandler, socketFactory, 
  -   ssf.getSocketFactoryName());
   } else {
   IntrospectionUtils.setProperty(protocolHandler, secure, 
   + false);
  @@ -1002,7 +1005,6 @@
   (sm.getString
(coyoteConnector.protocolHandlerInitializationFailed, e));
   }
  -
   }
   
   
  
  
  
  1.23  +12 -6 

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

2002-04-18 Thread remm

remm02/04/18 02:12:52

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - Move the decodedURI field to the adapter. Although this is part of the protocol,
it is more a convinience feature used in TC 4.1.
  - Although I didn't test it, this should fix the mapping problems with JK2 (since
the decodedURI field was used for mapping, I can understand why it didn't
work too well if it was empty).
  
  Revision  ChangesPath
  1.5   +11 -4 
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CoyoteAdapter.java16 Apr 2002 21:59:36 -  1.4
  +++ CoyoteAdapter.java18 Apr 2002 09:12:52 -  1.5
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.4 2002/04/16 21:59:36 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/04/16 21:59:36 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.5 2002/04/18 09:12:52 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/04/18 09:12:52 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.4 $ $Date: 2002/04/16 21:59:36 $
  + * @version $Revision: 1.5 $ $Date: 2002/04/18 09:12:52 $
*/
   
   final class CoyoteAdapter
  @@ -277,12 +277,19 @@
   request.setServerName(req.serverName().toString());
   }
   
  +// URI decoding
  +req.decodedURI().duplicate(req.requestURI());
  +req.getURLDecoder().convert(req.decodedURI(), true);
  +req.decodedURI().setEncoding(UTF-8);
  +
  +// Normalize decoded URI
   if (!normalize(req.decodedURI())) {
   res.setStatus(400);
   res.setMessage(Invalid URI);
   throw new IOException(Invalid URI);
   }
   
  +// Parse session Id
   parseSessionId(req, request);
   
   // Additional URI normalization and validation is needed for security 
  
  
  

--
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/tomcat4 CoyoteAdapter.java CoyoteConnector.java CoyoteRequest.java LocalStrings.properties

2002-04-18 Thread remm

remm02/04/18 11:12:47

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector.java CoyoteRequest.java
LocalStrings.properties
  Log:
  - Spring cleaning of the message strings used by the Coyote adapter for
Tomcat 4.
  
  Revision  ChangesPath
  1.6   +15 -14
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CoyoteAdapter.java18 Apr 2002 09:12:52 -  1.5
  +++ CoyoteAdapter.java18 Apr 2002 18:12:46 -  1.6
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.5 2002/04/18 09:12:52 remm Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/04/18 09:12:52 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.6 2002/04/18 18:12:46 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/04/18 18:12:46 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.5 $ $Date: 2002/04/18 09:12:52 $
  + * @version $Revision: 1.6 $ $Date: 2002/04/18 18:12:46 $
*/
   
   final class CoyoteAdapter
  @@ -225,7 +225,7 @@
   } catch (IOException e) {
   ;
   } catch (Throwable t) {
  -log(sm.getString(coyoteProcessor.service), t);
  +log(sm.getString(coyoteAdapter.service), t);
   } finally {
   // Recycle the wrapper request and response
   request.recycle();
  @@ -251,25 +251,22 @@
   request.setAuthorization
   (req.getHeader(Constants.AUTHORIZATION_HEADER));
   
  -// At this point the Host header has been processed.
  -// Override if the proxyPort/proxyHost are set 
  -
   // Replace the default port if we are in secure mode
   if (req.getServerPort() == 80 
connector.getScheme().equals(https)) {
   req.setServerPort(443);
   }
   
  +// At this point the Host header has been processed.
  +// Override if the proxyPort/proxyHost are set 
   String proxyName = connector.getProxyName();
   int proxyPort = connector.getProxyPort();
  -
   if (proxyPort != 0) {
   request.setServerPort(proxyPort);
  -req.setServerPort( proxyPort );
  +req.setServerPort(proxyPort);
   } else {
   request.setServerPort(req.getServerPort());
   }
  -
   if (proxyName != null) {
   request.setServerName(proxyName);
   req.serverName().setString(proxyName);
  @@ -308,6 +305,7 @@
   }
   }
   
  +// Parse cookies
   parseCookies(req, request);
   
   }
  @@ -404,6 +402,7 @@
* are resolved out.  If the specified path attempts to go outside the
* boundaries of the current context (i.e. too many .. path elements
* are present), return codenull/code instead.
  + * This code is not optimized, and is only needed for Tomcat 4.0.x.
*
* @param path Path to be validated
*/
  @@ -485,9 +484,11 @@
   /**
* Normalize URI.
* p
  - * This method normalizes '/./' and '/../'.
  + * This method normalizes \, //, /./ and /../. This method will
  + * return false when trying to go above the root, or if the URI contains
  + * a null byte.
* 
  - * @param uri URI to be normalized
  + * @param uriMB URI to be normalized
*/
   public static boolean normalize(MessageBytes uriMB) {
   
  @@ -518,7 +519,7 @@
   
   // If the URI ends with /. or /.., then we append an extra /
   // Note: It is possible to extend the URI by 1 without any side effect
  -// as the next character in a non-significant WS.
  +// as the next character is a non-significant WS.
   if (((end - start)  2)  (b[end - 1] == (byte) '.')) {
   if ((b[end - 2] == (byte) '/') 
   || ((b[end - 2] == (byte) '.') 
  
  
  
  1.10  +7 -7  
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- 

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

2002-04-16 Thread remm

remm02/04/16 14:59:36

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
  Log:
  - Return 400 if there is a null byte in the decoded URI.
  
  Revision  ChangesPath
  1.4   +7 -4  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CoyoteAdapter.java9 Apr 2002 22:27:11 -   1.3
  +++ CoyoteAdapter.java16 Apr 2002 21:59:36 -  1.4
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.3 2002/04/09 22:27:11 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/04/09 22:27:11 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.4 2002/04/16 21:59:36 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/04/16 21:59:36 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2002/04/09 22:27:11 $
  + * @version $Revision: 1.4 $ $Date: 2002/04/16 21:59:36 $
*/
   
   final class CoyoteAdapter
  @@ -493,9 +493,12 @@
   int index = 0;
   
   // Replace '\' with '/'
  +// Check for null byte
   for (pos = start; pos  end; pos++) {
   if (b[pos] == (byte) '\\')
   b[pos] = (byte) '/';
  +if (b[pos] == (byte) 0)
  +return false;
   }
   
   // Replace // with /
  
  
  

--
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/tomcat4 CoyoteAdapter.java CoyoteConnector2.java

2002-04-06 Thread remm

remm02/04/06 04:24:05

  Added:   coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector2.java
  Log:
  - Add draft of the connector based on the protocol handler.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  /* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.1 2002/04/06 12:24:05 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2002/04/06 12:24:05 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  
  package org.apache.coyote.tomcat4;
  
  
  import java.io.BufferedInputStream;
  import java.io.EOFException;
  import java.io.InterruptedIOException;
  import java.io.InputStream;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.net.InetAddress;
  import java.net.Socket;
  import java.util.ArrayList;
  import java.util.Enumeration;
  import java.util.Iterator;
  import java.util.Locale;
  import java.util.StringTokenizer;
  import java.util.TreeMap;
  import javax.servlet.ServletException;
  import javax.servlet.http.Cookie;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.tomcat.util.buf.ByteChunk;
  import org.apache.tomcat.util.buf.HexUtils;
  import org.apache.tomcat.util.buf.MessageBytes;
  import org.apache.tomcat.util.http.Cookies;
  import org.apache.tomcat.util.http.ServerCookie;
  
  import org.apache.coyote.ActionCode;
  import org.apache.coyote.ActionHook;
  import org.apache.coyote.Adapter;
  import org.apache.coyote.InputBuffer;
  import org.apache.coyote.OutputBuffer;
  import org.apache.coyote.Request;
  import org.apache.coyote.Response;
  
  import org.apache.catalina.Connector;
  import org.apache.catalina.Container;
  import org.apache.catalina.Globals;
  import org.apache.catalina.HttpRequest;
  import org.apache.catalina.HttpResponse;
  import org.apache.catalina.Lifecycle;
  import org.apache.catalina.LifecycleEvent;
  import 

cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java CoyoteConnector2.java

2002-04-06 Thread remm

remm02/04/06 08:53:04

  Modified:coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
CoyoteConnector2.java
  Log:
  - Set the port attribute.
  - Use the same note index as the TC 3 adapter to store the Catalina request/response.
  
  Revision  ChangesPath
  1.2   +5 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoyoteAdapter.java6 Apr 2002 12:24:05 -   1.1
  +++ CoyoteAdapter.java6 Apr 2002 16:53:04 -   1.2
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.1 2002/04/06 12:24:05 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/04/06 12:24:05 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
 1.2 2002/04/06 16:53:04 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/06 16:53:04 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.1 $ $Date: 2002/04/06 12:24:05 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/06 16:53:04 $
*/
   
   final class CoyoteAdapter
  @@ -129,7 +129,7 @@
   // -- Constants
   
   
  -public static final int ADAPTER_NOTES = 0;
  +public static final int ADAPTER_NOTES = 1;
   
   
   // --- Constructors
  
  
  
  1.2   +6 -5  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java
  
  Index: CoyoteConnector2.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoyoteConnector2.java 6 Apr 2002 12:24:05 -   1.1
  +++ CoyoteConnector2.java 6 Apr 2002 16:53:04 -   1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
 1.1 2002/04/06 12:24:05 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/04/06 12:24:05 $
  + * $Header: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
 1.2 2002/04/06 16:53:04 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/06 16:53:04 $
*
* 
*
  @@ -110,7 +110,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.1 $ $Date: 2002/04/06 12:24:05 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/06 16:53:04 $
*/
   
   
  @@ -936,6 +936,7 @@
   Class clazz = Class.forName(protocolHandlerClassName);
   protocolHandler = (ProtocolHandler) clazz.newInstance();
   } catch (Exception e) {
  +e.printStackTrace();
   throw new LifecycleException
   (sm.getString
(coyoteProcessor.processorInstantiationFailed, e));
  @@ -943,7 +944,7 @@
   protocolHandler.setAdapter(adapter);
   
   // Set attributes
  -
  +protocolHandler.setAttribute(port,  + port);
   
   try {
   protocolHandler.init();
  
  
  

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