cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread remm
remm2004/05/14 04:00:25

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Major mistake: the sever cookies should be parsed after the context is mapped,
otherwise, the session cookie is never considered valid, and it will use the last
one.
  - Bug 28971. So we're going to have a hotfix ...
  
  Revision  ChangesPath
  1.26  +12 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- CoyoteAdapter.java28 Apr 2004 22:05:10 -  1.25
  +++ CoyoteAdapter.java14 May 2004 11:00:25 -  1.26
  @@ -295,6 +295,9 @@
   return false;
   }
   
  +// Parse session Id
  +parseSessionCookiesId(req, request);
  +
   return true;
   }
   
  @@ -352,6 +355,14 @@
   request.setRequestedSessionId(null);
   request.setRequestedSessionURL(false);
   }
  +
  +}
  +
  +
  +/**
  + * Parse session id in URL.
  + */
  +protected void parseSessionCookiesId(Request req, CoyoteRequest request) {
   
   // Parse session id from cookies
   Cookies serverCookies = req.getCookies();
  
  
  

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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
remm2004/05/14 04:00:25

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Major mistake: the sever cookies should be parsed after the context is mapped,
otherwise, the session cookie is never considered valid, and it will use the last
one.
  - Bug 28971. So we're going to have a hotfix ...
Two possibilities:
- 5.0.25 (cool, I thought we had avoided it ;) )
- A hotfix for 5.0.24 (I'll put and sign a .zip and a .tgz, sign them, 
and link them from the news and binaries pages)

Rémy

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Mario Ivankovits
Remy Maucherat wrote:

Two possibilities:
- 5.0.25 (cool, I thought we had avoided it ;) )
- A hotfix for 5.0.24 (I'll put and sign a .zip and a .tgz, sign them, 
and link them from the news and binaries pages)
I know i have no rights to +1 here (i am not an tomcat committer),
but from the sight of an developeradministrator of some tomcat 
instances i definitley would be happy with the hotfix - small to 
download, easy to drop into the tomcat installation.
The 5.0.25 might come soon enough.

However, even if others vote for a new release, it would be nice if you 
could provide the hotfix for download too.

-- Mario

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Jeanfrancois Arcand


Remy Maucherat wrote:

[EMAIL PROTECTED] wrote:

remm2004/05/14 04:00:25

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Major mistake: the sever cookies should be parsed after the 
context is mapped,
otherwise, the session cookie is never considered valid, and it 
will use the last
one.
  - Bug 28971. So we're going to have a hotfix ...


Two possibilities:
- 5.0.25 (cool, I thought we had avoided it ;) )
- A hotfix for 5.0.24 (I'll put and sign a .zip and a .tgz, sign them, 
and link them from the news and binaries pages)
+1 for the hotfix (seems less work and the fastest way)

-- Jeanfrancois

Rémy

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



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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Filip Hanik - Dev
- 5.0.25
+1

- A hotfix for 5.0.24
Big -1

Filip

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, May 14, 2004 6:32 AM
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java


[EMAIL PROTECTED] wrote:
 remm2004/05/14 04:00:25

   Modified:catalina/src/share/org/apache/coyote/tomcat5
 CoyoteAdapter.java
   Log:
   - Major mistake: the sever cookies should be parsed after the context is mapped,
 otherwise, the session cookie is never considered valid, and it will use the last
 one.
   - Bug 28971. So we're going to have a hotfix ...

Two possibilities:
- 5.0.25 (cool, I thought we had avoided it ;) )
- A hotfix for 5.0.24 (I'll put and sign a .zip and a .tgz, sign them,
and link them from the news and binaries pages)

Rémy


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


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Filip Hanik - Dev
I guess I should explain, since a bunch of user already downloaded
5.0.24, it is not a good idea to release a fix with the same version number.
Makes it a lot harder to help people out on the user list

Filip

- Original Message -
From: Filip Hanik - Dev [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, May 14, 2004 9:14 AM
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java


- 5.0.25
+1

- A hotfix for 5.0.24
Big -1

Filip

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, May 14, 2004 6:32 AM
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java


[EMAIL PROTECTED] wrote:
 remm2004/05/14 04:00:25

   Modified:catalina/src/share/org/apache/coyote/tomcat5
 CoyoteAdapter.java
   Log:
   - Major mistake: the sever cookies should be parsed after the context is mapped,
 otherwise, the session cookie is never considered valid, and it will use the last
 one.
   - Bug 28971. So we're going to have a hotfix ...

Two possibilities:
- 5.0.25 (cool, I thought we had avoided it ;) )
- A hotfix for 5.0.24 (I'll put and sign a .zip and a .tgz, sign them,
and link them from the news and binaries pages)

