DO NOT REPLY [Bug 46131] for a root context getContextPath returns "/" after a forward

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46131





--- Comment #5 from Denny Strietzbaum <[EMAIL PROTECTED]>  2008-11-05 01:41:00 
PST ---
(In reply to comment #4)
> A path setting of "/" is invalid

I know that as i already said this setting is not correct (but it's clear what
is meant).
I don't want discussions about specifications.
Specifications must be kept and when they aren't an error or warning should be
thrown.
It's easy to detected "/" as an invalid value and it's even easy to correct
this value automatically.

My motivation simply is that i wasn't responsible for that setting as our
server.xml gets generated by a build process which i haven't written.
I wouldn't have had lost so much time when Tomcat would let me know that
there's a problem with it's configuration.

On the other side that incorrect setting works (as getContextPath returns "")
as long is i don't do any forwards.
You can't say that this is a consistently behavior.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



tomcat native 1.1.16 release

2008-11-05 Thread Lorenz Breu

hi guys

so did i get this right, you released version 1.1.16 of tomcat native? 
it's not on the homepage yet and i am having trouble finding the exact 
location of the code of the actual release, could you tell me if the 
typos in multicast.c have been fixed in the release (lots of occurences 
of "Mulicast" instead of "Multicast")? if i recall correctly the typo in 
the jni java code (recvFrom instead of recvfrom) was fixed a while ago.


cheers,
lorenz

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



Re: tomcat native 1.1.16 release

2008-11-05 Thread Mladen Turk

Lorenz Breu wrote:

hi guys

so did i get this right, you released version 1.1.16 of tomcat native? 


Still in the voting process.


it's not on the homepage yet and i am having trouble finding the exact 
location of the code of the actual release, could you tell me if the 
typos in multicast.c have been fixed in the release (lots of occurences 
of "Mulicast" instead of "Multicast")? if i recall correctly the typo in 
the jni java code (recvFrom instead of recvfrom) was fixed a while ago.




It's currently on:
http://tomcat.apache.org/dev/dist/tomcat-connectors/native/

Once when voted it'll be in www.apache.org/dist/

Regards
--
^(TM)

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



svn commit: r711589 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/catalina/session/StandardSession.java webapps/docs/changelog.xml

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 07:41:03 2008
New Revision: 711589

URL: http://svn.apache.org/viewvc?rev=711589&view=rev
Log:
* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46085
Hard to reproduce thread safety issue with session expiration

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=711589&r1=711588&r2=711589&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Nov  5 07:41:03 2008
@@ -187,16 +187,6 @@
   +1: fhanik, pero
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46085
-  Hard to reproduce thread safety issue with session expiration
-  http://svn.apache.org/viewvc?rev=708273&view=rev
-  +1: markt, fhanik, rjung
-   0: remm (volatile seems equivalent to an AtomicLong)
-I did devise something by replacing the accessedTimes as long by an 
int offset
-based on the creation date. From what I understand, this should also 
address
-the corruption issue, but the patch is more complex. 
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46077
   Expose deferAccept
   Patch provided by Michael Leinartas

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java?rev=711589&r1=711588&r2=711589&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java 
Wed Nov  5 07:41:03 2008
@@ -204,7 +204,7 @@
 /**
  * The last accessed time for this Session.
  */
-protected long lastAccessedTime = creationTime;
+protected volatile long lastAccessedTime = creationTime;
 
 
 /**
@@ -279,7 +279,7 @@
 /**
  * The current accessed time for this session.
  */
-protected long thisAccessedTime = creationTime;
+protected volatile long thisAccessedTime = creationTime;
 
 
 /**

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=711589&r1=711588&r2=711589&view=diff
==
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Nov  5 07:41:03 2008
@@ -142,6 +142,10 @@
 (markt)
   
   
+46085: Fix a rare thread safety issue with session
+expiration. (markt)
+  
+  
 46096:  Support annotation processing whilst running under a
 security manager. (markt)
   



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



DO NOT REPLY [Bug 46085] Session are incorrectly expired due to thread unsafe code

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46085


Mark Thomas <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #2 from Mark Thomas <[EMAIL PROTECTED]>  2008-11-05 07:41:18 PST ---
This has been fixed in 6.0.x and will be included 6.0.19 onwards.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 46077] deferAccept should be a settable property in AprEndpoint

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46077


Mark Thomas <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #2 from Mark Thomas <[EMAIL PROTECTED]>  2008-11-05 07:58:10 PST ---
The patch has been applied to 6.0.19 and will be included from 6.0.19 onwards.
Thanks again for the patch.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r711594 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/coyote/http11/Http11AprProtocol.java java/org/apache/tomcat/util/net/AprEndpoint.java webapps/docs/changelog.xml webapps/docs

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 07:58:37 2008
New Revision: 711594

URL: http://svn.apache.org/viewvc?rev=711594&view=rev
Log:
* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46077
Expose deferAccept
Patch provided by Michael Leinartas

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc6.0.x/trunk/webapps/docs/config/ajp.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=711594&r1=711593&r2=711594&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Nov  5 07:58:37 2008
@@ -187,13 +187,6 @@
   +1: fhanik, pero
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46077
-  Expose deferAccept
-  Patch provided by Michael Leinartas
-  http://svn.apache.org/viewvc?rev=708344&view=rev
-  +1: markt, remm, rjung
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46075
   Don't create ByteArrayOutputStream at maxmimum possible size
   http://svn.apache.org/viewvc?rev=708361&view=rev

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=711594&r1=711593&r2=711594&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 
Wed Nov  5 07:58:37 2008
@@ -245,6 +245,9 @@
 public int getSendfileSize() { return endpoint.getSendfileSize(); }
 public void setSendfileSize(int sendfileSize) { 
endpoint.setSendfileSize(sendfileSize); }
 
+public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+public void setDeferAccept(boolean deferAccept) { 
endpoint.setDeferAccept(deferAccept); }
+
 protected int socketBuffer = 9000;
 public int getSocketBuffer() { return socketBuffer; }
 public void setSocketBuffer(int socketBuffer) { this.socketBuffer = 
socketBuffer; }

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=711594&r1=711593&r2=711594&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed 
Nov  5 07:58:37 2008
@@ -156,15 +156,17 @@
 protected long sslContext = 0;
 
 
+// - Properties
+
+
 /**
  * Defer accept.
  */
 protected boolean deferAccept = true;
+public void setDeferAccept(boolean deferAccept) { this.deferAccept = 
deferAccept; }
+public boolean getDeferAccept() { return deferAccept; }
 
 
-// - Properties
-
-
 /**
  * External Executor based thread pool.
  */
@@ -659,8 +661,10 @@
 // Delay accepting of new connections until data is available
 // Only Linux kernels 2.4 + have that implemented
 // on other platforms this call is noop and will return APR_ENOTIMPL.
-if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == 
Status.APR_ENOTIMPL) {
-deferAccept = false;
+if (deferAccept) {
+if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == 
Status.APR_ENOTIMPL) {
+deferAccept = false;
+}
 }
 
 // Initialize SSL if needed

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=711594&r1=711593&r2=711594&view=diff
==
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Nov  5 07:58:37 2008
@@ -168,6 +168,10 @@
 45591: NPE on start-up failure in some cases. Based on a
 patch by Matt Passell. (markt)
   
