antiResourceLocking - hot deployment using context.xml in catalina localhost - tomcat6.0 - Reg.

2009-06-19 Thread Murali
Hi,

 

I am using Tomcat6.0.13, and could read from the tomcat document that the
,antiResourceLocking' has a side effect of truncating the size of some files
to 0 bytes.

 

Does the side effect still exist with Tomcat 6.0.13 version?  I know that
Tomcat 5.0 has this side effect but I don't know whether I can go with hot
deployment using antiResourceLocking set to true.

 

My context.xml file looks as below:

 

 

 

Regards,

 

Lakkaraju Murali Krishna || PASS GCA || Hyderabad || Ph: +919052942229.

e-Mail: murali.lakkar...@pass-consulting.com

- Men should be Physically and Mentally Strong, a dozens of such Lions can
Rule this world, which cannot be done by millions of Sheep - Swami
Vivekananda.

 



Re: [VOTE] Release JDBC Pool module v1.0.4

2009-06-19 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
> Cleaned up and fixed.
> 
> The release is located here:
> http://people.apache.org/~fhanik/jdbc-pool/v1.0.4/
> 
> 
> [ ] STABLE - I couldn't find any bugs
> [ ] BETA   - I found some bugs but not critical
> [X] BROKEN - I found some show stoppers
> 

As Sebb has been trying to tell you, the contents of the NOTICE file is
wrong. It does not contain the standard ASF attribution.

I'm not sure about adding your personal copyright statement to the
NOTICE file. It raises a number of issues:
1. I'm not sure it is legally correct.
2. It makes this look like your personal release rather than an ASF release.
3. Whilst you have made the largest contribution others have made small
contributions as well. You appear to be ignoring that contribution,
however minor.
All of these concerns would be alleviated by removing that line.

Source and binary distributions must be completely separate.

The source distribution is far from complete. It is missing:
- build scripts
- documentation (including LICENSE and NOTICE)

It should be possible to build the binary from *only* the source
distribution. This is not possible as the source jar contains only .java
files.

Generally, I would expect the source distribution to be identical to the
result of doing an svn export of the source.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: className in conf/context.xml

2009-06-19 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
> is no longer being picked up, at least not in my test.
> I think it's related to the deploy refactor that has been going on,
> possibly related to
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47343

Possibly. I'll take a look.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
> I'm not sure what we are trying to do in this test, in my mind we are
> proving nothing with this test :)

The only purpose of the test is to provide a representative micro
benchmark of the current code vs your suggestion to use ThreadLocals
instead (in the 5.5.x patch file). I wanted to see how much faster
ThreadLocals would be and was surprised to see that they were slower. I
haven't given any thought to why this might be although I am curious.

> The thread safety in AccessLogValve is the fact that the formatters are
> not thread safe and can yield some funky dates showing up.

Agreed.

> And in the ideal solution its just not to wrap everything up in a
> synchronized statement.

Not agreed. This needs to be considered in context.
- Syncs aren't that expensive.
- The microbenchmarks suggest ThreadLocals are actually slightly slower
(at least on the machines I have been testing on - others may have
different results in which case I'd be interested to see what they are)
- If there is a slight delay, it won't impact the request processing
time, it will just delay the thread being released back to the pool. Any
delay harms scalability rather than response time.
- The microbenchmark suggests the times in question are so small as to
not be worth worrying about in the grand scheme of things.

However, now we have the benchmarch, if anyone wants to propose an
alternative scheme they can use the benchmark to a) test out their idea
and b) prove the relative performance improvements.

I accept the test isn't perfect. It is only meant to give an idea of
relative performance but if an alternative approach took 50% of the time
of the current one I'd +1 it in a heartbeat.

> The other thread safety issue in AccessLogValve is the the rotation of
> files, since it seems as one thread can close the file

Agreed. I have a simple patch for this. As the writer already uses a
sync, it will cost very little to put a sync around the use of the
writer to fix this.

> There are more efficient AccessLogValve, instead of doing all this
> comparison crap on every single request, and writing to the file on
> every single request.

The comparison really isn't that expensive and the writing is buffered
by default.

> An example:
> 1. single back thread updates the currentDateString once a second.

Yep, that is an alternative solution. Obviously currentDateString would
need to be volatile but as long as only the background thread was doing
the updates you could ditch all the syncs.

There is already the background processor but this would need to be
separate as the frequency of that is user configurable (and can be
disabled).

> 2. Add the log entries to the queue, who writes out the buffer once a
> second.

The writer is buffered by default anyway.

> If you don't want a background thread, then still the stuff going on in
> the Benchmark test is not needed, and the bench mark is far from
> efficient and there are other ways of doing it much better than we have
> today.

The purpose of the benchmark was to give us some concrete numbers to
compare different approaches. The aim was to get relative performance
numbers rather than absolute ones.

I was a little surprised that ThreadLocal seems to be slower. I still
wonder if I got the test wrong for that but I can't see anything.

> Writing to a file the way we do it is synchronized, anyway, so the goal
> was only to achieve non funky dates.
>PrintWriter.java
>public void println(String x) {
>synchronized (lock) {
>print(x);
>println();
>}
>}

Yep. As I noted above, this means adding the sync to fix the issue you
identified of trying to write during roll-over is relatively low cost.

Mark

> 
> 
> 
> Filip
> 
> sebb wrote:
>> On 18/06/2009, sebb  wrote:
>>  
>>> On 18/06/2009, Mark Thomas  wrote:
>>>  > Tim Funk wrote:
>>>  >  > I think this needs to be volatile ?
>>>  >  > In (GetDateBenchmarkTest)
>>>  >  >> +private long currentMillis = 0;
>>>  >  >
>>>  >  > Same for (in TimeDateElementBenchmarkTest)
>>>  >  >> +private Date currentDate = null;
>>>  >  >
>>>  >  > Of course - since the test is single threaded - it doesn't
>>> really matter.
>>>  >
>>>  >
>>>  > The test should be multi-threaded unless I got something badly
>>> wrong. I'll
>>>  >  double check.
>>>  >
>>>  >  Making those volatile gets them closer to the real code. I doubt
>>> it will make a
>>>  >  difference but worth changing to be sure. You never know with
>>> these things.
>>>
>>>
>>> The field GetDateBenchmarkTest.currentDate is set in a synch. block in
>>>  doSynch(), but for the return it is fetched outside the synch. block -
>>>  so it could potentially be changed by another thread. Also if the
>>>  synch. block is not entered, the thread might not see the correct
>>>  version of the field as there is no synch. on the read.
>>>
>>>  Similarly in TimeDateElementBenchmarkTest.getDateSync() - although the
>>>  field is volatile, i

Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Mark Thomas
sebb wrote:
> Oops, forgot to mention - there are only 5 threads in the test; it
> might be useful to try tests with increasing numbers of threads to see
> if the relative numbers change.

I did (I used 50) and they get a little closer but not much.

I left it at 5 as that was my best WAG as to how many threads might be
in the AccessLogValve code at any one time. I have absolutely nothing to
back up that guess.

Mark

> 
>>  >  Mark
>>  >
>>  >
>>  >  >
>>  >  > -Tim
>>  >  >
>>  >  > ma...@apache.org wrote:
>>  >  >> Author: markt
>>  >  >> Date: Thu Jun 18 08:32:29 2009
>>  >  >> New Revision: 785952
>>  >  >>
>>  >  >> URL: http://svn.apache.org/viewvc?rev=785952&view=rev
>>  >  >> Log:
>>  >  >> Add some micro-benchmarks that enable the differences between the Sync
>>  >  >> and ThreadLocal approach to be compared
>>  >  >
>>  >  >
>>  >  > -
>>  >  > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>  >  > For additional commands, e-mail: dev-h...@tomcat.apache.org
>>  >  >
>>  >
>>  >
>>  >  -
>>  >  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>  >  For additional commands, e-mail: dev-h...@tomcat.apache.org
>>  >
>>  >
>>
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786455 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 11:11:06 2009
New Revision: 786455