Rémy


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


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


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Remy Maucherat
Filip Hanik - Dev wrote:
- 5.0.25
+1

- A hotfix for 5.0.24
Big -1
You seem to be alone, so ... Sorry :/

Rémy

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Filip Hanik - Dev
since when could a -1 be shut down by one person, you
so far you only have one +1 (Jeanfrancois)

Filip

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, May 14, 2004 9:22 AM
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java


Filip Hanik - Dev wrote:
- 5.0.25

 +1

- A hotfix for 5.0.24

 Big -1

You seem to be alone, so ... Sorry :/

Rémy


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


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Remy Maucherat
Filip Hanik - Dev wrote:

since when could a -1 be shut down by one person, you
so far you only have one +1 (Jeanfrancois)
This is a release, not a vote with a veto. I have 3 yes (Yoav - look in 
tc-user: he fully agrees with this, JF, me), and 1 no (you), so it's 
enough to put out a package.

Anyway, I don't think you can prevent the release of such a patch since 
it will be useful for people. I understand the point of trying to 
encourage releasing a new build very soon, but I don't see the point of 
forcing people to d/l and install a big bundle again just for a simple fix.

Rémy

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Filip Hanik - Dev
roger that, didn't see the votes in tc-user, didn't even know we were voting in that 
forum :)

Filip

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, May 14, 2004 9:41 AM
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java


Filip Hanik - Dev wrote:

 since when could a -1 be shut down by one person, you
 so far you only have one +1 (Jeanfrancois)

This is a release, not a vote with a veto. I have 3 yes (Yoav - look in
tc-user: he fully agrees with this, JF, me), and 1 no (you), so it's
enough to put out a package.

Anyway, I don't think you can prevent the release of such a patch since
it will be useful for people. I understand the point of trying to
encourage releasing a new build very soon, but I don't see the point of
forcing people to d/l and install a big bundle again just for a simple fix.

Rémy


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


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-05-14 Thread Remy Maucherat
Filip Hanik - Dev wrote:
roger that, didn't see the votes in tc-user, didn't even know we were
voting in that forum :)
It of course doesn't officially count (only tc-dev posts are official), 
but it seems Yoav thinks the patch will help people.

And anytime he feels ready, he can do a new 5.0.25 build.

Rémy

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


cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-04-28 Thread remm
remm2004/04/28 15:05:10

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Fix normalization where the URI is /. (this would have sent a redirect).
  
  Revision  ChangesPath
  1.25  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- CoyoteAdapter.java26 Apr 2004 15:31:09 -  1.24
  +++ CoyoteAdapter.java28 Apr 2004 22:05:10 -  1.25
  @@ -486,7 +486,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 is a non-significant WS.
  -if (((end - start)  2)  (b[end - 1] == (byte) '.')) {
  +if (((end - start) = 2)  (b[end - 1] == (byte) '.')) {
   if ((b[end - 2] == (byte) '/') 
   || ((b[end - 2] == (byte) '.') 
(b[end - 3] == (byte) '/'))) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-04-26 Thread remm
remm2004/04/26 08:31:09

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Some tweaking for use with the Java in-process protocol handler (at last someone
was inetersted in the feature :) ).
  - Since this is in-process, forcing to pass the URI as a byte array is stupid, since 
the
conversion is fairly expensive, and more importantly, it would add a lot of 
complexity
to the client code.
  
  Revision  ChangesPath
  1.24  +23 -16
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- CoyoteAdapter.java14 Apr 2004 22:20:47 -  1.23
  +++ CoyoteAdapter.java26 Apr 2004 15:31:09 -  1.24
  @@ -225,19 +225,29 @@
   // URI decoding
   MessageBytes decodedURI = req.decodedURI();
   decodedURI.duplicate(req.requestURI());
  -try {
  -  req.getURLDecoder().convert(decodedURI, false);
  -} catch (IOException ioe) {
  -  res.setStatus(400);
  -  res.setMessage(Invalid URI);
  -  throw ioe;
  -}
   
  -// Normalize decoded URI
  -if (!normalize(req.decodedURI())) {
  -res.setStatus(400);
  -res.setMessage(Invalid URI);
  -return false;
  +if (decodedURI.getType() == MessageBytes.T_BYTES) {
  +// %xx decoding of the URL
  +try {
  +req.getURLDecoder().convert(decodedURI, false);
  +} catch (IOException ioe) {
  +res.setStatus(400);
  +res.setMessage(Invalid URI);
  +throw ioe;
  +}
  +// Normalization
  +if (!normalize(req.decodedURI())) {
  +res.setStatus(400);
  +res.setMessage(Invalid URI);
  +return false;
  +}
  +// Character decoding
  +convertURI(decodedURI, request);
  +} else {
  +// The URL is chars or String, and has been sent using an in-memory
  +// protocol handler, we have to assume the URL has been properly
  +// decoded already
  +decodedURI.toChars();
   }
   
   // Set the remote principal
  @@ -251,9 +261,6 @@
   if (authtype != null) {
   request.setAuthType(authtype);
   }
  -
  -// URI character decoding
  -convertURI(decodedURI, request);
   
   // Parse session Id
   parseSessionId(req, request);
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteRequest.java

2004-04-14 Thread remm
remm2004/04/14 15:20:47

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteRequest.java
  Log:
  - Optimization: delay parsing of the cookies. Since most request will contain a 
session
cookie, and a lot of servlets won't call getCookies, it is useful to save some 
object
allocations.
  - This seem to work for me (sessions still work, and the cookies example works as 
well),
but this is regression friendly.
  
  Revision  ChangesPath
  1.23  +2 -35 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CoyoteAdapter.java6 Apr 2004 00:55:07 -   1.22
  +++ CoyoteAdapter.java14 Apr 2004 22:20:47 -  1.23
  @@ -288,8 +288,6 @@
   return false;
   }
   
  -// Parse cookies
  -parseCookies(req, request);
   return true;
   }
   
  @@ -348,22 +346,12 @@
   request.setRequestedSessionURL(false);
   }
   
  -}
  -
  -
  -/**
  - * Parse cookies.
  - */
  -protected void parseCookies(Request req, CoyoteRequest request) {
  -
  +// Parse session id from cookies
   Cookies serverCookies = req.getCookies();
   int count = serverCookies.getCookieCount();
   if (count = 0)
   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)) {
  @@ -386,28 +374,7 @@
   }
   }
   }
  -try {
  -Cookie cookie = new Cookie(scookie.getName().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(IllegalArgumentException e) {
  -log.info(Bad Cookie: Name:  + scookie.getName() 
  - +  Value:  + scookie.getValue());
  -}
   }
  -if( idx  count ) {
  -Cookie [] ncookies = new Cookie[idx];
  -System.arraycopy(cookies, 0, ncookies, 0, idx);
  -cookies = ncookies;
  -}
  -
  -request.setCookies(cookies);
   
   }
   
  
  
  
  1.35  +53 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- CoyoteRequest.java14 Apr 2004 00:14:22 -  1.34
  +++ CoyoteRequest.java14 Apr 2004 22:20:47 -  1.35
  @@ -50,8 +50,10 @@
   
   import org.apache.tomcat.util.buf.B2CConverter;
   import org.apache.tomcat.util.buf.MessageBytes;
  +import org.apache.tomcat.util.http.Cookies;
   import org.apache.tomcat.util.http.FastHttpDateFormat;
   import org.apache.tomcat.util.http.Parameters;
  +import org.apache.tomcat.util.http.ServerCookie;
   import org.apache.tomcat.util.http.mapper.MappingData;
   
   import org.apache.coyote.ActionCode;
  @@ -246,6 +248,12 @@
   
   
   /**
  + * Cookies parsed flag.
  + */
  +protected boolean cookiesParsed = false;
  +
  +
  +/**
* Secure flag.
*/
   protected boolean secure = false;
  @@ -378,6 +386,7 @@
   subject = null;
   sessionParsed = false;
   requestParametersParsed = false;
  +cookiesParsed = false;
   locales.clear();
   localesParsed = false;
   secure = false;
  @@ -1835,6 +1844,9 @@