+  
+46077: Expose deferAccept for configuration. Patch provided
+by Michael Leinartas. (markt)
+  
 
   
   

Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/ajp.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/ajp.xml?rev=711594&r1=711593&r2=711594&view=diff
==
--- tomcat/tc6.0.x/trunk/webapps/doc

svn commit: r711597 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java webapps/docs/changelog.xml

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 08:09:26 2008
New Revision: 711597

URL: http://svn.apache.org/viewvc?rev=711597&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46075
Don't create ByteArrayOutputStream at maxmimum possible size

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=711597&r1=711596&r2=711597&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Nov  5 08:09:26 2008
@@ -187,12 +187,6 @@
   +1: fhanik, pero
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46075
-  Don't create ByteArrayOutputStream at maxmimum possible size
-  http://svn.apache.org/viewvc?rev=708361&view=rev
-  +1: markt, remm, rjung
-  -1: 
-
 * Start poller before acceptor in NIO, bug 43701
   
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&r1=618058&r2=618059
   +1: fhanik

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java?rev=711597&r1=711596&r2=711597&view=diff
==
--- 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
 Wed Nov  5 08:09:26 2008
@@ -84,7 +84,14 @@
 super(threshold);
 this.outputFile = outputFile;
 
-memoryOutputStream = new ByteArrayOutputStream(threshold);
+if (threshold < DefaultFileItemFactory.DEFAULT_SIZE_THRESHOLD) {
+// Small threshold, use it
+memoryOutputStream = new ByteArrayOutputStream(threshold);
+} else {
+// Large threshold. Use default and array will expand if required
+memoryOutputStream = new ByteArrayOutputStream(
+DefaultFileItemFactory.DEFAULT_SIZE_THRESHOLD);
+}
 currentOutputStream = memoryOutputStream;
 }
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=711597&r1=711596&r2=711597&view=diff
==
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Nov  5 08:09:26 2008
@@ -142,6 +142,11 @@
 (markt)
   
   