URL: http://svn.apache.org/viewvc?rev=786455&view=rev
Log:
Minor improvements
- as per Sebb's comment on the dev list - need to add a volatile
- correct the log message

Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786455&r1=786454&r2=786455&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
11:11:06 2009
@@ -37,7 +37,7 @@
 
 private static class GetDateBenchmarkTest extends BenchmarkTest {
 private volatile long currentMillis = 0;
-private Date currentDate = null;
+private volatile Date currentDate = null;
 
 private ThreadLocal currentMillisLocal = new ThreadLocal() 
{
 protected Long initialValue() {
@@ -227,7 +227,7 @@
 }
 long end = System.currentTimeMillis();
 
-System.out.println("testAccessLogGetDate: " + threadCount +
+System.out.println(this.getClass().getName() + ": " + threadCount +
 " threads and " + iterations + " iterations " +
 (useSyncs?"using Syncs":"using ThreadLocals") +
 " took " + (end-start) + "ms");



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Mark Thomas
sebb wrote:
> If it is intended to allow currentDate to be updated by another thread
> before the return, then the field needs to be volatile. Otherwise the
> return value needs to be established in the synch. block.

It needs to be volatile. I ran some comparisons and the performance
difference appears to be in the noise.

Thanks for the review. I'll also see what changes, if any, this implies
for the AccessLogValve.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread Mark Thomas
Mark Thomas wrote:
> The (updated) candidates source tarball and derived binaries are
> available here:
> http://tomcat.apache.org/dev/dist/apache-tomcat-4.1.40/
> 
> According to the release process, the release based on the 4.0.40 tag is:
> [ ] Broken
> [ ] Alpha
> [ ] Beta
> [X] Stable

Here is my +1 to get the ball rolling.

Just as a reminder, there are security issues fixed in this release, so
if you do have time to review this release and vote, it would be much
appreciated.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786468 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:04:52 2009
New Revision: 786468

URL: http://svn.apache.org/viewvc?rev=786468&view=rev
Log:
As per review comments:
- use StringBuilder
- add comment to explain one possible cause
- better logging using original data

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=786468&r1=786467&r2=786468&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Fri Jun 19 
12:04:52 2009
@@ -382,10 +382,11 @@
 pos=valEnd+1;
 
 if( nameEnd<=nameStart ) {
-StringBuffer msg = new StringBuffer("Parameters: Invalid chunk 
");
+StringBuilder msg = new StringBuilder("Parameters: Invalid 
chunk ");
+// No name eg ...&=xx&... will trigger this
 if (valEnd >= nameStart) {
 msg.append('\'');
-msg.append(new String(bytes, nameStart, valEnd));
+msg.append(new String(bytes, nameStart, valEnd - 
nameStart));
 msg.append("' ");
 }
 msg.append("ignored.");
@@ -399,10 +400,15 @@
 try {
 addParam( urlDecode(tmpName, enc), urlDecode(tmpValue, enc) );
 } catch (IOException e) {
-// Exception during character decoding: skip parameter
-String msg = "Parameters: Character decoding failed. " + 
-"Parameter '" + tmpName + "' with value '" +
-tmpValue + "' has been ignored.";
+// tmpName or tmpValue will be corrupted at this point due to
+// failed decoding. Have to go to queryMB to get original data
+StringBuilder msg =
+new StringBuilder("Parameters: Character decoding 
failed.");
+msg.append(" Parameter '");
+msg.append(queryMB.toString().substring(nameStart, nameEnd));
+msg.append("' with value '");
+msg.append(queryMB.toString().substring(valStart, valEnd));
+msg.append("' has been ignored.");
 if (log.isDebugEnabled()) {
 log.debug(msg, e);
 } else {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:07:39 2009
New Revision: 786469

URL: http://svn.apache.org/viewvc?rev=786469&view=rev
Log:
Add patch to address Filip and Konstantin's review comments
I have assumed Filip is still +1 for this

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=786469&r1=786468&r2=786469&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 12:07:39 2009
@@ -200,39 +200,9 @@
 
 * Make diagnosing broken requests a little easier
   http://svn.apache.org/viewvc?rev=783724&view=rev
-  +1: markt
-  +1: fhanik - StringBuffer never hurts
-  -1: kkolinko: (
-Regarding the first part of the patch:
- Try 
http://localhost:8080/examples/servlets/servlet/RequestParamExample?firstname=&lastname=;
- The "Invalid chunk" message prints garbage.
-
- I wonder, whether I can trigger an NPE here.
-
- There should be
-   msg.append(new String(bytes, nameStart, valEnd-nameStart));
-
- But if I make that change, it prints just an empty string:
- WARNING: Parameters: Invalid chunk '' ignored.
- and that is not very informative.
-
- Actually, I do not see how "Invalid chunk" can be triggered, unless
- there is "&&" in the query string, and in that case the chunk is empty.
-
- Also, I would prefer StringBuilder in code that runs on 1.5+ JVM.
-
-   Regarding the second part:
- Try 
http://localhost:8080/examples/servlets/servlet/RequestParamExample?firstname=%EC%E0%F8%E&lastname=%F1%E0%F8%E0
-
- The following is printed, and contains garbage:
- WARNING: Parameters: Character decoding failed. Parameter 'firstname' 
with value '???%E0%F8%E' has been ignored.
-
- Also, if there is encoding error, e.g. I have URIEncoding="UTF-8" on my 
connector,
- but I try submitting in windows-1251, like
- 
http://localhost:8080/examples/servlets/servlet/RequestParamExample?firstname=%EC%E0%F8%E0&lastname=%F1%E0%F8%E0
- nothing is printed at all. I am not against this feature,
- but we may want to adjust the text of the message.
-  )
+  http://svn.apache.org/viewvc?rev=786468&view=rev
+  +1: markt, fhanik
+  -1: 
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47343
   Regression in fix for



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786471 - in /tomcat/trunk: java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/manager/ java/org/apache/catalina/servlets/ j

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:10:05 2009
New Revision: 786471

URL: http://svn.apache.org/viewvc?rev=786471&view=rev
Log:
The servletapi gives us a perfectly good constant for 
'javax.servlet.context.tempdir'. Use it.

Modified:
tomcat/trunk/java/org/apache/catalina/Globals.java
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
tomcat/trunk/java/org/apache/catalina/session/FileStore.java
tomcat/trunk/java/org/apache/catalina/session/StandardManager.java
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
tomcat/trunk/java/org/apache/jasper/Constants.java
tomcat/trunk/java/org/apache/jasper/EmbeddedServletOptions.java
tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=786471&r1=786470&r2=786471&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Fri Jun 19 12:10:05 2009
@@ -317,15 +317,6 @@
 
 
 /**
- * The servlet context attribute under which we store a temporary
- * working directory (as an object of type File) for use by servlets
- * within this web application.
- */
-public static final String WORK_DIR_ATTR =
-"javax.servlet.context.tempdir";
-
-
-/**
  * The master flag which controls strict servlet specification 
  * compliance.
  */

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=786471&r1=786470&r2=786471&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Fri Jun 19 
12:10:05 2009
@@ -5122,10 +5122,10 @@
 dir.mkdirs();
 
 // Set the appropriate servlet context attribute
-getServletContext().setAttribute(Globals.WORK_DIR_ATTR, dir);
+getServletContext().setAttribute(ServletContext.TEMPDIR, dir);
 if (getServletContext() instanceof ApplicationContext)
 ((ApplicationContext) getServletContext()).setAttributeReadOnly
-(Globals.WORK_DIR_ATTR);
+(ServletContext.TEMPDIR);
 
 }
 

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=786471&r1=786470&r2=786471&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Fri Jun 19 
12:10:05 2009
@@ -792,7 +792,7 @@
 
 // Assigning permissions for the work directory
 File workDir =
-(File) servletContext.getAttribute(Globals.WORK_DIR_ATTR);
+(File) servletContext.getAttribute(ServletContext.TEMPDIR);
 if (workDir != null) {
 try {
 String workDirPath = workDir.getCanonicalPath();
@@ -883,7 +883,7 @@
 loaderRepositories=new ArrayList();
 // Loading the work directory
 File workDir =
-(File) servletContext.getAttribute(Globals.WORK_DIR_ATTR);
+(File) servletContext.getAttribute(ServletContext.TEMPDIR);
 if (workDir == null) {
 log.info("No work dir for " + servletContext);
 }

Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=786471&r1=786470&r2=786471&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Fri 
Jun 19 12:10:05 2009
@@ -31,6 +31,8 @@
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+
+import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -175,7 +177,7 @@
 
 // Get the tempdir
 File temp

svn commit: r786473 - in /tomcat/trunk: java/org/apache/catalina/valves/AccessLogValve.java java/org/apache/jasper/compiler/JspRuntimeContext.java test/org/apache/catalina/connector/TestRequest.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:16:25 2009
New Revision: 786473

URL: http://svn.apache.org/viewvc?rev=786473&view=rev
Log:
Undo accidental commit of files that should not have been included in r786471. 
These will follow separately with the correct comments. Sorry for the noise.

Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786473&r1=786472&r2=786473&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 19 
12:16:25 2009
@@ -690,12 +690,10 @@
 }
 
 // Log this message
-synchronized(this) {
-if (writer != null) {
-writer.println(message);
-if (!buffered) {
-writer.flush();
-}
+if (writer != null) {
+writer.println(message);
+if (!buffered) {
+writer.flush();
 }
 }
 

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=786473&r1=786472&r2=786473&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Fri Jun 
19 12:16:25 2009
@@ -394,19 +394,16 @@
 docBase = docBase + "-";
 permissionCollection.add(new FilePermission(docBase,"read"));
 
-// Spec says apps should have read/write for their temp
-// directory. This is fine, as no security sensitive files, at
-// least any that the app doesn't have full control of anyway,
-// will be written here.
+// Create a file read permission for web app tempdir (work)
+// directory
 String workDir = options.getScratchDir().toString();
 if (!workDir.endsWith(File.separator)){
 permissionCollection.add
-(new FilePermission(workDir,"read,write"));
+(new FilePermission(workDir,"read"));
 workDir = workDir + File.separator;
 }
 workDir = workDir + "-";
-permissionCollection.add(new FilePermission(
-workDir,"read,write,delete"));
+permissionCollection.add(new FilePermission(workDir,"read"));
 
 // Allow the JSP to access 
org.apache.jasper.runtime.HttpJspBase
 permissionCollection.add( new RuntimePermission(

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=786473&r1=786472&r2=786473&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java Fri Jun 19 
12:16:25 2009
@@ -56,41 +56,35 @@
 Bug37794Client client = new Bug37794Client();
 
 // Edge cases around zero
-client.doRequest(-1, false); // Unlimited
+client.doRequest(-1); // Unlimited
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(0, false); // Unlimited
+client.doRequest(0); // Unlimited
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(1, false); // 1 byte - too small should fail
+client.doRequest(1); // 1 byte - too small should fail
 assertTrue(client.isResponse500());
 
 client.reset();
 
 // Edge cases around actual content length
 client.reset();
-client.doRequest(6, false); // Too small should fail
+client.doRequest(6); // Too small should fail
 assertTrue(client.isResponse500());
 client.reset();
-client.doRequest(7, false); // Just enough should pass
+client.doRequest(7); // Just enough should pass
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(8, false); // 1 extra - should pass
+client.doReques

Re: svn commit: r786471 - in /tomcat/trunk: java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/manager/ java/org/apache/catalina/servlet

2009-06-19 Thread Tim Funk

Where these meant to be included?
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786471&r1=786470&r2=786471&view=diff
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=786471&r1=786470&r2=786471&view=diff
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=786471&r1=786470&r2=786471&view=diff


ma...@apache.org wrote:

Author: markt
Date: Fri Jun 19 12:10:05 2009
New Revision: 786471

URL: http://svn.apache.org/viewvc?rev=786471&view=rev
Log:
The servletapi gives us a perfectly good constant for 
'javax.servlet.context.tempdir'. Use it.




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786471 - in /tomcat/trunk: java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/manager/ java/org/apache/catalina/servlet

2009-06-19 Thread Mark Thomas
Tim Funk wrote:
> Where these meant to be included?

No. Finger trouble on my part. Different tools with different default
behaviour for the enter key. Should already be fixed.

Mark

> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786471&r1=786470&r2=786471&view=diff
> 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=786471&r1=786470&r2=786471&view=diff
> 
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=786471&r1=786470&r2=786471&view=diff
> 
> 
> 
> ma...@apache.org wrote:
>> Author: markt
>> Date: Fri Jun 19 12:10:05 2009
>> New Revision: 786471
>>
>> URL: http://svn.apache.org/viewvc?rev=786471&view=rev
>> Log:
>> The servletapi gives us a perfectly good constant for
>> 'javax.servlet.context.tempdir'. Use it.
>>
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786477 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread kkolinko
Author: kkolinko
Date: Fri Jun 19 12:27:08 2009
New Revision: 786477

URL: http://svn.apache.org/viewvc?rev=786477&view=rev
Log:
Rewrote the benchmarks, to allow more than 2 different implementations to be 
compared.

Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786477&r1=786476&r2=786477&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
12:27:08 2009
@@ -31,23 +31,26 @@
 public class Benchmarks extends TestCase {
 public void testAccessLogGetDate() throws Exception {
 // Is it better to use a sync or a thread local here?
-BenchmarkTest getDate = new GetDateBenchmarkTest();
-getDate.doTest(5);
+BenchmarkTest benchmark = new BenchmarkTest();
+Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(),
+new GetDateBenchmarkTest_Local() };
+benchmark.doTest(5, tests);
 }
 
-private static class GetDateBenchmarkTest extends BenchmarkTest {
+private static class GetDateBenchmarkTest_Sync implements Runnable {
+
+public String toString() {
+return "Syncs";
+}
+
 private volatile long currentMillis = 0;
 private volatile Date currentDate = null;
 
-private ThreadLocal currentMillisLocal = new ThreadLocal() 
{
-protected Long initialValue() {
-return Long.valueOf(0);
-}
-};
-
-private ThreadLocal currentDateLocal = new ThreadLocal();
+public void run() {
+getCurrentDate();
+}
 
-public Object doSync() {
+public Date getCurrentDate() {
 long systime = System.currentTimeMillis();
 if ((systime - currentMillis) > 1000) {
 synchronized (this) {
@@ -57,67 +60,83 @@
 }
 }
 }
-return currentDate; 
+return currentDate;
+}
+}
+
+private static class GetDateBenchmarkTest_Local implements Runnable {
+
+public String toString() {
+return "ThreadLocals";
+}
+
+private ThreadLocal currentMillisLocal = new ThreadLocal() 
{
+protected Long initialValue() {
+return Long.valueOf(0);
+}
+};
+
+private ThreadLocal currentDateLocal = new ThreadLocal();
+
+public void run() {
+getCurrentDate();
 }
-
-public Object doLocal() {
+
+public Date getCurrentDate() {
 long systime = System.currentTimeMillis();
 if ((systime - currentMillisLocal.get().longValue()) > 1000) {
 currentDateLocal.set(new Date(systime));
 currentMillisLocal.set(Long.valueOf(systime));
 }
-return currentDateLocal.get();  
+return currentDateLocal.get();
 }
 }
 
-
 public void testAccessLogTimeDateElement() throws Exception {
 // Is it better to use a sync or a thread local here?
-BenchmarkTest timeDateElement = new TimeDateElementBenchmarkTest();
-timeDateElement.doTest(5);
+BenchmarkTest benchmark = new BenchmarkTest();
+Runnable[] tests = new Runnable[] {
+new TimeDateElementBenchmarkTest_Sync(),
+new TimeDateElementBenchmarkTest_Local() };
+benchmark.doTest(5, tests);
 }
 
-private static class TimeDateElementBenchmarkTest extends BenchmarkTest {
+private static abstract class TimeDateElementBenchmarkTestBase {
+protected static final String months[] = { "Jan", "Feb", "Mar", "Apr",
+"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+
+protected String lookup(String month) {
+int index;
+try {
+index = Integer.parseInt(month) - 1;
+} catch (Throwable t) {
+index = 0; // Can not happen, in theory
+}
+return (months[index]);
+}
+}
+
+private static class TimeDateElementBenchmarkTest_Sync extends
+TimeDateElementBenchmarkTestBase implements Runnable {
+
+public String toString() {
+return "Syncs";
+}
+
 private volatile long currentMillis = 0;
 private volatile Date currentDate = null;
 private String currentDateString = null;
 private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
 private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
 private SimpleDateFormat yearFormatter = new SimpleDateFormat("");
-

Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Konstantin Kolinko
Mark,

I rewrote the benchmark to allow more than two implementations to be compared.

A test now implements Runnable and its toString() prints the variable
part of the message.

It was fun running these tests. I will detail my observations later.

My thought is that the main difference in time comes from
"if (xxx > 1000) {"
part, and how many times for each second it is triggered. If it is
triggered only once, the performance is better.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786483 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:40:56 2009
New Revision: 786483

URL: http://svn.apache.org/viewvc?rev=786483&view=rev
Log:
Add an additional volatile from a review of the associated benchmark tests.
Add a sync

Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786483&r1=786482&r2=786483&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 19 
12:40:56 2009
@@ -281,7 +281,7 @@
  * The system time when we last updated the Date that this valve
  * uses for log lines.
  */
-private Date currentDate = null;
+private volatile Date currentDate = null;
 
 private volatile long currentMillis = 0;
 
@@ -690,10 +690,12 @@
 }
 
 // Log this message
-if (writer != null) {
-writer.println(message);
-if (!buffered) {
-writer.flush();
+synchronized(this) {
+if (writer != null) {
+writer.println(message);
+if (!buffered) {
+writer.flush();
+}
 }
 }
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn propchange: r786483 - svn:log

2009-06-19 Thread markt
Author: markt
Revision: 786483
Modified property: svn:log

Modified: svn:log at Fri Jun 19 12:49:51 2009
--
--- svn:log (original)
+++ svn:log Fri Jun 19 12:49:51 2009
@@ -1,2 +1,2 @@
 Add an additional volatile from a review of the associated benchmark tests.
-Add a sync
+Add a sync to deal with the issue filip reported in the 5.5.x status file


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786484 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread kkolinko
Author: kkolinko
Date: Fri Jun 19 12:51:11 2009
New Revision: 786484

URL: http://svn.apache.org/viewvc?rev=786484&view=rev
Log:
Added toString() call to the StringBuffer. The tests will run a bit slower 
because of that.
Added two other implementation variants for the first test.

Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786484&r1=786483&r2=786484&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
12:51:11 2009
@@ -33,7 +33,9 @@
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
 Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(),
-new GetDateBenchmarkTest_Local() };
+new GetDateBenchmarkTest_Local(),
+new GetDateBenchmarkTest_LocalMutableLong(),
+new GetDateBenchmarkTest_LocalStruct() };
 benchmark.doTest(5, tests);
 }
 
@@ -92,6 +94,72 @@
 }
 }
 
+private static class GetDateBenchmarkTest_LocalMutableLong implements
+Runnable {
+
+public String toString() {
+return "ThreadLocals with a mutable Long";
+}
+
+private static class MutableLong {
+long value = 0;
+}
+
+private ThreadLocal currentMillisLocal = new 
ThreadLocal() {
+protected MutableLong initialValue() {
+return new MutableLong();
+}
+};
+
+private ThreadLocal currentDateLocal = new ThreadLocal();
+
+public void run() {
+getCurrentDate();
+}
+
+public Date getCurrentDate() {
+long systime = System.currentTimeMillis();
+if ((systime - currentMillisLocal.get().value) > 1000) {
+currentDateLocal.set(new Date(systime));
+currentMillisLocal.get().value = systime;
+}
+return currentDateLocal.get();
+}
+}
+
+private static class GetDateBenchmarkTest_LocalStruct implements Runnable {
+
+public String toString() {
+return "single ThreadLocal";
+}
+
+// note, that we can avoid (long -> Long) conversion
+private static class Struct {
+long currentMillis = 0;
+Date currentDate;
+}
+
+private ThreadLocal currentStruct = new ThreadLocal() {
+protected Struct initialValue() {
+return new Struct();
+}
+};
+
+public void run() {
+getCurrentDate();
+}
+
+public Date getCurrentDate() {
+Struct struct = currentStruct.get();
+long systime = System.currentTimeMillis();
+if ((systime - struct.currentMillis) > 1000) {
+struct.currentDate = new Date(systime);
+struct.currentMillis = systime;
+}
+return struct.currentDate;
+}
+}
+
 public void testAccessLogTimeDateElement() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
@@ -136,7 +204,7 @@
 printDate();
 }
 
-public StringBuffer printDate() {
+public String printDate() {
 StringBuffer buf = new StringBuffer();
 Date date = getDateSync();
 if (currentDate != date) {
@@ -158,7 +226,7 @@
 }
 }
 buf.append(currentDateString);
-return buf;
+return buf.toString();
 }
 
 private Date getDateSync() {
@@ -216,7 +284,7 @@
 printDate();
 }
 
-public StringBuffer printDate() {
+public String printDate() {
 StringBuffer buf = new StringBuffer();
 Date date = getDateLocal();
 if (currentDate != date) {
@@ -234,7 +302,7 @@
 currentDate = date;
 }
 buf.append(currentDateString);
-return buf;
+return buf.toString();
 }
 
 private Date getDateLocal() {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786486 - /tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:55:56 2009
New Revision: 786486

URL: http://svn.apache.org/viewvc?rev=786486&view=rev
Log:
Add a header case-sensitivity test for 37794 test case (as reported by Tim)

Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=786486&r1=786485&r2=786486&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java Fri Jun 19 
12:55:56 2009
@@ -56,35 +56,41 @@
 Bug37794Client client = new Bug37794Client();
 
 // Edge cases around zero
-client.doRequest(-1); // Unlimited
+client.doRequest(-1, false); // Unlimited
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(0); // Unlimited
+client.doRequest(0, false); // Unlimited
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(1); // 1 byte - too small should fail
+client.doRequest(1, false); // 1 byte - too small should fail
 assertTrue(client.isResponse500());
 
 client.reset();
 
 // Edge cases around actual content length
 client.reset();
-client.doRequest(6); // Too small should fail
+client.doRequest(6, false); // Too small should fail
 assertTrue(client.isResponse500());
 client.reset();
-client.doRequest(7); // Just enough should pass
+client.doRequest(7, false); // Just enough should pass
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 client.reset();
-client.doRequest(8); // 1 extra - should pass
+client.doRequest(8, false); // 1 extra - should pass
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 
 // Much larger
 client.reset();
-client.doRequest(8096); // Plenty of space - should pass
+client.doRequest(8096, false); // Plenty of space - should pass
+assertTrue(client.isResponse200());
+assertTrue(client.isResponseBodyOK());
+
+// Check for case insensitivity
+client.reset();
+client.doRequest(8096, true); // Plenty of space - should pass
 assertTrue(client.isResponse200());
 assertTrue(client.isResponseBodyOK());
 }
@@ -115,7 +121,7 @@
  * Bug 37794 test client.
  */
 private static class Bug37794Client extends SimpleHttpClient {
-private Exception doRequest(int postLimit) {
+private Exception doRequest(int postLimit, boolean ucChunkedHead) {
 Tomcat tomcat = new Tomcat();
 try {
 StandardContext root = tomcat.addContext("", TEMP_DIR);
@@ -129,14 +135,25 @@
 
 // Send request in two parts
 String[] request = new String[2];
-request[0] =
-"POST http://localhost:8080/test HTTP/1.1" + CRLF +
-"content-type: application/x-www-form-urlencoded" + CRLF +
-"Transfer-Encoding: chunked" + CRLF +
-"Connection: close" + CRLF +
-CRLF +
-"3" + CRLF +
-"a=1" + CRLF;
+if (ucChunkedHead) {
+request[0] =
+"POST http://localhost:8080/test HTTP/1.1" + CRLF +
+"content-type: application/x-www-form-urlencoded" + 
CRLF +
+"Transfer-Encoding: CHUNKED" + CRLF +
+"Connection: close" + CRLF +
+CRLF +
+"3" + CRLF +
+"a=1" + CRLF;
+} else {
+request[0] =
+"POST http://localhost:8080/test HTTP/1.1" + CRLF +
+"content-type: application/x-www-form-urlencoded" + 
CRLF +
+"Transfer-Encoding: chunked" + CRLF +
+"Connection: close" + CRLF +
+CRLF +
+"3" + CRLF +
+"a=1" + CRLF;
+}
 request[1] =
 "4" + CRLF +
 "&b=2" + CRLF +



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786487 - /tomcat/trunk/java/org/apache/catalina/connector/Request.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 12:56:40 2009
New Revision: 786487

URL: http://svn.apache.org/viewvc?rev=786487&view=rev
Log:
Headers should be compared ignoring case. Reported by Tim F.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/Request.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=786487&r1=786486&r2=786487&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Jun 19 
12:56:40 2009
@@ -2524,7 +2524,7 @@
 return;
 }
 parameters.processParameters(formData, 0, len);
-} else if ("chunked".equals(
+} else if ("chunked".equalsIgnoreCase(
 coyoteRequest.getHeader("transfer-encoding"))) {
 byte[] formData = null;
 try {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:00:29 2009
New Revision: 786489

URL: http://svn.apache.org/viewvc?rev=786489&view=rev
Log:
Add additional required patch

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=786489&r1=786488&r2=786489&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 13:00:29 2009
@@ -245,6 +245,7 @@
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37794
   Handle chunked POSTs. If maxPostSize is exceeded, a 500 results
   http://svn.apache.org/viewvc?rev=785381&view=rev
+  http://svn.apache.org/viewvc?rev=786487&view=rev
   +1: markt
   -1: 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786490 - /tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:03:42 2009
New Revision: 786490

URL: http://svn.apache.org/viewvc?rev=786490&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38352
The JSPLoader needs to have read/write permission to the context's temp 
directory, as per the spec.

Modified:
tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=786490&r1=786489&r2=786490&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Fri Jun 
19 13:03:42 2009
@@ -394,16 +394,19 @@
 docBase = docBase + "-";
 permissionCollection.add(new FilePermission(docBase,"read"));
 
-// Create a file read permission for web app tempdir (work)
-// directory
+// Spec says apps should have read/write for their temp
+// directory. This is fine, as no security sensitive files, at
+// least any that the app doesn't have full control of anyway,
+// will be written here.
 String workDir = options.getScratchDir().toString();
 if (!workDir.endsWith(File.separator)){
 permissionCollection.add
-(new FilePermission(workDir,"read"));
+(new FilePermission(workDir,"read,write"));
 workDir = workDir + File.separator;
 }
 workDir = workDir + "-";
-permissionCollection.add(new FilePermission(workDir,"read"));
+permissionCollection.add(new FilePermission(
+workDir,"read,write,delete"));
 
 // Allow the JSP to access 
org.apache.jasper.runtime.HttpJspBase
 permissionCollection.add( new RuntimePermission(



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:05:52 2009
New Revision: 786491

URL: http://svn.apache.org/viewvc?rev=786491&view=rev
Log:
Propose fix

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=786491&r1=786490&r2=786491&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 13:05:52 2009
@@ -279,3 +279,9 @@
 
  +1: fhanik
  -1: 
+
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38352
+  JSPs should have read/write access to the context's temp dir
+  http://svn.apache.org/viewvc?rev=786490&view=rev
+  +1: markt
+  -1: 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 38352] Additional Entries for Default catalina.policy file.

2009-06-19 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=38352





--- Comment #7 from Mark Thomas   2009-06-19 06:06:24 PST ---
Not quite.

The javax.servlet.context.tempdir is a context attribute rather than a system
property. There is a complication that the name of the work directory varies
per context and is not know when the policy file is parsed.

In trunk, 6.0.x and 5.5.x the WebappLoader sets the necessary permissions when
it is started. However, the JasperLoader gets its permissions from the
JspRuntimeContext that only gave a read permission for those files.

I have patched trunk to give JasperLoader read/write and proposed the fix for
6.0.x and 5.5.x

-- 
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 38352] Additional Entries for Default catalina.policy file.

2009-06-19 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=38352


Mark Thomas  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW




--- Comment #8 from Mark Thomas   2009-06-19 06:06:51 PST ---
Update status

-- 
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786494 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:07:28 2009
New Revision: 786494

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

Modified:
tomcat/current/tc5.5.x/STATUS.txt

Modified: tomcat/current/tc5.5.x/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=786494&r1=786493&r2=786494&view=diff
==
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Fri Jun 19 13:07:28 2009
@@ -148,3 +148,9 @@
   http://svn.apache.org/viewvc?rev=785381&view=rev
   +1: markt
   -1: 
+
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38352
+  JSPs should have read/write access to the context's temp dir
+  http://svn.apache.org/viewvc?rev=786490&view=rev
+  +1: markt
+  -1: 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786495 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:08:02 2009
New Revision: 786495

URL: http://svn.apache.org/viewvc?rev=786495&view=rev
Log:
Add extra patch required

Modified:
tomcat/current/tc5.5.x/STATUS.txt

Modified: tomcat/current/tc5.5.x/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=786495&r1=786494&r2=786495&view=diff
==
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Fri Jun 19 13:08:02 2009
@@ -146,6 +146,7 @@
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37794
   Handle chunked POSTs. If maxPostSize is exceeded, a 500 results
   http://svn.apache.org/viewvc?rev=785381&view=rev
+  http://svn.apache.org/viewvc?rev=786487&view=rev
   +1: markt
   -1: 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786496 - /tomcat/trunk/build.properties.default

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:11:00 2009
New Revision: 786496

URL: http://svn.apache.org/viewvc?rev=786496&view=rev
Log:
Update to pool 1.5.1 - fixes regression in 1.5

Modified:
tomcat/trunk/build.properties.default

Modified: tomcat/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=786496&r1=786495&r2=786496&view=diff
==
--- tomcat/trunk/build.properties.default (original)
+++ tomcat/trunk/build.properties.default Fri Jun 19 13:11:00 2009
@@ -74,8 +74,8 @@
 
commons-dbcp-src.loc=http://people.apache.org/~markt/dev/commons-dbcp-r734404-src.tar.gz
 
 # - Commons Pool, version 1.1 or later -
-commons-pool.home=${base.path}/commons-pool-1.5-src
-commons-pool-src.loc=${base-commons.loc}/pool/source/commons-pool-1.5-src.tar.gz
+commons-pool.home=${base.path}/commons-pool-1.5.1-src
+commons-pool-src.loc=${base-commons.loc}/pool/source/commons-pool-1.5.1-src.tar.gz
 
 # - NSIS, version 2.0 or later -
 nsis.home=${base.path}/nsis-2.44



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786498 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:13:35 2009
New Revision: 786498

URL: http://svn.apache.org/viewvc?rev=786498&view=rev
Log:
Propose pool update

Modified:
tomcat/current/tc5.5.x/STATUS.txt

Modified: tomcat/current/tc5.5.x/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=786498&r1=786497&r2=786498&view=diff
==
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Fri Jun 19 13:13:35 2009
@@ -155,3 +155,11 @@
   http://svn.apache.org/viewvc?rev=786490&view=rev
   +1: markt
   -1: 
+
+* Update to Apache Commons Pool 1.5.1
+  Various fixes to prevent deadlocks, reduce syncs and make object allocation
+  occur fair - ie objects are allocated to threads in the order that the 
threads
+  request them. Fixes a number of issues in DBCP.
+  http://svn.apache.org/viewvc?rev=786496&view=rev
+  +1: markt
+  -1:



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 13:13:53 2009
New Revision: 786499

URL: http://svn.apache.org/viewvc?rev=786499&view=rev
Log:
Propose pool update

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=786499&r1=786498&r2=786499&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 13:13:53 2009
@@ -285,3 +285,11 @@
   http://svn.apache.org/viewvc?rev=786490&view=rev
   +1: markt
   -1: 
+
+* Update to Apache Commons Pool 1.5.1
+  Various fixes to prevent deadlocks, reduce syncs and make object allocation
+  occur fair - ie objects are allocated to threads in the order that the 
threads
+  request them. Fixes a number of issues in DBCP.
+  http://svn.apache.org/viewvc?rev=786496&view=rev
+  +1: markt
+  -1:



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Duplicate code in AccessLogValve

2009-06-19 Thread sebb
Just spotted this duplicate code in AccessLogValve:

661:if (!dateStamp.equals(tsDate)) {
662:if (!dateStamp.equals(tsDate)) {

Not sure this double-checked looking offers any benefit ;-)

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Modified dist.xml to produce platform native packages

2009-06-19 Thread Mark Thomas
> From: Mladen Turk 

> I suppose the .sh files have LF line endings even in .zip,
> and those are the only one critical.

I believe they do (I'm not near my pc so can't check) and if they don't, I'd be 
+1 for changing the build scipts so they do.

Mark


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Duplicate code in AccessLogValve

2009-06-19 Thread sebb
On 19/06/2009, sebb  wrote:
> Just spotted this duplicate code in AccessLogValve:
>
>  661:if (!dateStamp.equals(tsDate)) {
>  662:if (!dateStamp.equals(tsDate)) {
>
>  Not sure this double-checked looking offers any benefit ;-)
>

Line 767 is also no longer needed, as currentMillis is now volatile:

765:if ((systime - currentMillis) > 1000) {
766:synchronized (this) {
767:if ((systime - currentMillis) > 1000) {

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Duplicate code in AccessLogValve

2009-06-19 Thread Xie Xiaodong
No, I think line767 is still needed. You could turn to the last part of this
article for reference: "
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html";.



2009/6/19 sebb 

> On 19/06/2009, sebb  wrote:
> > Just spotted this duplicate code in AccessLogValve:
> >
> >  661:if (!dateStamp.equals(tsDate)) {
> >  662:if (!dateStamp.equals(tsDate)) {
> >
> >  Not sure this double-checked looking offers any benefit ;-)
> >
>
> Line 767 is also no longer needed, as currentMillis is now volatile:
>
> 765:if ((systime - currentMillis) > 1000) {
> 766:synchronized (this) {
> 767:if ((systime - currentMillis) > 1000) {
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


-- 
Sincerely yours and Best Regards,
Xie Xiaodong


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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 14:55:07 2009
New Revision: 786527

URL: http://svn.apache.org/viewvc?rev=786527&view=rev
Log:
Votes and a comment

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=786527&r1=786526&r2=786527&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 14:55:07 2009
@@ -239,7 +239,7 @@
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47369.
   http://svn.apache.org/viewvc?rev=784879&view=rev
-  +1: fhanik
+  +1: fhanik, markt
   -1: 
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37794
@@ -254,11 +254,13 @@
   http://svn.apache.org/viewvc?rev=785768&view=rev
   http://svn.apache.org/viewvc?rev=785859&view=rev
   +1: kkolinko
+  +1: markt - I don't like commenting out code - if it isn't needed just 
delete it
+- This is fine for 6.0.x, for trunk 1.6 is the minimum
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47389
   http://svn.apache.org/viewvc?rev=786124&view=rev
-  +1: fhanik
+  +1: fhanik, markt
   -1: 
 
 * Fix bug (revert commit)
@@ -277,7 +279,7 @@
if(log.isInfoEnabled())
  log.info("Setting multihome multicast interface to:" 
+mcastBindAddress);
 
- +1: fhanik
+ +1: fhanik, markt
  -1: 
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38352



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786530 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 15:00:18 2009
New Revision: 786530

URL: http://svn.apache.org/viewvc?rev=786530&view=rev
Log:
Votes

Modified:
tomcat/current/tc5.5.x/STATUS.txt

Modified: tomcat/current/tc5.5.x/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=786530&r1=786529&r2=786530&view=diff
==
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Fri Jun 19 15:00:18 2009
@@ -97,7 +97,7 @@
   For zip/tgz distributives it was already fixed in 6.0.17, 5.5.27.
   Now, apply the same fix to exe distributive.
   http://svn.apache.org/viewvc?rev=776945&view=rev
-  +1: kkolinko, fhanik
+  +1: kkolinko, fhanik, markt
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43343
@@ -111,14 +111,14 @@
 * Additional patches:
   http://svn.apache.org/viewvc?rev=784453&view=rev
   http://svn.apache.org/viewvc?rev=784602&view=rev
-  +1: kkolinko
+  +1: kkolinko, markt
   -1:
 
 * Fix wrong download location of tcnative 1.1.16
   Patch for "build/build.properties.default":
   
http://people.apache.org/~kkolinko/patches/2009-05-25_fix_tcnative_download.patch
   +1: kkolinko, fhanik
-  -1:
+  -1: markt - the updated location is still wrong
 
 * Make 64-bit binaries/installer available for 5.5.x as well as 6.0.x
   http://svn.apache.org/viewvc?rev=777624&view=rev 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786532 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread fhanik
Author: fhanik
Date: Fri Jun 19 15:05:04 2009
New Revision: 786532

URL: http://svn.apache.org/viewvc?rev=786532&view=rev
Log:
Correct per sebb/markt

Modified:
tomcat/trunk/modules/jdbc-pool/NOTICE

Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786532&r1=786531&r2=786532&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
+++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 15:05:04 2009
@@ -1,3 +1,3 @@
+This product includes software developed by The Apache Software Foundation 
(http://www.apache.org/)
 Apache Tomcat JDBC Pool
 Copyright 1999-2009 The Apache Software Foundation
-Copyright 2008-2009 Filip Hanik



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786540 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 15:12:02 2009
New Revision: 786540

URL: http://svn.apache.org/viewvc?rev=786540&view=rev
Log:
Remove duplicate code - my bad from r781779. Thanks to sebb for spotting it.

Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786540&r1=786539&r2=786540&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 19 
15:12:02 2009
@@ -659,11 +659,9 @@
 
 // If the date has changed, switch log files
 if (!dateStamp.equals(tsDate)) {
-if (!dateStamp.equals(tsDate)) {
-close();
-dateStamp = tsDate;
-open();
-}
+close();
+dateStamp = tsDate;
+open();
 }
 }
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Duplicate code in AccessLogValve

2009-06-19 Thread sebb
On 19/06/2009, Xie Xiaodong  wrote:
> No, I think line767 is still needed. You could turn to the last part of this
>  article for reference: "
>  http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html";.

Oops, my bad.
The code would still work, but it would sometimes create a new Date
unecessarily.

>
>
>  2009/6/19 sebb 
>
>
>  > On 19/06/2009, sebb  wrote:
>  > > Just spotted this duplicate code in AccessLogValve:
>  > >
>  > >  661:if (!dateStamp.equals(tsDate)) {
>  > >  662:if (!dateStamp.equals(tsDate)) {
>  > >
>  > >  Not sure this double-checked looking offers any benefit ;-)
>  > >
>  >
>  > Line 767 is also no longer needed, as currentMillis is now volatile:
>  >
>  > 765:if ((systime - currentMillis) > 1000) {
>  > 766:synchronized (this) {
>  > 767:if ((systime - currentMillis) > 1000) {
>  >
>
> > -
>  > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  > For additional commands, e-mail: dev-h...@tomcat.apache.org
>  >
>  >
>
>
>  --
>  Sincerely yours and Best Regards,
>
> Xie Xiaodong
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[CANCELLED] Re: [VOTE] Release JDBC Pool module v1.0.4

2009-06-19 Thread Filip Hanik - Dev Lists
There is an incorrect NOTICE file, I missed the actual message trying to 
be told to me in all the noise. my apologies


Filip

Filip Hanik - Dev Lists wrote:

Cleaned up and fixed.

The release is located here:
http://people.apache.org/~fhanik/jdbc-pool/v1.0.4/


[ ] STABLE - I couldn't find any bugs
[ ] BETA   - I found some bugs but not critical
[ ] BROKEN - I found some show stoppers


Any comments ?

Thanks,
Filip


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786532 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread sebb
On 19/06/2009, fha...@apache.org  wrote:
> Author: fhanik
>  Date: Fri Jun 19 15:05:04 2009
>  New Revision: 786532
>
>  URL: http://svn.apache.org/viewvc?rev=786532&view=rev
>  Log:
>  Correct per sebb/markt

Sorry, but this is still incorrect.

The NOTICE is now:

>>>
This product includes software developed by The Apache Software
Foundation (http://www.apache.org/)
Apache Tomcat JDBC Pool
Copyright 1999-2009 The Apache Software Foundation
<<<

whereas it should be:

>>>
Apache Tomcat JDBC Pool
Copyright 2008-2009 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/)
<<<

as I wrote in my original e-mail.

AFAIK the first copyright date needs to be the first year when the
code was first released, rather than when it was first developed; JDBC
Pool was surely not around in 1999?

see also:

http://www.apache.org/legal/src-headers.html#notice-text

for the standard header.

>  Modified:
> tomcat/trunk/modules/jdbc-pool/NOTICE
>
>  Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786532&r1=786531&r2=786532&view=diff
>  
> ==
>  --- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
>  +++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 15:05:04 2009
>  @@ -1,3 +1,3 @@
>  +This product includes software developed by The Apache Software Foundation 
> (http://www.apache.org/)
>   Apache Tomcat JDBC Pool
>   Copyright 1999-2009 The Apache Software Foundation
>  -Copyright 2008-2009 Filip Hanik
>
>
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Filip Hanik - Dev Lists

Mark Thomas wrote:

Filip Hanik - Dev Lists wrote:
  

I'm not sure what we are trying to do in this test, in my mind we are
proving nothing with this test :)



The only purpose of the test is to provide a representative micro
benchmark of the current code vs your suggestion to use ThreadLocals
instead (in the 5.5.x patch file). I wanted to see how much faster
ThreadLocals would be and was surprised to see that they were slower. I
haven't given any thought to why this might be although I am curious.
  
if you are using thread locals, why would you then do comparison with 
the thread local variable with a currentDate volatile variable.

That code for example is wrong.
for example
   public Object doLocal() {
   StringBuffer buf = new StringBuffer();
   Date date = getDateLocal();
   if (currentDate != date) {
This doesn't make sense in a thread local environment. That you do a 
comparison between a volatile global variable to something that only 
gets set in the local variable.
  

The thread safety in AccessLogValve is the fact that the formatters are
not thread safe and can yield some funky dates showing up.



Agreed.

  

And in the ideal solution its just not to wrap everything up in a
synchronized statement.



Not agreed. This needs to be considered in context.
- Syncs aren't that expensive.
  

yes they are, when number of cores go up and clock frequency drops down.

- The microbenchmarks suggest ThreadLocals are actually slightly slower
  

that's cause the test code is wrong.



(at least on the machines I have been testing on - others may have
different results in which case I'd be interested to see what they are)
- If there is a slight delay, it won't impact the request processing
time, it will just delay the thread being released back to the pool. Any
delay harms scalability rather than response time.
- The microbenchmark suggests the times in question are so small as to
not be worth worrying about in the grand scheme of things.

However, now we have the benchmarch, if anyone wants to propose an
alternative scheme they can use the benchmark to a) test out their idea
and b) prove the relative performance improvements.

I accept the test isn't perfect. It is only meant to give an idea of
relative performance but if an alternative approach took 50% of the time
of the current one I'd +1 it in a heartbeat.

  

The other thread safety issue in AccessLogValve is the the rotation of
files, since it seems as one thread can close the file



Agreed. I have a simple patch for this. As the writer already uses a
sync, it will cost very little to put a sync around the use of the
writer to fix this.

  

There are more efficient AccessLogValve, instead of doing all this
comparison crap on every single request, and writing to the file on
every single request.



The comparison really isn't that expensive and the writing is buffered
by default.
  
put some serious traffic on a system, and you'll see a big difference as 
buffers will fill up, and blocking takes place.


  

An example:
1. single back thread updates the currentDateString once a second.



Yep, that is an alternative solution. Obviously currentDateString would
need to be volatile but as long as only the background thread was doing
the updates you could ditch all the syncs.
  
that's fine, since even volatile variables get cached on processor 
caches during reads, and wont get invalidated unless there is a write to 
the variable.

There is already the background processor but this would need to be
separate as the frequency of that is user configurable (and can be
disabled).

  

2. Add the log entries to the queue, who writes out the buffer once a
second.



The writer is buffered by default anyway.
  

That's correct.


If you don't want a background thread, then still the stuff going on in
the Benchmark test is not needed, and the bench mark is far from
efficient and there are other ways of doing it much better than we have
today.



The purpose of the benchmark was to give us some concrete numbers to
compare different approaches. The aim was to get relative performance
numbers rather than absolute ones.

I was a little surprised that ThreadLocal seems to be slower. I still
wonder if I got the test wrong for that but I can't see anything.

  

Writing to a file the way we do it is synchronized, anyway, so the goal
was only to achieve non funky dates.
   PrintWriter.java
   public void println(String x) {
   synchronized (lock) {
   print(x);
   println();
   }
   }



Yep. As I noted above, this means adding the sync to fix the issue you
identified of trying to write during roll-over is relatively low cost.
  
All I merely pointed out, was that the micro benchmark doesn't seem 
really related to the actual stuff in AccessLogValve, as it does some 
funky comparisons.


If it was me doing the date, and making it all threadlocal, with no 
global variables at all
And this will

Re: svn commit: r786532 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread Filip Hanik - Dev Lists

sebb wrote:

On 19/06/2009, fha...@apache.org  wrote:
  

Author: fhanik
 Date: Fri Jun 19 15:05:04 2009
 New Revision: 786532

 URL: http://svn.apache.org/viewvc?rev=786532&view=rev
 Log:
 Correct per sebb/markt



Sorry, but this is still incorrect.

The NOTICE is now:

  
This product includes software developed by The Apache Software

Foundation (http://www.apache.org/)
Apache Tomcat JDBC Pool
Copyright 1999-2009 The Apache Software Foundation
<<<

whereas it should be:

  
Apache Tomcat JDBC Pool

Copyright 2008-2009 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/)
<<<
  

thanks

as I wrote in my original e-mail.

AFAIK the first copyright date needs to be the first year when the
code was first released, rather than when it was first developed; JDBC
Pool was surely not around in 1999?
  

Fixed and reference the original project dependencies in NOTICE file

Filip

see also:

http://www.apache.org/legal/src-headers.html#notice-text

for the standard header.

  

 Modified:
tomcat/trunk/modules/jdbc-pool/NOTICE

 Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
 URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786532&r1=786531&r2=786532&view=diff
 ==
 --- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
 +++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 15:05:04 2009
 @@ -1,3 +1,3 @@
 +This product includes software developed by The Apache Software Foundation 
(http://www.apache.org/)
  Apache Tomcat JDBC Pool
  Copyright 1999-2009 The Apache Software Foundation
 -Copyright 2008-2009 Filip Hanik



 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


  



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786569 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread fhanik
Author: fhanik
Date: Fri Jun 19 16:16:16 2009
New Revision: 786569

URL: http://svn.apache.org/viewvc?rev=786569&view=rev
Log:
correction

Modified:
tomcat/trunk/modules/jdbc-pool/NOTICE

Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786569&r1=786568&r2=786569&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
+++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 16:16:16 2009
@@ -1,3 +1,12 @@
-This product includes software developed by The Apache Software Foundation 
(http://www.apache.org/)
 Apache Tomcat JDBC Pool
-Copyright 1999-2009 The Apache Software Foundation
+Copyright 2008-2009 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
+Logging and JMX capabilities provided by the Apache Tomcat project.
+The original software and related information can be found at 
+http://tomcat.apache.org
+
+



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786569 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread sebb
On 19/06/2009, fha...@apache.org  wrote:
> Author: fhanik
>  Date: Fri Jun 19 16:16:16 2009
>  New Revision: 786569
>
>  URL: http://svn.apache.org/viewvc?rev=786569&view=rev
>  Log:
>  correction
>
>  Modified:
> tomcat/trunk/modules/jdbc-pool/NOTICE
>
>  Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786569&r1=786568&r2=786569&view=diff
>  
> ==
>  --- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
>  +++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 16:16:16 2009
>  @@ -1,3 +1,12 @@
>  -This product includes software developed by The Apache Software Foundation 
> (http://www.apache.org/)
>   Apache Tomcat JDBC Pool
>  -Copyright 1999-2009 The Apache Software Foundation
>  +Copyright 2008-2009 The Apache Software Foundation
>  +
>  +This product includes software developed at
>  +The Apache Software Foundation (http://www.apache.org/).

Good.

>  +
>  +Logging and JMX capabilities provided by the Apache Tomcat project.
>  +The original software and related information can be found at
>  +http://tomcat.apache.org
>  +
>  +

The last paragraph is not necessary, as it is included in the following:

"This product includes software developed at
The Apache Software Foundation (http://www.apache.org/)."

The NOTICE file is supposed to be a short as possible so please can
you remove the last para?


>
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread sebb
On 16/06/2009, Mark Thomas  wrote:
> The (updated) candidates source tarball and derived binaries are
>  available here:
>  http://tomcat.apache.org/dev/dist/apache-tomcat-4.1.40/
>
>  According to the release process, the release based on the 4.0.40 tag is:

Did you mean 4.1.40?

Also, where can I find the tag?

>  [ ] Broken
>  [ ] Alpha
>  [ ] Beta
>  [ ] Stable
>
>  Mark
>
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread Mark Thomas
sebb wrote:
> On 16/06/2009, Mark Thomas  wrote:
>> The (updated) candidates source tarball and derived binaries are
>>  available here:
>>  http://tomcat.apache.org/dev/dist/apache-tomcat-4.1.40/
>>
>>  According to the release process, the release based on the 4.0.40 tag is:
> 
> Did you mean 4.1.40?

Yes.

> Also, where can I find the tag?

It is actually 4 tags (the joys of the Tomcat 4 build process):
http://svn.apache.org/repos/asf/tomcat/connectors/tags/tc4.1.x/TOMCAT_4_1_40/
http://svn.apache.org/repos/asf/tomcat/container/tags/tc4.1.x/TOMCAT_4_1_40/
http://svn.apache.org/repos/asf/tomcat/jasper/tags/tc4.1.x/TOMCAT_4_1_40/
http://svn.apache.org/repos/asf/tomcat/servletapi/tags/servlet2.3-jsp1.2-tc4.x/TOMCAT_4_1_40/

Mark

> 
>>  [ ] Broken
>>  [ ] Alpha
>>  [ ] Beta
>>  [ ] Stable
>>
>>  Mark
>>
>>
>>  -
>>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786584 - /tomcat/trunk/modules/jdbc-pool/NOTICE

2009-06-19 Thread fhanik
Author: fhanik
Date: Fri Jun 19 17:07:36 2009
New Revision: 786584

URL: http://svn.apache.org/viewvc?rev=786584&view=rev
Log:
shortened

Modified:
tomcat/trunk/modules/jdbc-pool/NOTICE

Modified: tomcat/trunk/modules/jdbc-pool/NOTICE
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/NOTICE?rev=786584&r1=786583&r2=786584&view=diff
==
--- tomcat/trunk/modules/jdbc-pool/NOTICE (original)
+++ tomcat/trunk/modules/jdbc-pool/NOTICE Fri Jun 19 17:07:36 2009
@@ -4,9 +4,3 @@
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-
-Logging and JMX capabilities provided by the Apache Tomcat project.
-The original software and related information can be found at 
-http://tomcat.apache.org
-
-



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786585 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 17:13:00 2009
New Revision: 786585

URL: http://svn.apache.org/viewvc?rev=786585&view=rev
Log:
As per Filip's suggestions:
- reduce object creation
- better use of ThreadLocals

Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786585&r1=786584&r2=786585&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
17:13:00 2009
@@ -191,8 +191,7 @@
 return "Syncs";
 }
 
-private volatile long currentMillis = 0;
-private volatile Date currentDate = null;
+private volatile Date currentDate = new Date();
 private String currentDateString = null;
 private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
 private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
@@ -231,11 +230,10 @@
 
 private Date getDateSync() {
 long systime = System.currentTimeMillis();
-if ((systime - currentMillis) > 1000) {
+if ((systime - currentDate.getTime()) > 1000) {
 synchronized (this) {
-if ((systime - currentMillis) > 1000) {
-currentDate = new Date(systime);
-currentMillis = systime;
+if ((systime - currentDate.getTime()) > 1000) {
+currentDate.setTime(systime);
 }
 }
 }
@@ -250,15 +248,13 @@
 return "ThreadLocals";
 }
 
-private volatile Date currentDate = null;
-private String currentDateString = null;
+private ThreadLocal currentDateStringLocal = new 
ThreadLocal();
 
-private ThreadLocal currentMillisLocal = new ThreadLocal() 
{
-protected Long initialValue() {
-return Long.valueOf(0);
+private ThreadLocal currentDateLocal = new ThreadLocal() {
+protected Date initialValue() {
+return new Date();
 }
 };
-private ThreadLocal currentDateLocal = new ThreadLocal();
 private ThreadLocal dayFormatterLocal = new 
ThreadLocal() {
 protected SimpleDateFormat initialValue() {
 return new SimpleDateFormat("dd");
@@ -285,31 +281,28 @@
 }
 
 public String printDate() {
-StringBuffer buf = new StringBuffer();
-Date date = getDateLocal();
-if (currentDate != date) {
+getDateLocal();
+if (currentDateStringLocal.get() == null) {
 StringBuffer current = new StringBuffer(32);
 current.append('[');
-current.append(dayFormatterLocal.get().format(date)); // Day
+
current.append(dayFormatterLocal.get().format(currentDateLocal.get())); // Day
 current.append('/');
-
current.append(lookup(monthFormatterLocal.get().format(date))); // Month
+
current.append(lookup(monthFormatterLocal.get().format(currentDateLocal.get(;
 // Month
 current.append('/');
-current.append(yearFormatterLocal.get().format(date)); // Year
+
current.append(yearFormatterLocal.get().format(currentDateLocal.get())); // Year
 current.append(':');
-current.append(timeFormatterLocal.get().format(date)); // Time
+
current.append(timeFormatterLocal.get().format(currentDateLocal.get())); // Time
 current.append(']');
-currentDateString = current.toString();
-currentDate = date;
+currentDateStringLocal.set(current.toString());
 }
-buf.append(currentDateString);
-return buf.toString();
+return currentDateStringLocal.get();
 }
 
 private Date getDateLocal() {
 long systime = System.currentTimeMillis();
-if ((systime - currentMillisLocal.get().longValue()) > 1000) {
-currentDateLocal.set(new Date(systime));
-currentMillisLocal.set(Long.valueOf(systime));
+if ((systime - currentDateLocal.get().getTime()) > 1000) {
+currentDateLocal.get().setTime(systime);
+currentDateStringLocal.set(null);
 }
 return currentDateLocal.get();
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
> Mark Thomas wrote:
>> I was a little surprised that ThreadLocal seems to be slower. I still
>> wonder if I got the test wrong for that but I can't see anything.
>>
> If it was me doing the date, and making it all threadlocal, with no
> global variables at all
> And this will run faster, even though initially creating the thread
> local map incurs overhead, it doesn't do unnecessary object creation or
> assignment. And there is no need, since we are local at all times.

Thanks for the review. I think I was having a "Can't see the woods for
the trees" moment.

I've made the changes you suggested and lo and behold the ThreadLocal is
quicker.

> testAccessLogGetDate: 16 threads and 1000 iterations using Syncs
> took 7461ms
> testAccessLogGetDate: 16 threads and 1000 iterations using
> ThreadLocals took 6433ms

Out of interest, how many cores are you running? With 4 cores I get a
bigger difference:
org.apache.catalina.valves.Benchmarks$TimeDateElementBenchmarkTest_Sync:
16 threads and 1000 iterations using Syncs took 14359ms
org.apache.catalina.valves.Benchmarks$TimeDateElementBenchmarkTest_Local:
16 threads and 1000 iterations using ThreadLocals took 1532ms

Per request this is still next to nothing. I did think about not
bothering to port the change at all. However, given the possibility for
contention with the various syncs on 'this' in the AccessLogValve, I
will port it as it will be quicker to port it than it would be to write
a better, more representative benchmark for the AccessLogValve.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786530 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread Konstantin Kolinko
>  * Fix wrong download location of tcnative 1.1.16
>   Patch for "build/build.properties.default":
>   
> http://people.apache.org/~kkolinko/patches/2009-05-25_fix_tcnative_download.patch
>   +1: kkolinko, fhanik
> -  -1:
> +  -1: markt - the updated location is still wrong

It points to
http://tomcat.apache.org/dev/dist/tomcat-connectors/native/source/1.1.16/tomcat-native-1.1.16-src.tar.gz

because
base-tomcat.loc=http://tomcat.apache.org/dev/dist

Maybe it should be, as is in 6.0,
base-tomcat.loc=http://archive.apache.org/dist/tomcat

The original link to the native sources will work then.

The current value of base-tomcat.loc in build.properties.default of tc5.5
originates from this rev.:
http://svn.apache.org/viewvc?view=rev&revision=613225

Any concerns?

I agree that it is strange to point to /dev, but maybe we had an unreleased
version placed there at that time, or maybe that value just slipped in.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread Konstantin Kolinko
2009/6/19 
>   http://svn.apache.org/viewvc?rev=785768&view=rev
>   http://svn.apache.org/viewvc?rev=785859&view=rev
>   +1: kkolinko
> +  +1: markt - I don't like commenting out code - if it isn't needed just 
> delete it
> +            - This is fine for 6.0.x, for trunk 1.6 is the minimum
>   -1:
O.K, understood.

I will update trunk to default to 1.6, for both EmbeddedServletOptions and JspC.

It is funny, that compilerTargetVM value in JspC in 6.0 defaults to
"1.4" (that differs from the one in EmbeddedServletOptions), but I do
not feel it is worth to update it to "1.5" there. (The only reason I
might see for that is to align the code with documentation).

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786530 - /tomcat/current/tc5.5.x/STATUS.txt

2009-06-19 Thread Mark Thomas
Konstantin Kolinko wrote:
>>  * Fix wrong download location of tcnative 1.1.16
>>   Patch for "build/build.properties.default":
>>   
>> http://people.apache.org/~kkolinko/patches/2009-05-25_fix_tcnative_download.patch
>>   +1: kkolinko, fhanik
>> -  -1:
>> +  -1: markt - the updated location is still wrong
> 
> It points to
> http://tomcat.apache.org/dev/dist/tomcat-connectors/native/source/1.1.16/tomcat-native-1.1.16-src.tar.gz

That is a really bad place for it to point at. That is the location for
the test builds rather than releases.

> because
> base-tomcat.loc=http://tomcat.apache.org/dev/dist
> 
> Maybe it should be, as is in 6.0,
> base-tomcat.loc=http://archive.apache.org/dist/tomcat

Yep. That is the right location.

> The original link to the native sources will work then.
> 
> The current value of base-tomcat.loc in build.properties.default of tc5.5
> originates from this rev.:
> http://svn.apache.org/viewvc?view=rev&revision=613225
> 
> Any concerns?

Only that I have no idea why I thought that was a good idea.

> I agree that it is strange to point to /dev, but maybe we had an unreleased
> version placed there at that time, or maybe that value just slipped in.

Maybe. I can't remember why I did that. It looks plain wrong with hindsight.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread Mark Thomas
Konstantin Kolinko wrote:
> 2009/6/19 
>>   http://svn.apache.org/viewvc?rev=785768&view=rev
>>   http://svn.apache.org/viewvc?rev=785859&view=rev
>>   +1: kkolinko
>> +  +1: markt - I don't like commenting out code - if it isn't needed just 
>> delete it
>> +- This is fine for 6.0.x, for trunk 1.6 is the minimum
>>   -1:
> O.K, understood.
> 
> I will update trunk to default to 1.6, for both EmbeddedServletOptions and 
> JspC.

Great. Thanks.

> It is funny, that compilerTargetVM value in JspC in 6.0 defaults to
> "1.4" (that differs from the one in EmbeddedServletOptions), but I do
> not feel it is worth to update it to "1.5" there. (The only reason I
> might see for that is to align the code with documentation).

If you get the time, I'd it just to be consistent.

Cheers,

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread sebb
On 19/06/2009, Mark Thomas  wrote:
> sebb wrote:
>  > On 16/06/2009, Mark Thomas  wrote:
>  >> The (updated) candidates source tarball and derived binaries are
>  >>  available here:
>  >>  http://tomcat.apache.org/dev/dist/apache-tomcat-4.1.40/
>  >>
>  >>  According to the release process, the release based on the 4.0.40 tag is:
>  >
>  > Did you mean 4.1.40?
>
>
> Yes.
>
>
>  > Also, where can I find the tag?
>
>
> It is actually 4 tags (the joys of the Tomcat 4 build process):
>  http://svn.apache.org/repos/asf/tomcat/connectors/tags/tc4.1.x/TOMCAT_4_1_40/
>  http://svn.apache.org/repos/asf/tomcat/container/tags/tc4.1.x/TOMCAT_4_1_40/
>  http://svn.apache.org/repos/asf/tomcat/jasper/tags/tc4.1.x/TOMCAT_4_1_40/
>  
> http://svn.apache.org/repos/asf/tomcat/servletapi/tags/servlet2.3-jsp1.2-tc4.x/TOMCAT_4_1_40/
>

Thanks, I used the following SVN URLs + revisions:

http://svn.apache.org/repos/asf/tomcat/connectors/tags/tc4.1.x/TOMCAT_4_1_40
Last Changed Rev: 784715

http://svn.apache.org/repos/asf/tomcat/container/tags/tc4.1.x/TOMCAT_4_1_40
Last Changed Rev: 785257

http://svn.apache.org/repos/asf/tomcat/jasper/tags/tc4.1.x/TOMCAT_4_1_40
Last Changed Rev: 784716

http://svn.apache.org/repos/asf/tomcat/servletapi/tags/servlet2.3-jsp1.2-tc4.x/TOMCAT_4_1_40
Last Changed Rev: 784717

The source archives mostly agree with the tags, however there are code
changes in the following files:

connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java
connectors/util/java/org/apache/tomcat/util/http/ServerCookie.java

[I can provide a diff listing if required]

The tags really ought to agree with the source archive.

Unfortunately, I think I have found another problem, which is that the
README file needs to mention the TSU exception:

http://www.apache.org/dev/crypto.html#inform

[This presumably applies to all the later Tomcat versions as well]

Sorry, I should have noticed this before as IMO it is a release blocker.

There ought really to be NOTICE files alongside the LICENSE files in
the jasper and servletapi SVN trees (SVN is a form of distribution).

>  Mark
>
>
>  >
>  >>  [ ] Broken
>  >>  [ ] Alpha
>  >>  [ ] Beta
>  >>  [ ] Stable
>  >>
>  >>  Mark
>  >>
>  >>
>  >>  -
>  >>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  >>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>  >>
>  >>
>  >
>  > -
>  > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  > For additional commands, e-mail: dev-h...@tomcat.apache.org
>  >
>
>
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786631 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread kkolinko
Author: kkolinko
Date: Fri Jun 19 18:57:59 2009
New Revision: 786631

URL: http://svn.apache.org/viewvc?rev=786631&view=rev
Log:
Add two more implementations for the second test.
a) using a single ThreadLocal instead of multiple ones
b) also using StringBuilder instead of StringBuffer
Also, replaced class.getName() with class.getSimpleName() in the status message.

Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786631&r1=786630&r2=786631&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
18:57:59 2009
@@ -135,8 +135,8 @@
 
 // note, that we can avoid (long -> Long) conversion
 private static class Struct {
-long currentMillis = 0;
-Date currentDate;
+public long currentMillis = 0;
+public Date currentDate;
 }
 
 private ThreadLocal currentStruct = new ThreadLocal() {
@@ -165,7 +165,9 @@
 BenchmarkTest benchmark = new BenchmarkTest();
 Runnable[] tests = new Runnable[] {
 new TimeDateElementBenchmarkTest_Sync(),
-new TimeDateElementBenchmarkTest_Local() };
+new TimeDateElementBenchmarkTest_Local(),
+new TimeDateElementBenchmarkTest_LocalStruct(),
+new TimeDateElementBenchmarkTest_LocalStruct_SBuilder() };
 benchmark.doTest(5, tests);
 }
 
@@ -285,13 +287,17 @@
 if (currentDateStringLocal.get() == null) {
 StringBuffer current = new StringBuffer(32);
 current.append('[');
-
current.append(dayFormatterLocal.get().format(currentDateLocal.get())); // Day
+current.append(dayFormatterLocal.get().format(
+currentDateLocal.get())); // Day
 current.append('/');
-
current.append(lookup(monthFormatterLocal.get().format(currentDateLocal.get(;
 // Month
+current.append(lookup(monthFormatterLocal.get().format(
+currentDateLocal.get(; // Month
 current.append('/');
-
current.append(yearFormatterLocal.get().format(currentDateLocal.get())); // Year
+current.append(yearFormatterLocal.get().format(
+currentDateLocal.get())); // Year
 current.append(':');
-
current.append(timeFormatterLocal.get().format(currentDateLocal.get())); // Time
+current.append(timeFormatterLocal.get().format(
+currentDateLocal.get())); // Time
 current.append(']');
 currentDateStringLocal.set(current.toString());
 }
@@ -308,6 +314,122 @@
 }
 }
 
+private static class TimeDateElementBenchmarkTest_LocalStruct extends
+TimeDateElementBenchmarkTestBase implements Runnable {
+
+public String toString() {
+return "single ThreadLocal";
+}
+
+private static class Struct {
+public String currentDateString;
+public Date currentDate = new Date();
+public SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
+public SimpleDateFormat monthFormatter = new 
SimpleDateFormat("MM");
+public SimpleDateFormat yearFormatter = new 
SimpleDateFormat("");
+public SimpleDateFormat timeFormatter = new SimpleDateFormat(
+"hh:mm:ss");
+}
+
+private ThreadLocal structLocal = new ThreadLocal() {
+protected Struct initialValue() {
+return new Struct();
+}
+};
+
+public void run() {
+printDate();
+}
+
+public String printDate() {
+getDateLocal();
+Struct struct = structLocal.get();
+if (struct.currentDateString == null) {
+StringBuffer current = new StringBuffer(32);
+current.append('[');
+
current.append(struct.dayFormatter.format(struct.currentDate)); // Day
+current.append('/');
+current.append(lookup(struct.monthFormatter
+.format(struct.currentDate))); // Month
+current.append('/');
+
current.append(struct.yearFormatter.format(struct.currentDate)); // Year
+current.append(':');
+
current.append(struct.timeFormatter.format(struct.currentDate)); // Time
+current.append(']');
+struct.currentDateString = current.toString();
+}
+return s

Re: svn commit: r785952 - in /tomcat/trunk/test/org/apache/catalina/valves: ./ Benchmarks.java

2009-06-19 Thread Konstantin Kolinko
2009/6/19 Mark Thomas :
>
> I've made the changes you suggested and lo and behold the ThreadLocal is
> quicker.
>
>> testAccessLogGetDate: 16 threads and 1000 iterations using Syncs
>> took 7461ms
>> testAccessLogGetDate: 16 threads and 1000 iterations using
>> ThreadLocals took 6433ms
>
> Out of interest, how many cores are you running? With 4 cores I get a
> bigger difference:
> org.apache.catalina.valves.Benchmarks$TimeDateElementBenchmarkTest_Sync:
> 16 threads and 1000 iterations using Syncs took 14359ms
> org.apache.catalina.valves.Benchmarks$TimeDateElementBenchmarkTest_Local:
> 16 threads and 1000 iterations using ThreadLocals took 1532ms
>

Using Date.setTime() instead of new Date() was a good idea, by the way.

I added an implementation that uses a single ThreadLocal, and it is even faster.

My numbers, at rev.786631:

TimeDateElementBenchmarkTest_Sync: 5 threads and 1000 iterations
using Syncs took 9469ms
TimeDateElementBenchmarkTest_Local: 5 threads and 1000 iterations
using ThreadLocals took 4672ms
TimeDateElementBenchmarkTest_LocalStruct: 5 threads and 1000
iterations using single ThreadLocal took 3609ms
TimeDateElementBenchmarkTest_LocalStruct_SBuilder: 5 threads and
1000 iterations using single ThreadLocal, with StringBuilder took
3594ms

TimeDateElementBenchmarkTest_Sync: 16 threads and 1000 iterations
using Syncs took 32000ms
TimeDateElementBenchmarkTest_Local: 16 threads and 1000 iterations
using ThreadLocals took 14500ms
TimeDateElementBenchmarkTest_LocalStruct: 16 threads and 1000
iterations using single ThreadLocal took 11312ms
TimeDateElementBenchmarkTest_LocalStruct_SBuilder: 16 threads and
1000 iterations using single ThreadLocal, with StringBuilder took
11360ms

It is on WinXP, JRE 6u12, two cores (Centrino Duo), running from within an IDE.

The last two lines of the four are implementations using StringBuffer
vs. StringBuilder.  The difference is negligible (either one or the
other is "faster", on different runs).

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786631 - /tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java

2009-06-19 Thread sebb
On 19/06/2009, kkoli...@apache.org  wrote:
> Author: kkolinko
>  Date: Fri Jun 19 18:57:59 2009
>  New Revision: 786631
>
>  URL: http://svn.apache.org/viewvc?rev=786631&view=rev
>  Log:
>  Add two more implementations for the second test.
>  a) using a single ThreadLocal instead of multiple ones
>  b) also using StringBuilder instead of StringBuffer
>  Also, replaced class.getName() with class.getSimpleName() in the status 
> message.
>
>  Modified:
> tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
>
>  Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786631&r1=786630&r2=786631&view=diff
>  
> ==
>  --- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
>  +++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Fri Jun 19 
> 18:57:59 2009
>  @@ -135,8 +135,8 @@
>
>  // note, that we can avoid (long -> Long) conversion
>  private static class Struct {
>  -long currentMillis = 0;
>  -Date currentDate;
>  +public long currentMillis = 0;
>  +public Date currentDate;
>  }
>
>  private ThreadLocal currentStruct = new 
> ThreadLocal() {
>  @@ -165,7 +165,9 @@
>  BenchmarkTest benchmark = new BenchmarkTest();
>  Runnable[] tests = new Runnable[] {
>  new TimeDateElementBenchmarkTest_Sync(),
>  -new TimeDateElementBenchmarkTest_Local() };
>  +new TimeDateElementBenchmarkTest_Local(),
>  +new TimeDateElementBenchmarkTest_LocalStruct(),
>  +new TimeDateElementBenchmarkTest_LocalStruct_SBuilder() };
>  benchmark.doTest(5, tests);
>  }
>
>  @@ -285,13 +287,17 @@
>  if (currentDateStringLocal.get() == null) {
>  StringBuffer current = new StringBuffer(32);
>  current.append('[');
>  -
> current.append(dayFormatterLocal.get().format(currentDateLocal.get())); // Day
>  +current.append(dayFormatterLocal.get().format(
>  +currentDateLocal.get())); // Day
>  current.append('/');
>  -
> current.append(lookup(monthFormatterLocal.get().format(currentDateLocal.get(;
>  // Month
>  +current.append(lookup(monthFormatterLocal.get().format(
>  +currentDateLocal.get(; // Month
>  current.append('/');
>  -
> current.append(yearFormatterLocal.get().format(currentDateLocal.get())); // 
> Year
>  +current.append(yearFormatterLocal.get().format(
>  +currentDateLocal.get())); // Year
>  current.append(':');
>  -
> current.append(timeFormatterLocal.get().format(currentDateLocal.get())); // 
> Time
>  +current.append(timeFormatterLocal.get().format(
>  +currentDateLocal.get())); // Time
>  current.append(']');
>  currentDateStringLocal.set(current.toString());
>  }
>  @@ -308,6 +314,122 @@
>  }
>  }
>
>  +private static class TimeDateElementBenchmarkTest_LocalStruct extends
>  +TimeDateElementBenchmarkTestBase implements Runnable {
>  +
>  +public String toString() {
>  +return "single ThreadLocal";
>  +}
>  +
>  +private static class Struct {
>  +public String currentDateString;
>  +public Date currentDate = new Date();
>  +public SimpleDateFormat dayFormatter = new 
> SimpleDateFormat("dd");
>  +public SimpleDateFormat monthFormatter = new 
> SimpleDateFormat("MM");
>  +public SimpleDateFormat yearFormatter = new 
> SimpleDateFormat("");
>  +public SimpleDateFormat timeFormatter = new SimpleDateFormat(
>  +"hh:mm:ss");
>  +}
>  +
>  +private ThreadLocal structLocal = new ThreadLocal() 
> {
>  +protected Struct initialValue() {
>  +return new Struct();
>  +}
>  +};
>  +
>  +public void run() {
>  +printDate();
>  +}
>  +
>  +public String printDate() {
>  +getDateLocal();
>  +Struct struct = structLocal.get();
>  +if (struct.currentDateString == null) {
>  +StringBuffer current = new StringBuffer(32);
>  +current.append('[');
>  +
> current.append(struct.dayFormatter.format(struct.currentDate)); // Day
>  +current.append('/');
>  +current.append(lookup(struct.monthFormatter
>  +.format(struct.currentDate))); // Month
>  +current.append('/');

Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread Mark Thomas
sebb wrote:
> The source archives mostly agree with the tags, however there are code
> changes in the following files:
> 
> connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
> connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java
> connectors/util/java/org/apache/tomcat/util/http/ServerCookie.java

That happens automatically as part of the build process and is expected.

> [I can provide a diff listing if required]

No need, I know exactly what has changed in those files.

> Unfortunately, I think I have found another problem, which is that the
> README file needs to mention the TSU exception:
> 
> http://www.apache.org/dev/crypto.html#inform
> 
> [This presumably applies to all the later Tomcat versions as well]
> 
> Sorry, I should have noticed this before as IMO it is a release blocker.

Having read http://www.apache.org/dev/crypto.html#inform, it makes clear
 that this requirement is self imposed. Therefore I
propose that we take a little bit of latitude and do the following
(assuming this gets the votes to pass)
- include the text in the announcement e-mail
- add the text to the README (post tag)
- put the updated README in the download directory (currently it just
includes the release notes)

I think this meets the spirit of our self-imposed requirement without
needing to re-roll the release.

What I will do is update those read me files now, so the changes are in
place for the next releases.

> There ought really to be NOTICE files alongside the LICENSE files in
> the jasper and servletapi SVN trees (SVN is a form of distribution).

I think that is a grey area. I see where you are coming from but I don't
propose to do anything about this for the 4.1.40 release. Post the svn
re-org that will follow the final 4.1.x release, we can revisit that.

Mark


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r786653 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 20:21:53 2009
New Revision: 786653

URL: http://svn.apache.org/viewvc?rev=786653&view=rev
Log:
Switch to ThreadLocal where possible. This removes all the syncs apart from 
those related to accessing the log file.

Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786653&r1=786652&r2=786653&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 19 
20:21:53 2009
@@ -224,34 +224,6 @@
 
 
 /**
- * A date formatter to format Dates into a day string in the format
- * "dd".
- */
-private SimpleDateFormat dayFormatter = null;
-
-
-/**
- * A date formatter to format a Date into a month string in the format
- * "MM".
- */
-private SimpleDateFormat monthFormatter = null;
-
-
-/**
- * A date formatter to format a Date into a year string in the format
- * "".
- */
-private SimpleDateFormat yearFormatter = null;
-
-
-/**
- * A date formatter to format a Date into a time in the format
- * "kk:mm:ss" (kk is a 24-hour representation of the hour).
- */
-private SimpleDateFormat timeFormatter = null;
-
-
-/**
  * The system timezone.
  */
 private TimeZone timezone = null;
@@ -281,9 +253,13 @@
  * The system time when we last updated the Date that this valve
  * uses for log lines.
  */
-private volatile Date currentDate = null;
-
-private volatile long currentMillis = 0;
+private ThreadLocal currentDate = new ThreadLocal() {
+protected Date initialValue() {
+return new Date();
+}
+};
+private ThreadLocal currentDateString =
+new ThreadLocal();
 
 
 /**
@@ -760,15 +736,11 @@
 private Date getDate() {
 // Only create a new Date once per second, max.
 long systime = System.currentTimeMillis();
-if ((systime - currentMillis) > 1000) {
-synchronized (this) {
-if ((systime - currentMillis) > 1000) {
-currentDate = new Date(systime);
-currentMillis = systime;
-}
-}
+if ((systime - currentDate.get().getTime()) > 1000) {
+currentDate.get().setTime(systime);
+currentDateString.set(null);
 }
-return currentDate;
+return currentDate.get();
 }
 
 
@@ -864,16 +836,7 @@
 fileDateFormat = "-MM-dd";
 fileDateFormatter = new SimpleDateFormat(fileDateFormat);
 fileDateFormatter.setTimeZone(timezone);
-dayFormatter = new SimpleDateFormat("dd");
-dayFormatter.setTimeZone(timezone);
-monthFormatter = new SimpleDateFormat("MM");
-monthFormatter.setTimeZone(timezone);
-yearFormatter = new SimpleDateFormat("");
-yearFormatter.setTimeZone(timezone);
-timeFormatter = new SimpleDateFormat("HH:mm:ss");
-timeFormatter.setTimeZone(timezone);
-currentDate = new Date();
-dateStamp = fileDateFormatter.format(currentDate);
+dateStamp = fileDateFormatter.format(currentDate.get());
 open();
 }
 
@@ -927,20 +890,21 @@
  */
 protected class LocalAddrElement implements AccessLogElement {
 
-private String value = null;
+private ThreadLocal value = new ThreadLocal() {
+protected String initialValue() {
+String init;
+try {
+init = InetAddress.getLocalHost().getHostAddress();
+} catch (Throwable e) {
+init = "127.0.0.1";
+}
+return init;
+}
+};
 
 public void addElement(StringBuffer buf, Date date, Request request,
 Response response, long time) {
-if (value == null) {
-synchronized (this) {
-try {
-value = InetAddress.getLocalHost().getHostAddress();
-} catch (Throwable e) {
-value = "127.0.0.1";
-}
-}
-}
-buf.append(value);
+buf.append(value.get());
 }
 }
 
@@ -1007,33 +971,83 @@
  * write date and time, in Common Log Format - %t
  */
 protected class DateAndTimeElement implements AccessLogElement {
-private Date currentDate = new Date(0);
-
-private String currentDateString = null;
 
+/**
+ * A date formatter to format Dates into a day string in the format
+ * "dd".
+ */
+ 

svn commit: r786654 - in /tomcat: build/tc5.5.x/RELEASE-NOTES container/branches/tc4.1.x/README.txt tc6.0.x/trunk/RELEASE-NOTES trunk/RELEASE-NOTES

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 20:25:01 2009
New Revision: 786654

URL: http://svn.apache.org/viewvc?rev=786654&view=rev
Log:
As per http://www.apache.org/dev/crypto.html#inform add a crypto notice to each 
of the releases

Modified:
tomcat/build/tc5.5.x/RELEASE-NOTES
tomcat/container/branches/tc4.1.x/README.txt
tomcat/tc6.0.x/trunk/RELEASE-NOTES
tomcat/trunk/RELEASE-NOTES

Modified: tomcat/build/tc5.5.x/RELEASE-NOTES
URL: 
http://svn.apache.org/viewvc/tomcat/build/tc5.5.x/RELEASE-NOTES?rev=786654&r1=786653&r2=786654&view=diff
==
--- tomcat/build/tc5.5.x/RELEASE-NOTES (original)
+++ tomcat/build/tc5.5.x/RELEASE-NOTES Fri Jun 19 20:25:01 2009
@@ -37,6 +37,7 @@
 * Symlinking static resources
 * Enabling invoker servlet
 * Viewing the Tomcat Change Log
+* Cryptographic software notice
 * When all else fails
 
 
@@ -189,6 +190,34 @@
 See changelog.html in this directory.
 
 
+=
+Cryptographic software notice
+=
+This distribution includes cryptographic software.  The country in 
+which you currently reside may have restrictions on the import, 
+possession, use, and/or re-export to another country, of 
+encryption software.  BEFORE using any encryption software, please 
+check your country's laws, regulations and policies concerning the
+import, possession, or use, and re-export of encryption software, to 
+see if this is permitted.  See  for more
+information.
+
+The U.S. Government Department of Commerce, Bureau of Industry and
+Security (BIS), has classified this software as Export Commodity 
+Control Number (ECCN) 5D002.C.1, which includes information security
+software using or performing cryptographic functions with asymmetric
+algorithms.  The form and manner of this Apache Software Foundation
+distribution makes it eligible for export under the License Exception
+ENC Technology Software Unrestricted (TSU) exception (see the BIS 
+Export Administration Regulations, Section 740.13) for both object 
+code and source code.
+
+The following provides more details on the included cryptographic
+software:
+  - Tomcat includes code designed to work with JSSE
+  - Tomcat includes code designed to work with OpenSSL
+  
+  
 
 When all else fails:
 

Modified: tomcat/container/branches/tc4.1.x/README.txt
URL: 
http://svn.apache.org/viewvc/tomcat/container/branches/tc4.1.x/README.txt?rev=786654&r1=786653&r2=786654&view=diff
==
--- tomcat/container/branches/tc4.1.x/README.txt (original)
+++ tomcat/container/branches/tc4.1.x/README.txt Fri Jun 19 20:25:01 2009
@@ -63,3 +63,31 @@
 
 Previous releases may be found in the Apache archives, available via the above
 download page.
+
+
+ Cryptographic software notice
+ =
+
+This distribution includes cryptographic software.  The country in 
+which you currently reside may have restrictions on the import, 
+possession, use, and/or re-export to another country, of 
+encryption software.  BEFORE using any encryption software, please 
+check your country's laws, regulations and policies concerning the
+import, possession, or use, and re-export of encryption software, to 
+see if this is permitted.  See  for more
+information.
+
+The U.S. Government Department of Commerce, Bureau of Industry and
+Security (BIS), has classified this software as Export Commodity 
+Control Number (ECCN) 5D002.C.1, which includes information security
+software using or performing cryptographic functions with asymmetric
+algorithms.  The form and manner of this Apache Software Foundation
+distribution makes it eligible for export under the License Exception
+ENC Technology Software Unrestricted (TSU) exception (see the BIS 
+Export Administration Regulations, Section 740.13) for both object 
+code and source code.
+
+The following provides more details on the included cryptographic
+software:
+  - Tomcat includes code designed to work with JSSE
+  - Tomcat includes code designed to work with OpenSSL
\ No newline at end of file

Modified: tomcat/tc6.0.x/trunk/RELEASE-NOTES
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/RELEASE-NOTES?rev=786654&r1=786653&r2=786654&view=diff
==
--- tomcat/tc6.0.x/trunk/RELEASE-NOTES (original)
+++ tomcat/tc6.0.x/trunk/RELEASE-NOTES Fri Jun 19 20:25:01 2009
@@ -36,6 +36,7 @@
 * Symlinking static resources
 * Enabling invoker servlet
 * Viewing the Tomcat Change Log
+* Cryptographic software notice
 * When all else fails
 
 
@@ -184,6 +185,34 @@
 See changelog.html in this directory.
 
 
+=
+Cryptographic software notice
+=
+This distribution includes cryp

Re: svn commit: r786653 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2009-06-19 Thread Mark Thomas
ma...@apache.org wrote:
> Author: markt
> Date: Fri Jun 19 20:21:53 2009
> New Revision: 786653
> 
> URL: http://svn.apache.org/viewvc?rev=786653&view=rev
> Log:
> Switch to ThreadLocal where possible. This removes all the syncs apart from 
> those related to accessing the log file.

I'm planning to propose patches to port the various sync changes to
6.0.x and 5.5.x some time next week.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2009-06-19 Thread kkolinko
Author: kkolinko
Date: Fri Jun 19 20:29:34 2009
New Revision: 786656

URL: http://svn.apache.org/viewvc?rev=786656&view=rev
Log:
votes

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=786656&r1=786655&r2=786656&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 20:29:34 2009
@@ -202,7 +202,13 @@
   http://svn.apache.org/viewvc?rev=783724&view=rev
   http://svn.apache.org/viewvc?rev=786468&view=rev
   +1: markt, fhanik
-  -1: 
+  -1: kkolinko (
+ Regarding the second part of the patch:
+   queryMB is not always the "original data" for the call.
+   o.a.c.connector.Request#parseParameters() calls processParameters() as 
well,
+   to parse body of a POST request. Though it will be a rare case to 
trigger
+   this log message from that call.
+  )
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47343
   Regression in fix for
@@ -279,7 +285,7 @@
if(log.isInfoEnabled())
  log.info("Setting multihome multicast interface to:" 
+mcastBindAddress);
 
- +1: fhanik, markt
+ +1: fhanik, markt, kkolinko
  -1: 
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38352



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread sebb
On 19/06/2009, Mark Thomas  wrote:
> sebb wrote:
>  > The source archives mostly agree with the tags, however there are code
>  > changes in the following files:
>  >
>  > connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
>  > connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java
>  > connectors/util/java/org/apache/tomcat/util/http/ServerCookie.java
>
>
> That happens automatically as part of the build process and is expected.

OK, I see.

It would be better if the changes were made to temporary copies of the
source files, but that's not essential given that the version is
rather old.

>  > [I can provide a diff listing if required]
>
>
> No need, I know exactly what has changed in those files.
>
>
>  > Unfortunately, I think I have found another problem, which is that the
>  > README file needs to mention the TSU exception:
>  >
>  > http://www.apache.org/dev/crypto.html#inform
>  >
>  > [This presumably applies to all the later Tomcat versions as well]
>  >
>  > Sorry, I should have noticed this before as IMO it is a release blocker.
>
>
> Having read http://www.apache.org/dev/crypto.html#inform, it makes clear
>   that this requirement is self imposed. Therefore I
>  propose that we take a little bit of latitude and do the following
>  (assuming this gets the votes to pass)
>  - include the text in the announcement e-mail
>  - add the text to the README (post tag)
>  - put the updated README in the download directory (currently it just
>  includes the release notes)
>
>  I think this meets the spirit of our self-imposed requirement without
>  needing to re-roll the release.

I'm not 100% convinced.

It might be an idea to ask this question on legal-discuss.

>  What I will do is update those read me files now, so the changes are in
>  place for the next releases.

+1

>
>  > There ought really to be NOTICE files alongside the LICENSE files in
>  > the jasper and servletapi SVN trees (SVN is a form of distribution).
>
>
> I think that is a grey area. I see where you are coming from but I don't
>  propose to do anything about this for the 4.1.40 release. Post the svn
>  re-org that will follow the final 4.1.x release, we can revisit that.

OK, but if there is any need to re-roll the release I think the NOTICE
files should be added to SVN.

>
>  Mark
>
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786653 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2009-06-19 Thread sebb
On 19/06/2009, ma...@apache.org  wrote:
> Author: markt
>  Date: Fri Jun 19 20:21:53 2009
>  New Revision: 786653
>
>  URL: http://svn.apache.org/viewvc?rev=786653&view=rev
>  Log:
>  Switch to ThreadLocal where possible. This removes all the syncs apart from 
> those related to accessing the log file.
>
>  Modified:
> tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
>
>  Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786653&r1=786652&r2=786653&view=diff
>  
> ==
>  --- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java 
> (original)
>  +++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 
> 19 20:21:53 2009
>  @@ -224,34 +224,6 @@
>
>
>  /**
>  - * A date formatter to format Dates into a day string in the format
>  - * "dd".
>  - */
>  -private SimpleDateFormat dayFormatter = null;
>  -
>  -
>  -/**
>  - * A date formatter to format a Date into a month string in the format
>  - * "MM".
>  - */
>  -private SimpleDateFormat monthFormatter = null;
>  -
>  -
>  -/**
>  - * A date formatter to format a Date into a year string in the format
>  - * "".
>  - */
>  -private SimpleDateFormat yearFormatter = null;
>  -
>  -
>  -/**
>  - * A date formatter to format a Date into a time in the format
>  - * "kk:mm:ss" (kk is a 24-hour representation of the hour).
>  - */
>  -private SimpleDateFormat timeFormatter = null;
>  -
>  -
>  -/**
>   * The system timezone.
>   */
>  private TimeZone timezone = null;
>  @@ -281,9 +253,13 @@
>   * The system time when we last updated the Date that this valve
>   * uses for log lines.
>   */
>  -private volatile Date currentDate = null;
>  -
>  -private volatile long currentMillis = 0;
>  +private ThreadLocal currentDate = new ThreadLocal() {
>  +protected Date initialValue() {
>  +return new Date();
>  +}
>  +};
>  +private ThreadLocal currentDateString =
>  +new ThreadLocal();
>
>
>  /**
>  @@ -760,15 +736,11 @@
>  private Date getDate() {
>  // Only create a new Date once per second, max.
>  long systime = System.currentTimeMillis();
>  -if ((systime - currentMillis) > 1000) {
>  -synchronized (this) {
>  -if ((systime - currentMillis) > 1000) {
>  -currentDate = new Date(systime);
>  -currentMillis = systime;
>  -}
>  -}
>  +if ((systime - currentDate.get().getTime()) > 1000) {
>  +currentDate.get().setTime(systime);
>  +currentDateString.set(null);
>  }
>  -return currentDate;
>  +return currentDate.get();
>  }
>
>
>  @@ -864,16 +836,7 @@
>  fileDateFormat = "-MM-dd";
>  fileDateFormatter = new SimpleDateFormat(fileDateFormat);
>  fileDateFormatter.setTimeZone(timezone);
>  -dayFormatter = new SimpleDateFormat("dd");
>  -dayFormatter.setTimeZone(timezone);
>  -monthFormatter = new SimpleDateFormat("MM");
>  -monthFormatter.setTimeZone(timezone);
>  -yearFormatter = new SimpleDateFormat("");
>  -yearFormatter.setTimeZone(timezone);
>  -timeFormatter = new SimpleDateFormat("HH:mm:ss");
>  -timeFormatter.setTimeZone(timezone);
>  -currentDate = new Date();
>  -dateStamp = fileDateFormatter.format(currentDate);
>  +dateStamp = fileDateFormatter.format(currentDate.get());
>  open();
>  }
>
>  @@ -927,20 +890,21 @@
>   */
>  protected class LocalAddrElement implements AccessLogElement {
>
>  -private String value = null;
>  +private ThreadLocal value = new ThreadLocal() {
>  +protected String initialValue() {
>  +String init;
>  +try {
>  +init = InetAddress.getLocalHost().getHostAddress();
>  +} catch (Throwable e) {
>  +init = "127.0.0.1";
>  +}
>  +return init;
>  +}
>  +};

Surely the value will be the same for all threads?

In which case, it could be established as a static final field, thus
avoiding any need to synch or use threadLocal.

If you want avoid the overhead of calling the method in case it is not
used, one could use the Init On Demand Holder idiom.

>  public void addElement(StringBuffer buf, Date date, Request request,
>  Response response, long time) {
>  -if (value == null) {
>  -synchronized (this) {
>  -try {
>  -value = InetAddress.getLocalHos

svn commit: r786667 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 21:14:32 2009
New Revision: 786667

URL: http://svn.apache.org/viewvc?rev=786667&view=rev
Log:
Can't use queryMB as that isn't the only source.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=786667&r1=78&r2=786667&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Fri Jun 19 
21:14:32 2009
@@ -338,6 +338,8 @@
 // if needed
 ByteChunk tmpName=new ByteChunk();
 ByteChunk tmpValue=new ByteChunk();
+ByteChunk origName=new ByteChunk();
+ByteChunk origValue=new ByteChunk();
 CharChunk tmpNameC=new CharChunk(1024);
 CharChunk tmpValueC=new CharChunk(1024);
 
@@ -396,18 +398,25 @@
 }
 tmpName.setBytes( bytes, nameStart, nameEnd-nameStart );
 tmpValue.setBytes( bytes, valStart, valEnd-valStart );
-
+try {
+// Take copies as if anything goes wrong originals will be
+// corrupted. This means original values can be logged
+origName.append(bytes, nameStart, nameEnd-nameStart);
+origValue.append(bytes, valStart, valEnd-valStart);
+} catch (IOException ioe) {
+// Should never happen...
+log.error("Error copying parameters", ioe);
+}
+
 try {
 addParam( urlDecode(tmpName, enc), urlDecode(tmpValue, enc) );
 } catch (IOException e) {
-// tmpName or tmpValue will be corrupted at this point due to
-// failed decoding. Have to go to queryMB to get original data
 StringBuilder msg =
 new StringBuilder("Parameters: Character decoding 
failed.");
 msg.append(" Parameter '");
-msg.append(queryMB.toString().substring(nameStart, nameEnd));
+msg.append(origName.toString());
 msg.append("' with value '");
-msg.append(queryMB.toString().substring(valStart, valEnd));
+msg.append(origValue.toString());
 msg.append("' has been ignored.");
 if (log.isDebugEnabled()) {
 log.debug(msg, e);
@@ -418,7 +427,8 @@
 
 tmpName.recycle();
 tmpValue.recycle();
-
+origName.recycle();
+origValue.recycle();
 } while( pos

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

2009-06-19 Thread markt
Author: markt
Date: Fri Jun 19 21:27:32 2009
New Revision: 786670

URL: http://svn.apache.org/viewvc?rev=786670&view=rev
Log:
Address Konstantin's review comment.
The patch is now sufficiently different that I removed Filip's vote to give him 
a chance to re-review

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=786670&r1=786669&r2=786670&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jun 19 21:27:32 2009
@@ -198,17 +198,14 @@
   +1: kkolinko, markt
   -1: 
 
-* Make diagnosing broken requests a little easier
+* Make diagnosing broken requests a little easier. Having to copy the values is
+  a pain but I can't see an alternative. On balance I think it is worth it but 
I
+  appreciate others may disagree. 
   http://svn.apache.org/viewvc?rev=783724&view=rev
   http://svn.apache.org/viewvc?rev=786468&view=rev
-  +1: markt, fhanik
-  -1: kkolinko (
- Regarding the second part of the patch:
-   queryMB is not always the "original data" for the call.
-   o.a.c.connector.Request#parseParameters() calls processParameters() as 
well,
-   to parse body of a POST request. Though it will be a rare case to 
trigger
-   this log message from that call.
-  )
+  http://svn.apache.org/viewvc?rev=786667&view=rev
+  +1: markt
+  -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47343
   Regression in fix for



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org




DO NOT REPLY [Bug 47395] New: Dispatcher.forward and getPathInfo() != null causes stack overflow

2009-06-19 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=47395

   Summary: Dispatcher.forward and getPathInfo() != null causes
stack overflow
   Product: Tomcat 6
   Version: 6.0.20
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: major
  Priority: P2
 Component: Servlet & JSP API
AssignedTo: dev@tomcat.apache.org
ReportedBy: em...@cs-ware.de


web.xml:


ShowFile
   
submissioninterface.servlets.controller.ShowFile


ShowFileView
   
submissioninterface.servlets.view.ShowFileView


ShowFile
/servlets/ShowFile/*


ShowFileView
/servlets/ShowFileView



ShowFile.java contains:
request.getRequestDispatcher("ShowFileView").forward(request, response);

ShowFileView.java:
contains just a hellow-world-output.

Open /servlets/ShowFile/sth in browser and get the stack overflow. Changing
"/servlets/ShowFileView" to "/servlets/ShowFileView/*" didn't help.

Error:
exception

javax.servlet.ServletException: Servlet execution threw an exception
submissioninterface.servlets.controller.ShowFile.doGet(ShowFile.java:15)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
submissioninterface.servlets.controller.ShowFile.doGet(ShowFile.java:15)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
...

root cause
java.lang.StackOverflowError
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
...

-- 
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786667 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

2009-06-19 Thread Filip Hanik - Dev Lists
we're copying bytes to two new byte arrays on every call, just so that 
we have info when it fails?
especially only logged with debugEnabled, shouldn't your logic check 
that flag then

Filip


ma...@apache.org wrote:

Author: markt
Date: Fri Jun 19 21:14:32 2009
New Revision: 786667

URL: http://svn.apache.org/viewvc?rev=786667&view=rev
Log:
Can't use queryMB as that isn't the only source.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=786667&r1=78&r2=786667&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Fri Jun 19 
21:14:32 2009
@@ -338,6 +338,8 @@
 // if needed
 ByteChunk tmpName=new ByteChunk();
 ByteChunk tmpValue=new ByteChunk();
+ByteChunk origName=new ByteChunk();
+ByteChunk origValue=new ByteChunk();
 CharChunk tmpNameC=new CharChunk(1024);
 CharChunk tmpValueC=new CharChunk(1024);
 
@@ -396,18 +398,25 @@

 }
 tmpName.setBytes( bytes, nameStart, nameEnd-nameStart );
 tmpValue.setBytes( bytes, valStart, valEnd-valStart );
-
+try {
+// Take copies as if anything goes wrong originals will be
+// corrupted. This means original values can be logged
+origName.append(bytes, nameStart, nameEnd-nameStart);
+origValue.append(bytes, valStart, valEnd-valStart);
+} catch (IOException ioe) {
+// Should never happen...
+log.error("Error copying parameters", ioe);
+}
+
 try {

 addParam( urlDecode(tmpName, enc), urlDecode(tmpValue, enc) );
 } catch (IOException e) {
-// tmpName or tmpValue will be corrupted at this point due to
-// failed decoding. Have to go to queryMB to get original data
 StringBuilder msg =
 new StringBuilder("Parameters: Character decoding 
failed.");
 msg.append(" Parameter '");
-msg.append(queryMB.toString().substring(nameStart, nameEnd));
+msg.append(origName.toString());
 msg.append("' with value '");
-msg.append(queryMB.toString().substring(valStart, valEnd));
+msg.append(origValue.toString());
 msg.append("' has been ignored.");
 if (log.isDebugEnabled()) {
 log.debug(msg, e);
@@ -418,7 +427,8 @@
 
 tmpName.recycle();

 tmpValue.recycle();
-
+origName.recycle();
+origValue.recycle();
 } while( pos 




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


  



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r786667 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

2009-06-19 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
> we're copying bytes to two new byte arrays on every call, just so that
> we have info when it fails?

For query string there is (and always has been) one copy and then this
patch copies again for the failure info.

For POST requests the only copy is for the failure info.

> especially only logged with debugEnabled, shouldn't your logic check
> that flag then

The debug logging includes the exception. There is still warn level
logging that provides the information on the failed parameters.

One option to reduce the copying would be to log the failure with the
corrupted data at warn level along with the info that if you use debug
logging you'll see the original data. That would move the copying to
debug only although you might see some odd messages depending on how the
decoding failed.

What do you think?

Mark

> Filip
> 
> 
> ma...@apache.org wrote:
>> Author: markt
>> Date: Fri Jun 19 21:14:32 2009
>> New Revision: 786667
>>
>> URL: http://svn.apache.org/viewvc?rev=786667&view=rev
>> Log:
>> Can't use queryMB as that isn't the only source.
>>
>> Modified:
>> tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
>>
>> Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=786667&r1=78&r2=786667&view=diff
>>
>> ==
>>
>> --- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
>> (original)
>> +++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Fri
>> Jun 19 21:14:32 2009
>> @@ -338,6 +338,8 @@
>>  // if needed
>>  ByteChunk tmpName=new ByteChunk();
>>  ByteChunk tmpValue=new ByteChunk();
>> +ByteChunk origName=new ByteChunk();
>> +ByteChunk origValue=new ByteChunk();
>>  CharChunk tmpNameC=new CharChunk(1024);
>>  CharChunk tmpValueC=new CharChunk(1024);
>>  @@ -396,18 +398,25 @@
>>  }
>>  tmpName.setBytes( bytes, nameStart, nameEnd-nameStart );
>>  tmpValue.setBytes( bytes, valStart, valEnd-valStart );
>> -
>> +try {
>> +// Take copies as if anything goes wrong originals
>> will be
>> +// corrupted. This means original values can be logged
>> +origName.append(bytes, nameStart, nameEnd-nameStart);
>> +origValue.append(bytes, valStart, valEnd-valStart);
>> +} catch (IOException ioe) {
>> +// Should never happen...
>> +log.error("Error copying parameters", ioe);
>> +}
>> + try {
>>  addParam( urlDecode(tmpName, enc),
>> urlDecode(tmpValue, enc) );
>>  } catch (IOException e) {
>> -// tmpName or tmpValue will be corrupted at this
>> point due to
>> -// failed decoding. Have to go to queryMB to get
>> original data
>>  StringBuilder msg =
>>  new StringBuilder("Parameters: Character decoding
>> failed.");
>>  msg.append(" Parameter '");
>> -msg.append(queryMB.toString().substring(nameStart,
>> nameEnd));
>> +msg.append(origName.toString());
>>  msg.append("' with value '");
>> -msg.append(queryMB.toString().substring(valStart,
>> valEnd));
>> +msg.append(origValue.toString());
>>  msg.append("' has been ignored.");
>>  if (log.isDebugEnabled()) {
>>  log.debug(msg, e);
>> @@ -418,7 +427,8 @@
>>  
>>  tmpName.recycle();
>>  tmpValue.recycle();
>> -
>> +origName.recycle();
>> +origValue.recycle();
>>  } while( pos>  }
>>  
>>
>>
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>
>>   
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 47395] Dispatcher.forward and getPathInfo() != null causes stack overflow

2009-06-19 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=47395


Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WORKSFORME




--- Comment #1 from Mark Thomas   2009-06-19 15:39:58 PST ---
This works for me.

Please use the users list to debug this further. If it transpires that there is
a Tomcat bug here, feel free to re-open this issue, providing all necessary
information to reproduce this on a clean Tomcat installation.

-- 
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 47371] EL expression parser error when getter methed return an empty string

2009-06-19 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=47371


Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Comment #1 from Mark Thomas   2009-06-19 15:50:31 PST ---
Thanks for the test case, it really helps speed up the process of evaluating
bugs.

+ is not a String concatenation operator in EL. However, I think this will
achieve the result you want:
${currentRow['a'].cellValue}${currentRow['b'].cellValue}

-- 
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release build 4.1.40 - Take 2

2009-06-19 Thread Mladen Turk

Mark Thomas wrote:

The (updated) candidates source tarball and derived binaries are
available here:
http://tomcat.apache.org/dev/dist/apache-tomcat-4.1.40/

According to the release process, the release based on the 4.0.40 tag is:
[ ] Broken
[ ] Alpha
[ ] Beta
[X] Stable




[x] Stable

Tested on Linux and Windows.

Regards
--
^(TM)

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org