*/
   public Cookie[] getCookies() {
   
  +if (!cookiesParsed)
  +parseCookies();
  +
   return cookies;
   
   }
  @@ -2296,6 +2308,46 @@
   if (isSecure()) {
   cookie.setSecure(true);
   }
  +}
  +
  +/**
  + * Parse cookies.
  + */
  +protected void parseCookies() {
  +
  +cookiesParsed = true;
  +
  +Cookies serverCookies = coyoteRequest.getCookies();
  +

Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteOutputStream.java CoyoteReader.java CoyoteRequest.java CoyoteWriter.java

2004-04-06 Thread Remy Maucherat
Bill Barker wrote:
I'm -0 on this.  The classes modified are all internal to the Tomcat 5.x
CoyoteConnector, so there is no good reason to make them public.
The way that Coyote is designed, this should always be unnecessary.  The way
to build a new connector is to define a new ProtocolHandler that deals with
the transport.
I agree, but right now the access declarations were inconsistent. I know 
Jean-François used this for pretty advanced embedding, so being able to 
extend doesn't hurt.

Rémy

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteOutputStream.java CoyoteReader.java CoyoteRequest.java CoyoteWriter.java

2004-04-06 Thread Jeanfrancois Arcand


Remy Maucherat wrote:

Bill Barker wrote:

I'm -0 on this.  The classes modified are all internal to the Tomcat 5.x
CoyoteConnector, so there is no good reason to make them public.
The way that Coyote is designed, this should always be unnecessary.  
The way
to build a new connector is to define a new ProtocolHandler that 
deals with
the transport.


I agree, but right now the access declarations were inconsistent. I 
know Jean-François used this for pretty advanced embedding, so being 
able to extend doesn't hurt.
Exactly. I agree re-writting a Protocolhandler was the solution (and I 
did it), but I was still looking to extends CoyoteAdapter. As an 
example, if cookie are already parsed by the NSAPI, I don't want to call 
CoyoteAdapter.parseSessionId(..), but I still want to re-use the 
remaining of the class.

-- Jeanfrancois


Rémy

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



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


cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteOutputStream.java CoyoteReader.java CoyoteRequest.java CoyoteWriter.java

2004-04-05 Thread jfarcand
jfarcand2004/04/05 17:55:07

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteOutputStream.java
CoyoteReader.java CoyoteRequest.java
CoyoteWriter.java
  Log:
  Add public method consistently. Currently some methods were private, some final
  and some public.
  
  Making such classes public allowed re-utilization of those classes as a base for new 
connector( ex: NSAPI)
  
  Revision  ChangesPath
  1.22  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CoyoteAdapter.java4 Apr 2004 19:10:01 -   1.21
  +++ CoyoteAdapter.java6 Apr 2004 00:55:07 -   1.22
  @@ -49,7 +49,7 @@
* @version $Revision$ $Date$
*/
   
  -final class CoyoteAdapter
  +public class CoyoteAdapter
   implements Adapter 
{
   private static Log log = LogFactory.getLog(CoyoteAdapter.class);
  
  
  
  1.4   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteOutputStream.java
  
  Index: CoyoteOutputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteOutputStream.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CoyoteOutputStream.java   27 Feb 2004 14:58:52 -  1.3
  +++ CoyoteOutputStream.java   6 Apr 2004 00:55:07 -   1.4
  @@ -27,7 +27,7 @@
* @author Costin Manolache
* @author Remy Maucherat
*/
  -final class CoyoteOutputStream 
  +public class CoyoteOutputStream 
   extends ServletOutputStream {
   
   
  
  
  
  1.4   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteReader.java
  
  Index: CoyoteReader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteReader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CoyoteReader.java 5 Mar 2004 13:02:30 -   1.3
  +++ CoyoteReader.java 6 Apr 2004 00:55:07 -   1.4
  @@ -26,7 +26,7 @@
* 
* @author Remy Maucherat
*/
  -final class CoyoteReader
  +public class CoyoteReader
   extends BufferedReader {
   
   
  
  
  
  1.33  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- CoyoteRequest.java12 Mar 2004 19:45:43 -  1.32
  +++ CoyoteRequest.java6 Apr 2004 00:55:07 -   1.33
  @@ -254,7 +254,7 @@
   /**
* The Subject associated with the current AccessControllerContext
*/
  -protected Subject subject = null;
  +protected transient Subject subject = null;
   
   
   /**
  
  
  
  1.4   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteWriter.java
  
  Index: CoyoteWriter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CoyoteWriter.java 27 Feb 2004 14:58:53 -  1.3
  +++ CoyoteWriter.java 6 Apr 2004 00:55:07 -   1.4
  @@ -25,7 +25,7 @@
* 
* @author Remy Maucherat
*/
  -final class CoyoteWriter
  +public class CoyoteWriter
   extends PrintWriter {
   
   
  
  
  

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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteOutputStream.java CoyoteReader.java CoyoteRequest.java CoyoteWriter.java

2004-04-05 Thread Bill Barker

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 05, 2004 5:55 PM
Subject: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteOutputStream.java CoyoteReader.java
CoyoteRequest.java CoyoteWriter.java


 jfarcand2004/04/05 17:55:07

   Modified:catalina/src/share/org/apache/coyote/tomcat5
 CoyoteAdapter.java CoyoteOutputStream.java
 CoyoteReader.java CoyoteRequest.java
 CoyoteWriter.java
   Log:
   Add public method consistently. Currently some methods were private,
some final
   and some public.

I'm -0 on this.  The classes modified are all internal to the Tomcat 5.x
CoyoteConnector, so there is no good reason to make them public.


   Making such classes public allowed re-utilization of those classes as a
base for new connector( ex: NSAPI)


The way that Coyote is designed, this should always be unnecessary.  The way
to build a new connector is to define a new ProtocolHandler that deals with
the transport.


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

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

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

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-04-04 Thread markt
markt   2004/04/04 12:10:01

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Fix bug 16157. Set AuthType on HttpServletRequest.
  - Second part of patch.
  - Patch submitted by Kan Ogawa.
  
  Revision  ChangesPath
  1.21  +7 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- CoyoteAdapter.java18 Mar 2004 23:51:47 -  1.20
  +++ CoyoteAdapter.java4 Apr 2004 19:10:01 -   1.21
  @@ -246,6 +246,12 @@
   request.setUserPrincipal(new CoyotePrincipal(principal));
   }
   
  +// Set the authorization type
  +String authtype = req.getAuthType().toString();
  +if (authtype != null) {
  +request.setAuthType(authtype);
  +}
  +
   // URI character decoding
   convertURI(decodedURI, request);
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-03-18 Thread luehe
luehe   2004/03/18 15:51:48

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  Include session cookies in HttpServletRequest.getCookies().
  
  Excluding them has caused a regression, and seems to be in conflict
  with the javadocs:
  
   * Returns an array containing all of the codeCookie/code
   * objects the client sent with this request.
  
  *All* includes session cookies as well, even though including session
  cookies may not be very useful and is inconsistent with how a session
  id path parameter is not exposed to a webapp. Will need to be
  addressed by Servlet.next.
  
  Revision  ChangesPath
  1.20  +1 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CoyoteAdapter.java10 Mar 2004 00:00:23 -  1.19
  +++ CoyoteAdapter.java18 Mar 2004 23:51:47 -  1.20
  @@ -379,7 +379,6 @@
   (scookie.getValue().toString());
   }
   }
  -continue;
   }
   try {
   Cookie cookie = new Cookie(scookie.getName().toString(),
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2004-03-09 Thread remm
remm2004/03/09 16:00:23

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Much less verbose logging when there's a bad cookie. Unexpected exceptions
will be handled by service.
  
  Revision  ChangesPath
  1.19  +4 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- CoyoteAdapter.java27 Feb 2004 14:58:52 -  1.18
  +++ CoyoteAdapter.java10 Mar 2004 00:00:23 -  1.19
  @@ -391,9 +391,9 @@
   cookie.setDomain(scookie.getDomain().toString());
   }
   cookies[idx++] = cookie;
  -} catch(Exception ex) {
  -log.error(Bad Cookie Name:  + scookie.getName() + 
  - /Value:  + scookie.getValue(),ex);
  +} catch(IllegalArgumentException e) {
  +log.info(Bad Cookie: Name:  + scookie.getName() 
  + +  Value:  + scookie.getValue());
   }
   }
   if( idx  count ) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteConnector.java mbeans-descriptors.xml