+46075: When uploading files, don't create buffers at the
+maximum configured size. Use the default size and let the buffers grow
+to the maximum size if necessary. (markt)
+  
+  
 46085: Fix a rare thread safety issue with session
 expiration. (markt)
   



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



DO NOT REPLY [Bug 46075] FileUpload memory usage

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46075


Mark Thomas <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #2 from Mark Thomas <[EMAIL PROTECTED]>  2008-11-05 08:09:42 PST ---
The patch has been applied to 6.0.x and will be included in 6.0.19 onwards.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r711600 - in /tomcat/trunk/java/org/apache/catalina: core/ApplicationFilterChain.java security/SecurityUtil.java

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 08:17:16 2008
New Revision: 711600

URL: http://svn.apache.org/viewvc?rev=711600&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46011
Make Principal accessible (if set) via 
Subject.getSubject(AccessController.getContext()) when processing filters.
Based on a patch provided by tsveg1

Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=711600&r1=711599&r2=711600&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Wed 
Nov  5 08:17:16 2008
@@ -228,7 +228,7 @@
 
 Object[] args = new Object[]{req, res, this};
 SecurityUtil.doAsPrivilege
-("doFilter", filter, classType, args);
+("doFilter", filter, classType, args, principal);
 
 args = null;
 } else {  

Modified: tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java?rev=711600&r1=711599&r2=711600&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java (original)
+++ tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java Wed Nov  5 
08:17:16 2008
@@ -180,7 +180,7 @@
  
 
 /**
- * Perform work as a particular Subject. Here the work
+ * Perform work as a particular Subject. Here the work
  * will be granted to a null subject. 
  *
  * @param methodName the method to apply the security restriction
@@ -196,6 +196,31 @@
  final Class[] targetType,
  final Object[] targetArguments) 
 throws java.lang.Exception{
+
+doAsPrivilege(
+methodName, targetObject, targetType, targetArguments, null);
+}
+
+/**
+ * Perform work as a particular Subject. Here the work
+ * will be granted to a null subject. 
+ *
+ * @param methodName the method to apply the security restriction
+ * @param targetObject the Filter on which the method will 
+ * be called.
+ * @param targetType Class array used to instanciate a
+ * Method object.
+ * @param targetArguments Object array contains the 
+ * runtime parameters instance.
+ * @param principal the Principal to which the security 
+ * privilege apply
+ */
+public static void doAsPrivilege(final String methodName, 
+ final Filter targetObject, 
+ final Class[] targetType,
+ final Object[] targetArguments,
+ Principal principal) 
+throws java.lang.Exception{
 Method method = null;
 
 Method[] methodsCache = null;
@@ -215,7 +240,7 @@
 targetType); 
 }
 