2004-01-10 Thread remm
remm2004/01/10 12:39:50

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteConnector.java
mbeans-descriptors.xml
  Log:
  - Add an allowTrace flag on the connector. Trace is disabled by default.
  
  Revision  ChangesPath
  1.16  +12 -4 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CoyoteAdapter.java14 Dec 2003 22:13:12 -  1.15
  +++ CoyoteAdapter.java10 Jan 2004 20:39:50 -  1.16
  @@ -246,6 +246,14 @@
   request.setSecure(connector.getSecure());
   }
   
  +// Filter trace method
  +if (!connector.getAllowTrace() 
  + req.method().equalsIgnoreCase(TRACE)) {
  +res.setStatus(403);
  +res.setMessage(TRACE method is not allowed);
  +return false;
  +}
  +
   // FIXME: the code below doesnt belongs to here, 
   // this is only have sense 
   // in Http11, not in ajp13..
  
  
  
  1.35  +29 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- CoyoteConnector.java  10 Dec 2003 22:26:28 -  1.34
  +++ CoyoteConnector.java  10 Jan 2004 20:39:50 -  1.35
  @@ -134,6 +134,12 @@
   
   
   /**
  + * Do we allow TRACE ?
  + */
  +private boolean allowTrace = false;
  +
  +
  +/**
* The input buffer size we should create on input streams.
*/
   private int bufferSize = 2048;
  @@ -589,6 +595,28 @@
   
   }
   
  +
  +/**
  + * True if the TRACE method is allowed.  Default value is false.
  + */
  +public boolean getAllowTrace() {
  +
  +return (this.allowTrace);
  +
  +}
  +
  +
  +/**
  + * Set the allowTrace flag, to disable or enable the TRACE HTTP method.
  + *
  + * @param allowTrace The new allowTrace flag
  + */
  +public void setAllowTrace(boolean allowTrace) {
  +
  +this.allowTrace = allowTrace;
  +setProperty(allowTrace, String.valueOf(allowTrace));
  +
  +}
   
   /**
* Is this connector available for processing requests?
  
  
  
  1.12  +4 -0  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- mbeans-descriptors.xml12 Dec 2003 02:52:07 -  1.11
  +++ mbeans-descriptors.xml10 Jan 2004 20:39:50 -  1.12
  @@ -20,6 +20,10 @@
 description=The certificate encoding algorithm to be used
type=java.lang.String/
   
  +attribute   name=allowTrace
  +  description=Allow disabling TRACE method
  + type=boolean/
  +
   attribute   name=bufferSize
 description=The input buffer size we should create on input streams
type=int/
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-12-14 Thread remm
remm2003/12/14 14:13:12

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - When redirecting, append the query string if not null, to avoid losing query 
parameters.
  - Refactor to use the new postParseRequest processing.
  
  Revision  ChangesPath
  1.15  +25 -15
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CoyoteAdapter.java16 Nov 2003 04:19:03 -  1.14
  +++ CoyoteAdapter.java14 Dec 2003 22:13:12 -  1.15
  @@ -198,21 +198,17 @@
   }
   
   try {
  +
   // Parse and set Catalina and configuration specific 
   // request parameters
  -if( !postParseRequest(req, request, res, response) ) {
  -return;
  -}
  -if (!request.getMappingData().redirectPath.isNull()) {
  -response.sendRedirect
  -(request.getMappingData().redirectPath.toString());
  -} else {
  +if ( postParseRequest(req, request, res, response) ) {
   // Calling the container
   connector.getContainer().invoke(request, response);
   }
  -response.finishResponse();
   
  +response.finishResponse();
   req.action( ActionCode.ACTION_POST_REQUEST , null);
  +
   } catch (IOException e) {
   ;
   } catch (Throwable t) {
  @@ -233,7 +229,7 @@
* Parse additional request parameters.
*/
   protected boolean postParseRequest(Request req, CoyoteRequest request,
  -Response res, CoyoteResponse response)
  +   Response res, CoyoteResponse response)
   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..
  @@ -249,9 +245,9 @@
   req.scheme().setString(connector.getScheme());
   request.setSecure(connector.getSecure());
   }
  - 
   
  -// FIXME: the code below doesnt belongs to here, this is only  have sense 
  +// 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 
  @@ -309,6 +305,20 @@
 request.getMappingData());
   request.setContext((Context) request.getMappingData().context);
   request.setWrapper((Wrapper) request.getMappingData().wrapper);
  +
  +// Possible redirect
  +MessageBytes redirectPathMB = request.getMappingData().redirectPath;
  +if (!redirectPathMB.isNull()) {
  +String redirectPath = redirectPathMB.toString();
  +String query = request.getQueryString();
  +if (query != null) {
  +// This is not optimal, but as this is not very common, it
  +// shouldn't matter
  +redirectPath = redirectPath + ? + query;
  +}
  +response.sendRedirect(redirectPath);
  +return false;
  +}
   
   // Parse cookies
   parseCookies(req, request);
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-11-15 Thread billbarker
billbarker2003/11/15 20:19:04

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  Allow postParseRequest to deny a Request without the nasty throw.
  
  Revision  ChangesPath
  1.14  +10 -8 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CoyoteAdapter.java18 Sep 2003 22:20:51 -  1.13
  +++ CoyoteAdapter.java16 Nov 2003 04:19:03 -  1.14
  @@ -200,7 +200,9 @@
   try {
   // Parse and set Catalina and configuration specific 
   // request parameters
  -postParseRequest(req, request, res, response);
  +if( !postParseRequest(req, request, res, response) ) {
  +return;
  +}
   if (!request.getMappingData().redirectPath.isNull()) {
   response.sendRedirect
   (request.getMappingData().redirectPath.toString());
  @@ -230,7 +232,7 @@
   /**
* Parse additional request parameters.
*/
  -protected void postParseRequest(Request req, CoyoteRequest request,
  +protected boolean postParseRequest(Request req, CoyoteRequest request,
   Response res, CoyoteResponse response)
   throws Exception {
   // XXX the processor needs to set a correct scheme and port prior to this 
point, 
  @@ -277,7 +279,7 @@
   if (!normalize(req.decodedURI())) {
   res.setStatus(400);
   res.setMessage(Invalid URI);
  -throw new IOException(Invalid URI);
  +return false;
   }
   
   // Set the remote principal
  @@ -310,7 +312,7 @@
   
   // Parse cookies
   parseCookies(req, request);
  -
  +return true;
   }
   
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-09-18 Thread keith
keith   2003/09/18 15:20:51

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  Respond 400 to requests which contain '%' with no or invalid trailing hex digits
  
  Revision  ChangesPath
  1.13  +11 -5 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CoyoteAdapter.java7 Sep 2003 07:38:42 -   1.12
  +++ CoyoteAdapter.java18 Sep 2003 22:20:51 -  1.13
  @@ -265,7 +265,13 @@
   // URI decoding
   MessageBytes decodedURI = req.decodedURI();
   decodedURI.duplicate(req.requestURI());
  -req.getURLDecoder().convert(decodedURI, false);
  +try {
  +  req.getURLDecoder().convert(decodedURI, false);
  +} catch (IOException ioe) {
  +  res.setStatus(400);
  +  res.setMessage(Invalid URI);
  +  throw ioe;
  +}
   
   // Normalize decoded URI
   if (!normalize(req.decodedURI())) {
  
  
  

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



RE: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-09-18 Thread Keith Wannamaker
I been unsuccessful all afternoon at building j-t-catalina, and end-of-day
has caught me.  If this commit gives anyone fits, let me know and I'll be
glad to roll it back.

Keith

| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
| Sent: Thursday, September 18, 2003 6:21 PM
| To: [EMAIL PROTECTED]
| Subject: cvs commit:
| jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5
| CoyoteAdapter.java
| 
| 
| keith   2003/09/18 15:20:51
| 
|   Modified:catalina/src/share/org/apache/coyote/tomcat5
| CoyoteAdapter.java
|   Log:
|   Respond 400 to requests which contain '%' with no or invalid trailing hex digits
|   
|   Revision  ChangesPath
|   1.13  +11 -5 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
|   
|   Index: CoyoteAdapter.java
|   ===
|   RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
|   retrieving revision 1.12
|   retrieving revision 1.13
|   diff -u -r1.12 -r1.13
|   --- CoyoteAdapter.java  7 Sep 2003 07:38:42 -   1.12
|   +++ CoyoteAdapter.java  18 Sep 2003 22:20:51 -  1.13
|   @@ -265,7 +265,13 @@
|// URI decoding
|MessageBytes decodedURI = req.decodedURI();
|decodedURI.duplicate(req.requestURI());
|   -req.getURLDecoder().convert(decodedURI, false);
|   +try {
|   +  req.getURLDecoder().convert(decodedURI, false);
|   +} catch (IOException ioe) {
|   +  res.setStatus(400);
|   +  res.setMessage(Invalid URI);
|   +  throw ioe;
|   +}
|
|// Normalize decoded URI
|if (!normalize(req.decodedURI())) {
|   
|   
|   
| 
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| 

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-09-07 Thread remm
remm2003/09/07 00:38:42

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Handle query string decoding as a special case.
  - The URI encoding is used for now. Add a new field for more flexibility.
  - The encoding needs to be set once on the parameters, as they are tied to
the connector.
  
  Revision  ChangesPath
  1.12  +8 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CoyoteAdapter.java2 Sep 2003 21:21:59 -   1.11
  +++ CoyoteAdapter.java7 Sep 2003 07:38:42 -   1.12
  @@ -187,6 +187,10 @@
   req.setNote(ADAPTER_NOTES, request);
   res.setNote(ADAPTER_NOTES, response);
   
  +// Set query string encoding
  +req.getParameters().setQueryStringEncoding
  +(connector.getURIEncoding());
  +
   }
   
   if (connector.isXpoweredBy()) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-07-29 Thread remm
remm2003/07/29 07:24:27

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  - Fix normalization bug.
  
  Revision  ChangesPath
  1.10  +9 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CoyoteAdapter.java22 Jul 2003 21:02:07 -  1.9
  +++ CoyoteAdapter.java29 Jul 2003 14:24:27 -  1.10
  @@ -507,9 +507,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-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java CoyoteConnector.java

2003-07-22 Thread luehe
luehe   2003/07/22 14:02:07

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java CoyoteConnector.java
  Log:
  Moved X-Powered-By property for servlets from Host/Context to
  CoyoteConnector.  If property is set to TRUE, CoyoteAdapter adds
  X-Powered-By response header with value Servlet/2,4.
  
  Turned X-Powered-By property for JSPs into a configurable Jasper compilation
  option. If set to TRUE, the generated servlet will add X-Powered-By
  response header with value JSP/2.0.
  
  Revision  ChangesPath
  1.9   +8 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CoyoteAdapter.java3 Jul 2003 00:16:49 -   1.8
  +++ CoyoteAdapter.java22 Jul 2003 21:02:07 -  1.9
  @@ -191,6 +191,10 @@
   
   }
   
  +if (connector.isXpoweredBy()) {
  +response.addHeader(X-Powered-By, Servlet/2.4);
  +}
  +
   try {
   // Parse and set Catalina and configuration specific 
   // request parameters
  
  
  
  1.13  +33 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CoyoteConnector.java  11 Jul 2003 01:04:43 -  1.12
  +++ CoyoteConnector.java  22 Jul 2003 21:02:07 -  1.13
  @@ -188,6 +188,12 @@
   private ServerSocketFactory factory = null;
   
   
  +/*
  + * Is generation of X-Powered-By response header enabled/disabled?
  + */
  +private boolean xpoweredBy;
  +
  +
   /**
* Descriptive information about this Connector implementation.
*/
  @@ -,6 +1117,32 @@
setProperty(uRIEncoding, URIEncoding);
   
}
  +
  +
  +/**
  + * Indicates whether the generation of an X-Powered-By response header for
  + * servlet-generated responses is enabled or disabled for this Connector.
  + *
  + * @return true if generation of X-Powered-By response header is enabled,
  + * false otherwise
  + */
  +public boolean isXpoweredBy() {
  +return xpoweredBy;
  +}
  +
  +
  +/**
  + * Enables or disables the generation of an X-Powered-By header (with value
  + * Servlet/2.4) for all servlet-generated responses returned by this
  + * Connector.
  + *
  + * @param xpoweredBy true if generation of X-Powered-By response header is
  + * to be enabled, false otherwise
  + */
  +public void setXpoweredBy(boolean xpoweredBy) {
  +this.xpoweredBy = xpoweredBy;
  +setProperty(xpoweredBy, String.valueOf(xpoweredBy));
  +}
   
   
   // - Public Methods
  
  
  

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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-07-03 Thread Bill Barker

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 11:49 PM
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java


 [EMAIL PROTECTED] wrote:
  keith   2003/07/02 17:16:49
 
Modified:catalina/src/share/org/apache/coyote/tomcat5
  CoyoteAdapter.java
Log:
Allow * as a valid url

 Errr, ok, well, that's a possibly risky patch. I think that does get
 mapped to the root context and its default servlet (and the servlet path
 should be *).
 I verified a /* security constraint mapping matched this URL.


I've checked this briefly.  It looks Ok to me.  The original problem was
with:
$ telnet localhost 8080
OPTIONS * /HTTP1.1
Host: localhost:8080



Previously this would generate a 400 error.  Now it generates the correct
values for the OPTIONS with a (correct) 200 response.


 Remy


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



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

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

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

RE: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

2003-07-03 Thread Keith Wannamaker
Hi Remy, * does map to the default context.  Can you think of any special 
downstream handling that we should do for '*'?  

Keith

| -Original Message-
| From: Remy Maucherat [mailto:[EMAIL PROTECTED]
| Sent: Thursday, July 03, 2003 2:50 AM
| To: Tomcat Developers List
| Subject: Re: cvs commit:
| jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5
| CoyoteAdapter.java
| 
| 
| [EMAIL PROTECTED] wrote:
|  keith   2003/07/02 17:16:49
|  
|Modified:catalina/src/share/org/apache/coyote/tomcat5
|  CoyoteAdapter.java
|Log:
|Allow * as a valid url
| 
| Errr, ok, well, that's a possibly risky patch. I think that does get 
| mapped to the root context and its default servlet (and the servlet path 
| should be *).
| I verified a /* security constraint mapping matched this URL.
| 
| Remy


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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

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

  Modified:catalina/src/share/org/apache/coyote/tomcat5
CoyoteAdapter.java
  Log:
  Allow * as a valid url
  
  Revision  ChangesPath
  1.8   +8 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CoyoteAdapter.java19 May 2003 22:44:20 -  1.7
  +++ CoyoteAdapter.java3 Jul 2003 00:16:49 -   1.8
  @@ -480,6 +480,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]