-execute(method, targetObject, targetArguments, null);
+execute(method, targetObject, targetArguments, principal);
 }
 
 



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



DO NOT REPLY [Bug 46011] Cannot access to Principal via Subject.getSubject(AccessController.getContext())

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46011





--- Comment #2 from Mark Thomas <[EMAIL PROTECTED]>  2008-11-05 08:19:58 PST ---
many thanks for the patch. This has been committed to trunk and proposed for
6.0.19


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 43062] jvmtiEventVMDeath event doesn't return in JVMTI when shutting down tomcat 6 as a service.

2008-11-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=43062


Mark Thomas <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution||WONTFIX




--- Comment #2 from Mark Thomas <[EMAIL PROTECTED]>  2008-11-05 08:42:31 PST ---
Due to the general lack of interest and no obvious change in code between 5.5.x
and 6.0.x I am going to close this as wontfix.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r711619 - /tomcat/tc6.0.x/trunk/STATUS.txt

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 09:01:44 2008
New Revision: 711619

URL: http://svn.apache.org/viewvc?rev=711619&view=rev
Log:
Propose patch for 40611

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=711619&r1=711618&r2=711619&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Nov  5 09:01:44 2008
@@ -245,3 +245,10 @@
   http://svn.apache.org/viewvc?rev=710205&view=rev
   +1: markt
   -1: 
+
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46011
+  Make Principal accessible (if set) via
+  Subject.getSubject(AccessController.getContext()) when processing filters.
+  Based on a patch provided by tsveg1
+  +1: markt
+  -1: 



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



svn commit: r711620 - in /tomcat/site/trunk: ./ .cvsignore

2008-11-05 Thread markt
Author: markt
Date: Wed Nov  5 09:02:16 2008
New Revision: 711620

URL: http://svn.apache.org/viewvc?rev=711620&view=rev
Log:
Remove old file

Removed:
tomcat/site/trunk/.cvsignore
Modified:
tomcat/site/trunk/   (props changed)

Propchange: tomcat/site/trunk/
--
--- svn:ignore (original)
+++ svn:ignore Wed Nov  5 09:02:16 2008
@@ -1 +1 @@
-velocity.log
+.project



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



svn commit: r711695 - /tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java

2008-11-05 Thread rjung
Author: rjung
Date: Wed Nov  5 12:50:34 2008
New Revision: 711695

URL: http://svn.apache.org/viewvc?rev=711695&view=rev
Log:
Whitespace and indentation cleanup.

Modified:
tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java

Modified: tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java?rev=711695&r1=711694&r2=711695&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java Wed 
Nov  5 12:50:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@
 public class SessionUtils {
 
 /**
- * 
+ *
  */
 private SessionUtils() {
 super();
@@ -71,92 +71,92 @@
  * @return String
  */
 public static Locale guessLocaleFromSession(final Session in_session) {
-   return guessLocaleFromSession(in_session.getSession());
+return guessLocaleFromSession(in_session.getSession());
 }
 public static Locale guessLocaleFromSession(final HttpSession in_session) {
-   if (null == in_session) {
-   return null;
-   }
+if (null == in_session) {
+return null;
+}
 try {
 Locale locale = null;
-
-   // First search "known locations"
-   for (int i = 0; i < LOCALE_TEST_ATTRIBUTES.length; ++i) {
-   Object obj = 
in_session.getAttribute(LOCALE_TEST_ATTRIBUTES[i]);
-   if (null != obj && obj instanceof Locale) {
-   locale = (Locale) obj;
-   break;
-   }
-   obj = 
in_session.getAttribute(LOCALE_TEST_ATTRIBUTES[i].toLowerCase());
-   if (null != obj && obj instanceof Locale) {
-   locale = (Locale) obj;
-   break;
-   }
-   obj = 
in_session.getAttribute(LOCALE_TEST_ATTRIBUTES[i].toUpperCase());
-   if (null != obj && obj instanceof Locale) {
-   locale = (Locale) obj;
-   break;
-   }
-   }
-   
-   if (null != locale) {
-   return locale;
-   }
-   
-   // Tapestry 3.0: Engine stored in session under 
"org.apache.tapestry.engine:" + config.getServletName()
-   // TODO: Tapestry 4+
-   {
-   final List tapestryArray = new ArrayList();
-   for (Enumeration enumeration = 
in_session.getAttributeNames(); enumeration.hasMoreElements();) {
-   String name = (String) enumeration.nextElement();
-   if (name.indexOf("tapestry") > -1 && 
name.indexOf("engine") > -1 && null != in_session.getAttribute(name)) 
{//$NON-NLS-1$ //$NON-NLS-2$
-   tapestryArray.add(in_session.getAttribute(name));
-   }
-   }
-   if (tapestryArray.size() == 1) {
-   // found a potential Engine! Let's call getLocale() on 
it.
-   Object probableEngine = tapestryArray.get(0);
-   if (null != probableEngine) {
-   try {
-   Method readMethod = 
probableEngine.getClass().getMethod("getLocale", null);//$NON-NLS-1$
-   if (null != readMethod) {
-   // Call the property getter and return the 
value
-   Object possibleLocale = 
readMethod.invoke(probableEngine, null);
-   if (null != possibleLocale && 
possibleLocale instanceof Locale) {
-   locale = (Locale) possibleLocale;
-   }
-   }
-   } catch (Exception e) {
-   // stay silent
-   }
-   }
-   }
-   }
-   
-   if (null != locale) {
-   return locale;
-   }
-   
-   // Last guess: iterate over all attributes, to find a Locale
- 

svn commit: r711711 - /tomcat/trunk/java/org/apache/catalina/session/StandardSession.java

2008-11-05 Thread rjung
Author: rjung
Date: Wed Nov  5 13:56:52 2008
New Revision: 711711

URL: http://svn.apache.org/viewvc?rev=711711&view=rev
Log:
Give thisAccessedTime and lastAccessedTime for sessions
a clear semantics:

- thisAccessedTime will be updated at the beginning and
  at the end of session use
- lastAccessedTime will only be updated at the end of
  session use

This means:

- lastAccessedTime is the last access time of a session
  disregarding any request still being processed on.
  So this is good to use even from within a request
  to detect when its own session has been used last before.
- thisAccessedTime already gets updated when a new request 
  disregarding any request still being processed on.
  So this is better for any idleness check or information.
- thisAccessedTime >= lastAccessedTime always

Modified:
tomcat/trunk/java/org/apache/catalina/session/StandardSession.java

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=711711&r1=711710&r2=711711&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Wed Nov  
5 13:56:52 2008
@@ -617,9 +617,8 @@
  */
 public void access() {
 
-this.lastAccessedTime = this.thisAccessedTime;
 this.thisAccessedTime = System.currentTimeMillis();
-
+
 if (ACTIVITY_CHECK) {
 accessCount.incrementAndGet();
 }
@@ -633,6 +632,8 @@
 public void endAccess() {
 
 isNew = false;
+this.thisAccessedTime = System.currentTimeMillis();
+this.lastAccessedTime = this.thisAccessedTime;
 
 if (ACTIVITY_CHECK) {
 accessCount.decrementAndGet();



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



svn commit: r711714 - /tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java

2008-11-05 Thread rjung
Author: rjung
Date: Wed Nov  5 14:05:24 2008
New Revision: 711714

URL: http://svn.apache.org/viewvc?rev=711714&view=rev
Log:
This one gets inherited from StandardSession.

Modified:
tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java?rev=711714&r1=711713&r2=711714&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java Wed Nov  
5 14:05:24 2008
@@ -257,21 +257,12 @@
 resetDeltaRequest();
 }
 
-   
 
-/**
- * Return the last client access time without invalidation check
- * @see #getLastAccessedTime().
- */
-public long getLastAccessedTimeInternal() {
-return (this.lastAccessedTime);
-}
-
-
-   
 public void setMaxInactiveInterval(int interval) {
 this.setMaxInactiveInterval(interval,true);
 }
+
+
 public void setMaxInactiveInterval(int interval, boolean addDeltaRequest) {
 super.maxInactiveInterval = interval;
 if (isValid && interval == 0) {
@@ -285,7 +276,6 @@
 unlock();
 }
 }
-
 }
 }
 



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



svn commit: r711716 - in /tomcat/trunk/java/org/apache/catalina: ./ ha/session/ session/

2008-11-05 Thread rjung
Author: rjung
Date: Wed Nov  5 14:11:04 2008
New Revision: 711716

URL: http://svn.apache.org/viewvc?rev=711716&view=rev
Log:
Now expose thisAccessedTime via the session interface
and ManagerBase, so we can use it from outside the session.

Modified:
tomcat/trunk/java/org/apache/catalina/Session.java
tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings_es.properties
tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/session/LocalStrings_es.properties
tomcat/trunk/java/org/apache/catalina/session/LocalStrings_fr.properties
tomcat/trunk/java/org/apache/catalina/session/LocalStrings_ja.properties
tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
tomcat/trunk/java/org/apache/catalina/session/StandardSession.java

Modified: tomcat/trunk/java/org/apache/catalina/Session.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Session.java?rev=711716&r1=711715&r2=711716&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/Session.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Session.java Wed Nov  5 14:11:04 2008
@@ -131,6 +131,22 @@
  * session, as the number of milliseconds since midnight, January 1, 1970
  * GMT.  Actions that your application takes, such as getting or setting
  * a value associated with the session, do not affect the access time.
+ * This one gets updated whenever a request starts.
+ */
+public long getThisAccessedTime();
+
+/**
+ * Return the last client access time without invalidation check
+ * @see #getThisAccessedTime().
+ */
+public long getThisAccessedTimeInternal();
+
+/**
+ * Return the last time the client sent a request associated with this
+ * session, as the number of milliseconds since midnight, January 1, 1970
+ * GMT.  Actions that your application takes, such as getting or setting
+ * a value associated with the session, do not affect the access time.
+ * This one gets updated whenever a request finishes.
  */
 public long getLastAccessedTime();
 

Modified: 
tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties?rev=711716&r1=711715&r2=711716&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties 
Wed Nov  5 14:11:04 2008
@@ -98,6 +98,7 @@
 standardSession.getAttribute.ise=getAttribute: Session already invalidated
 standardSession.getAttributeNames.ise=getAttributeNames: Session already 
invalidated
 standardSession.getCreationTime.ise=getCreationTime: Session already 
invalidated
+standardSession.getThisAccessedTime.ise=getThisAccessedTime: Session already 
invalidated
 standardSession.getLastAccessedTime.ise=getLastAccessedTime: Session already 
invalidated
 standardSession.getId.ise=getId: Session already invalidated
 standardSession.getMaxInactiveInterval.ise=getMaxInactiveInterval: Session 
already invalidated
@@ -109,4 +110,4 @@
 standardSession.setAttribute.ise=setAttribute: Session already invalidated
 standardSession.setAttribute.namenull=setAttribute: name parameter cannot be 
null
 standardSession.sessionCreated=Created Session id = {0}
-serializablePrincipal.readPrincipal.cnfe=readPrincipal: Failed to recreate 
user Principal
\ No newline at end of file
+serializablePrincipal.readPrincipal.cnfe=readPrincipal: Failed to recreate 
user Principal

Modified: 
tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings_es.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings_es.properties?rev=711716&r1=711715&r2=711716&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings_es.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings_es.properties 
Wed Nov  5 14:11:04 2008
@@ -98,6 +98,7 @@
 standardSession.getAttribute.ise = getAttribute\: Sesi\u00F3n ya invalidada
 standardSession.getAttributeNames.ise = getAttributeNames\: Sesi\u00F3n ya 
invalidada
 standardSession.getCreationTime.ise = getCreationTime\: Sesi\u00F3n ya 
invalidada
+standardSession.getThisAccessedTime.ise = getThisAccessedTime\: Sesi\u00F3n ya 
invalidada
 standardSession.getLastAccessedTime.ise = getLastAccessedTime\: Sesi\u00F3n ya 
invalidada
 standardSession.getId.ise = getId\: Sesi\u00F3n ya invalidada
 standardSession.getMaxInactiveInterval.ise = getMaxInactiveInterval\: 
Sesi\u00F3n ya invalidada

Modified: tomcat/trunk/ja

svn commit: r711720 - in /tomcat/trunk/java/org/apache/catalina: authenticator/SingleSignOn.java manager/ManagerServlet.java manager/util/SessionUtils.java session/PersistentManagerBase.java valves/Pe

2008-11-05 Thread rjung
Author: rjung
Date: Wed Nov  5 14:15:53 2008
New Revision: 711720

URL: http://svn.apache.org/viewvc?rev=711720&view=rev
Log:
Now make the classes checking session idleness
use thisAccessedTime.
This is not for invalidation, only for displaying
idle times and making persistance decisions.

Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java
tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java?rev=711720&r1=711719&r2=711720&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java Wed 
Nov  5 14:15:53 2008
@@ -323,7 +323,7 @@
 // SSO.  If the session was logged out, we'll log out
 // of all session associated with the SSO.
 if (((session.getMaxInactiveInterval() > 0)
-&& (System.currentTimeMillis() - 
session.getLastAccessedTimeInternal() >=
+&& (System.currentTimeMillis() - 
session.getThisAccessedTimeInternal() >=
 session.getMaxInactiveInterval() * 1000)) 
 || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType( {
 removeSession(ssoId, session);

Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=711720&r1=711719&r2=711720&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Wed Nov  
5 14:15:53 2008
@@ -1064,7 +1064,7 @@
 
 /**
  * Session information for the web application at the specified context 
path.
- * Displays a profile of session lastAccessedTime listing number
+ * Displays a profile of session thisAccessedTime listing number
  * of sessions for each 10 minute interval up to 10 hours.
  *
  * @param writer Writer to render to
@@ -1118,7 +1118,7 @@
 int expired = 0;
 long now = System.currentTimeMillis();
 for (int i = 0; i < sessions.length; i++) {
-int time = 
(int)((now-sessions[i].getLastAccessedTimeInternal())/1000);
+int time = 
(int)((now-sessions[i].getThisAccessedTimeInternal())/1000);
 if (idle >= 0 && time >= idle*60) {
 sessions[i].expire();
 idle++;
@@ -1161,7 +1161,7 @@
 
 /**
  * Session information for the web application at the specified context 
path.
- * Displays a profile of session lastAccessedTime listing number
+ * Displays a profile of session thisAccessedTime listing number
  * of sessions for each 10 minute interval up to 10 hours.
  *
  * @param writer Writer to render to

Modified: tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java?rev=711720&r1=711719&r2=711720&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java Wed 
Nov  5 14:15:53 2008
@@ -237,7 +237,7 @@
 
 public static long getUsedTimeForSession(Session in_session) {
 try {
-long diffMilliSeconds = in_session.getLastAccessedTime() - 
in_session.getCreationTime();
+long diffMilliSeconds = in_session.getThisAccessedTime() - 
in_session.getCreationTime();
 return diffMilliSeconds;
 } catch (IllegalStateException ise) {
 //ignore: invalidated session
@@ -247,7 +247,7 @@
 
 public static long getTTLForSession(Session in_session) {
 try {
-long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) 
- (System.currentTimeMillis() - in_session.getLastAccessedTime());
+long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) 
- (System.currentTimeMillis() - in_session.getThisAccessedTime());
 return diffMilliSeconds;
 } catch (IllegalStateException ise) {
 //ignore: invalidated session
@@ -257,7 +257,7 @@
 
 public static long getInactiveTimeForSession(Session in_session) {
 try {
-long diffMilliSeconds =  System.currentT

Setting version number in build.properties.default

2008-11-05 Thread Rainer Jung
I noticed that our TC 6 source distribution does not contain any version
info (apart from the archive file name).

For TC 5.5 the file build.properties.default gets updated before tagging
with the correct version info, for TC 6 there's alway 6.0.0.0 in it and
6.0-snapshot.

I propose, that we start to increment the version number in
build.properties.default as part of the release process before tagging.

Lines which would be influenced by this are:

   version.build=0 (new: e.g. 18, 19, ...)
   version=6.0-snapshot (new: 6.0.18, 6.0.19, ...)

and possibly

   version.patch=0.

Is there any release howto, that also contains the additional release
steps apart from the ant tasks?

Regards,

Rainer




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



Re: Setting version number in build.properties.default

2008-11-05 Thread Remy Maucherat
On Thu, 2008-11-06 at 00:09 +0100, Rainer Jung wrote:
> I propose, that we start to increment the version number in
> build.properties.default as part of the release process before tagging.

I propose that I won't do it. Any questions ?

Rémy



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



Re: Setting version number in build.properties.default

2008-11-05 Thread Rainer Jung
Remy Maucherat schrieb:
> On Thu, 2008-11-06 at 00:09 +0100, Rainer Jung wrote:
>> I propose, that we start to increment the version number in
>> build.properties.default as part of the release process before tagging.
> 
> I propose that I won't do it.

There's no need for you to do it. Anyone can do it before tagging, e.g.
I can set it right now to 19, and after tagging we (someone) increase to
20 etc.

>  Any questions ?

Yes: is there any reason to not do it?

I consider all those src releases being formally broken. If any user
builds a dist out of them by following our BUILDING documentation, he
will get a TC named 6.0.0. Obviously those variables in build.properties
are not meant to be used as constants.

Regards,

Rainer

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



Re: Setting version number in build.properties.default

2008-11-05 Thread Remy Maucherat
On Thu, 2008-11-06 at 00:32 +0100, Rainer Jung wrote:
> Yes: is there any reason to not do it?

It does not look actually useful, and I could forget about it (meaning a
lot of wasted time).

Rémy



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



Re: Setting version number in build.properties.default

2008-11-05 Thread sebb
On 05/11/2008, Remy Maucherat <[EMAIL PROTECTED]> wrote:
> On Thu, 2008-11-06 at 00:32 +0100, Rainer Jung wrote:
>  > Yes: is there any reason to not do it?
>
>
> It does not look actually useful, and I could forget about it (meaning a
>  lot of wasted time).

Perhaps you could do something like we do for JMeter.

For release builds, the version information must be provided on the
Ant command-line, and is this is used to update a class file
containing the version details, as well as being used for the
directory and archive file names.

For nightly builds on Hudson, the version is set to the current SVN revision.
[This makes it easy to tell what is actually in the build]

The SVN revision is also added to release builds as part of the
version information that is displayed in Help/About.

If the version information is not provided to Ant, then the version
defaults to including the current date.

>
>  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]