Re: [CANCELLED][VOTE] Release Apache Tomcat 7.0.38
On 15/03/2013 07:14, Mladen Turk wrote: On 03/14/2013 09:23 PM, Konstantin Kolinko wrote: 2013/3/14 Mark Thomas ma...@apache.org: Due to the various regressions that have been reported I have decided to cancel this vote. I hope to be in a position to tag 7.0.39 later this evening. I hoped that there will be a daemons release to address https://issues.apache.org/jira/browse/DAEMON-284 but looking at dev@commons archive, the vote has not been started. Started it few minutes back. IMO we should wait for 1.0.14 release before next tomcat tag. Works for me. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456795 - /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/
Author: markt Date: Fri Mar 15 07:31:04 2013 New Revision: 1456795 URL: http://svn.apache.org/r1456795 Log: Correct merge info Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Reverse-merged /commons/proper/fileupload/tags/commons-fileupload-1.2.2/src/java/org/apache/commons/fileupload:r964209-981187 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54702] New: File descriptor leak at web.xml loading
https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 Bug ID: 54702 Summary: File descriptor leak at web.xml loading Product: Tomcat 7 Version: 7.0.33 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: jeanmarie.lam...@free.fr Classification: Unclassified Hello I think I've found a file descriptor leak in file /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (method getGlobalWebXmlSource). A stream is from file web.xml is not closed. private WebXml getDefaultWebXmlFragment() { ... 1284InputSource globalWebXml = getGlobalWebXmlSource(); ... 1337// Parse global web.xml if present 1338if (globalWebXml == null) { 1339// This is unusual enough to log 1340log.info(sm.getString(contextConfig.defaultMissing)); 1341} else { 1342parseWebXml(globalWebXml, webXmlDefaultFragment, false); 1343} Here is the full stack trace [java.io.FileInputStream.init(FileInputStream.java:109)] [org.apache.catalina.startup.ContextConfig.getWebXmlSource(ContextConfig.java:1837)] [org.apache.catalina.startup.ContextConfig.getGlobalWebXmlSource(ContextConfig.java:1744)] [org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1417)] [org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1253)] [org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)] [org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)] [org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)] [org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)] [org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)] [org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)] [org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)] [org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)] [org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)] [org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)] [org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:542)] [org.apache.catalina.startup.HostConfig.check(HostConfig.java:1462)] [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)] [sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)] [sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)] [java.lang.reflect.Method.invoke(Method.java:597)] [org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)] [com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)] [com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)] [org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1445)] [org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:301)] [org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:208)] [javax.servlet.http.HttpServlet.service(HttpServlet.java:647)] [javax.servlet.http.HttpServlet.service(HttpServlet.java:728)] [org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)] [org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)] [org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)] [org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)] [org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)] [org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)] [org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)] [org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)] [org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)] [org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)] [org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)] [org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)] [org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)] [org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)] [org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)] [org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)] [org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)]
svn commit: r1456811 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: kkolinko Date: Fri Mar 15 09:00:38 2013 New Revision: 1456811 URL: http://svn.apache.org/r1456811 Log: Add Violeta to the list of authors in changelog file. s/ @ / at / Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1456811r1=1456810r2=1456811view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Mar 15 09:00:38 2013 @@ -24,16 +24,17 @@ project; properties -author email=r...@apache.orgRemy Maucherat/author -author email=fha...@apache.orgFilip Hanik/author -author email=rj...@apache.orgRainer Jung/author -author email=kkoli...@apache.orgKonstantin Kolinko/author -author email=p...@apache.orgPeter Rossbach/author -author email=kfuj...@apache.orgKeiichi Fujino/author -author email=t...@apache.orgTim Whittington/author -author email=mt...@apache.orgMladen Turk/author -author email=schu...@apache.orgChristopher Schultz/author -author email=slaur...@apache.orgSylvain Laurent/author +author email=remm at apache.orgRemy Maucherat/author +author email=fhanik at apache.orgFilip Hanik/author +author email=rjung at apache.orgRainer Jung/author +author email=kkolinko at apache.orgKonstantin Kolinko/author +author email=pero at apache.orgPeter Rossbach/author +author email=kfujino at apache.orgKeiichi Fujino/author +author email=timw at apache.orgTim Whittington/author +author email=mturk at apache.orgMladen Turk/author +author email=schultz at apache.orgChristopher Schultz/author +author email=slaurent at apache.orgSylvain Laurent/author +author email=violetagg at apache.orgVioleta Georgieva/author titleChangelog/title no-comments / /properties - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456822 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ FileItem.java FileItemHeaders.java FileUploadBase.java disk/DiskFileItem.java
Author: markt Date: Fri Mar 15 09:18:04 2013 New Revision: 1456822 URL: http://svn.apache.org/r1456822 Log: Merge upadtes from Commons FileUpload prior to code re-org Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload:r964209-1445523 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1456822r1=1456821r2=1456822view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java Fri Mar 15 09:18:04 2013 @@ -50,7 +50,7 @@ import java.io.UnsupportedEncodingExcept * * @version $Id$ */ -public interface FileItem extends Serializable { +public interface FileItem extends Serializable, FileItemHeadersSupport { // --- Methods from javax.activation.DataSource Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java?rev=1456822r1=1456821r2=1456822view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java Fri Mar 15 09:18:04 2013 @@ -44,34 +44,29 @@ public interface FileItemHeaders { /** * p * Returns all the values of the specified item header as an - * codeEnumeration/code of codeString/code objects. + * codeIterator/code of codeString/code objects. * /p * p * If the item did not include any headers of the specified name, this - * method returns an empty codeEnumeration/code. The header name is + * method returns an empty codeIterator/code. The header name is * case insensitive. * /p * * @param name a codeString/code specifying the header name - * @return an codeEnumeration/code containing the values of the + * @return an codeIterator/code containing the values of the * requested header. If the item does not have any headers of - * that name, return an empty codeEnumeration/code + * that name, return an empty codeIterator/code */ IteratorString getHeaders(String name); /** * p - * Returns an codeEnumeration/code of all the header names. - * /p - * p - * If the item did not include any headers of the specified name, this - * method returns an empty codeEnumeration/code. The header name is - * case insensitive. + * Returns an codeIterator/code of all the header names. * /p * - * @return an codeEnumeration/code containing the values of the - * requested header. If the item does not have any headers of - * that name return an empty codeEnumeration/code + * @return an codeIterator/code containing all of the names of + * headers provided with this file item. If the item does not have + * any headers return an empty codeIterator/code */ IteratorString getHeaderNames(); } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456822r1=1456821r2=1456822view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 09:18:04 2013 @@ -327,7 +327,7 @@ public abstract class FileUploadBase { } if (fileItem instanceof FileItemHeadersSupport) { final FileItemHeaders fih = item.getHeaders(); -((FileItemHeadersSupport) fileItem).setHeaders(fih); +fileItem.setHeaders(fih); } } successful = true; Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java URL:
[Bug 54702] File descriptor leak at web.xml loading
https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 --- Comment #1 from Violeta Georgieva violet...@apache.org --- Hi, Did you observe that in some real situation? Basically the following is specified for org.xml.sax.InputSource [1] However, standard processing of both byte and character streams is to close them on as part of end-of-parse cleanup, so applications should not attempt to re-use such streams after they have been handed to a parser. Regards Violeta [1] http://docs.oracle.com/javase/6/docs/api/ -- 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
[Bug 54665] Provide JNDI support for java.net.URL resources
https://issues.apache.org/bugzilla/show_bug.cgi?id=54665 --- Comment #2 from Giovanni Dall'Oglio Risso giovanni.dallog...@addvalue.it --- I'm sorry for this decision. An other reason (that I not mentioned before) is the cross-platform portability: we'd like to develop our software in a minimalistic way, developed and tested with Tomcat, but installable and usable also in other application servers (we can't force our customers to adopt the Tomcat, as you understand...). As far as I know, the URL is managed by everybody else... We'll try with the other containers. But honestly I hope that you rethink this decision... For the second issue (licensing), I can re-write the class, or you can see the (probably better) org.ow2.easybeans.naming.url.URLFactory of library easybeans-naming (that is LGPL) -- 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: r1456839 - in /tomcat/trunk/java/org/apache/catalina: connector/Connector.java core/StandardHost.java
Author: markt Date: Fri Mar 15 09:46:34 2013 New Revision: 1456839 URL: http://svn.apache.org/r1456839 Log: Javadoc tweaks Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1456839r1=1456838r2=1456839view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Fri Mar 15 09:46:34 2013 @@ -522,7 +522,7 @@ public class Connector extends Lifecycle /** * Return the port number on which this connector is listening to requests. - * If the special value for {@link #port} of zero is used then this method + * If the special value for {@link #getPort} of zero is used then this method * will report the actual port bound. */ public int getLocalPort() { Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1456839r1=1456838r2=1456839view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Fri Mar 15 09:46:34 2013 @@ -602,7 +602,7 @@ public class StandardHost extends Contai /** * Return the regular expression that defines the files and directories in - * the host's {@link #appBase} that will be ignored by the automatic + * the host's {@link #getAppBase} that will be ignored by the automatic * deployment process. */ @Override @@ -616,7 +616,7 @@ public class StandardHost extends Contai /** * Return the compiled regular expression that defines the files and - * directories in the host's {@link #appBase} that will be ignored by the + * directories in the host's {@link #getAppBase} that will be ignored by the * automatic deployment process. */ @Override @@ -627,7 +627,7 @@ public class StandardHost extends Contai /** * Set the regular expression that defines the files and directories in - * the host's {@link #appBase} that will be ignored by the automatic + * the host's {@link #getAppBase} that will be ignored by the automatic * deployment process. */ @Override - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1456491 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
On 14.03.2013 16:47, ma...@apache.org wrote: Author: markt Date: Thu Mar 14 15:47:24 2013 New Revision: 1456491 URL: http://svn.apache.org/r1456491 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54660 Allow the AccessLogValve file data format to be changed via JMX. The change takes effect as soon as the next message is logged. 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=1456491r1=1456490r2=1456491view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Thu Mar 14 15:47:24 2013 ... @@ -961,6 +972,34 @@ public class AccessLogValve extends Valv /** + * Rotate the log file if necessary. + */ +public void rotate() { It might be nice to publish this new method via JMX. Would be useful to trigger a rotation e.g. at midnight on an idle system that would otherwise only rotate when the next access is logged. That way you can then run reliably your post rotation batches (compression, file transfer) at a defined time. Of course one can also send a dummy request to trigger rotation, but that means switching to a different type of script and might not be easily doable (network access to the right port). The other JMX accessible rotate method needs to be passed a file name which is only useful if you want to control every aspect of the rotation externally. +if (rotatable) { +// Only do a logfile switch check once a second, max. +long systime = System.currentTimeMillis(); +if ((systime - rotationLastChecked) 1000) { +synchronized(this) { +if ((systime - rotationLastChecked) 1000) { +rotationLastChecked = systime; + +String tsDate; +// Check for a change of date +tsDate = fileDateFormatter.format(new Date(systime)); + +// If the date has changed, switch log files +if (!dateStamp.equals(tsDate)) { +close(true); +dateStamp = tsDate; +open(); +} +} +} +} +} +} + +/** * Rename the existing log file to something else. Then open the * old log file name up once again. Intended to be called by a JMX * agent. @@ -1091,28 +1130,8 @@ public class AccessLogValve extends Valv * @param message Message to be logged */ public void log(CharArrayWriter message) { -if (rotatable) { -// Only do a logfile switch check once a second, max. -long systime = System.currentTimeMillis(); -if ((systime - rotationLastChecked) 1000) { -synchronized(this) { -if ((systime - rotationLastChecked) 1000) { -rotationLastChecked = systime; - -String tsDate; -// Check for a change of date -tsDate = fileDateFormatter.format(new Date(systime)); -// If the date has changed, switch log files -if (!dateStamp.equals(tsDate)) { -close(true); -dateStamp = tsDate; -open(); -} -} -} -} -} +rotate(); /* In case something external rotated the file instead */ if (checkExists) { Regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456844 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ FileUploadBase.java disk/package-info.java package-info.java package.html servlet/package-info.java util/package
Author: markt Date: Fri Mar 15 09:49:49 2013 New Revision: 1456844 URL: http://svn.apache.org/r1456844 Log: Merge updates from Commons FileUpload to r1453029 Added: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java - copied, changed from r1453029, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java - copied, changed from r1453029, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java - copied, changed from r1453029, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/servlet/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/package-info.java - copied, changed from r1453029, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/package-info.java Removed: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package.html Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Reverse-merged /commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload:r605690-1445523 Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r605690-1453029 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456844r1=1456843r2=1456844view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 09:49:49 2013 @@ -20,7 +20,6 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -338,8 +337,7 @@ public abstract class FileUploadBase { throw new FileUploadException(e.getMessage(), e); } finally { if (!successful) { -for (IteratorFileItem iterator = items.iterator(); iterator.hasNext();) { -FileItem fileItem = iterator.next(); +for (FileItem fileItem : items) { try { fileItem.delete(); } catch (Exception e) { @@ -367,7 +365,7 @@ public abstract class FileUploadBase { parser.setLowerCaseNames(true); // Parameter parser can handle null input MapString,String params = -parser.parse(contentType, new char[] {';', ','}); +parser.parse(contentType, new char[] {';', ','}); String boundaryStr = params.get(boundary); if (boundaryStr == null) { Copied: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java (from r1453029, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/package-info.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java?p2=tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.javap1=commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/package-info.javar1=1453029r2=1456844rev=1456844view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/package-info.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java Fri Mar 15 09:49:49 2013 @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under
svn commit: r1456863 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ FileUploadBase.java MultipartStream.java ParameterParser.java ProgressListener.java RequestContext.java servlet/
Author: markt Date: Fri Mar 15 10:21:16 2013 New Revision: 1456863 URL: http://svn.apache.org/r1456863 Log: Merge updates from Commons FileUpload to r1453202 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ProgressListener.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/RequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453030-1453202 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456863r1=1456862r2=1456863view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 10:21:16 2013 @@ -446,8 +446,7 @@ public abstract class FileUploadBase { ParameterParser parser = new ParameterParser(); parser.setLowerCaseNames(true); // Parameter parser can handle null input -MapString,String params = -parser.parse(pContentDisposition, ';'); +MapString,String params = parser.parse(pContentDisposition, ';'); fieldName = params.get(name); if (fieldName != null) { fieldName = fieldName.trim(); Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java?rev=1456863r1=1456862r2=1456863view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java Fri Mar 15 10:21:16 2013 @@ -86,25 +86,36 @@ import org.apache.tomcat.util.http.fileu * @version $Id$ */ public class MultipartStream { + /** * Internal class, which is used to invoke the * {@link ProgressListener}. */ public static class ProgressNotifier { -/** The listener to invoke. +/** + * The listener to invoke. */ private final ProgressListener listener; -/** Number of expected bytes, if known, or -1. + +/** + * Number of expected bytes, if known, or -1. */ private final long contentLength; -/** Number of bytes, which have been read so far. + +/** + * Number of bytes, which have been read so far. */ private long bytesRead; -/** Number of items, which have been read so far. + +/** + * Number of items, which have been read so far. */ private int items; -/** Creates a new instance with the given listener + +/** + * Creates a new instance with the given listener * and content length. + * * @param pListener The listener to invoke. * @param pContentLength The expected content length. */ @@ -112,7 +123,10 @@ public class MultipartStream { listener = pListener; contentLength = pContentLength; } -/** Called to indicate that bytes have been read. + +/** + * Called to indicate that bytes have been read. + * * @param pBytes Number of bytes, which have been read. */ void noteBytesRead(int pBytes) { @@ -122,126 +136,110 @@ public class MultipartStream { bytesRead += pBytes; notifyListener(); } -/** Called to indicate, that a new file item has been detected. + +/** + * Called to indicate, that a new file item has been detected. */ void noteItem() { ++items; notifyListener(); } -/** Called for notifying the listener. + +/** + * Called for notifying the listener. */ private void notifyListener() { if (listener != null) { listener.update(bytesRead, contentLength, items);
[Bug 54702] File descriptor leak at web.xml loading
https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 --- Comment #2 from Jean-Marie LAMARE jeanmarie.lam...@free.fr --- Hello The following file are opened after a WAR deployment on my computer (I've used the command handle written by the sys internal team). java.exe pid: 3984 CASTCORP\JML C: File (RW-) C:\java\apache-tomcat-7.0.33\bin 54: File (R-D) C:\TEMP\hsperfdata_jml\3984 5C: Section \Sessions\1\BaseNamedObjects\hsperfdata_JML_3984 E0: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\rt.jar 1E8: File (RW-) C:\java\apache-tomcat-7.0.33\bin\bootstrap.jar 1EC: File (RW-) C:\java\apache-tomcat-7.0.33\bin\commons-daemon.jar 1F0: File (RW-) C:\java\apache-tomcat-7.0.33\bin\tomcat-juli.jar 1F4: File (RW-) C:\java\apache-tomcat-7.0.33\logs\catalina.2013-03-15.log 1F8: File (RW-) C:\java\apache-tomcat-7.0.33\logs\localhost.2013-03-15.log 1FC: File (RW-) C:\java\apache-tomcat-7.0.33\logs\manager.2013-03-15.log 200: File (RW-) C:\java\apache-tomcat-7.0.33\logs\host-manager.2013-03-15.log 204: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\jsse.jar 208: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\ext\dnsns.jar 20C: File (RW-) C:\java\apache-tomcat-7.0.33\lib\annotations-api.jar 210: File (RW-) C:\java\apache-tomcat-7.0.33\lib\catalina-ant.jar 214: File (RW-) C:\java\apache-tomcat-7.0.33\lib\catalina-ha.jar 218: File (RW-) C:\java\apache-tomcat-7.0.33\lib\catalina-tribes.jar 21C: File (RW-) C:\java\apache-tomcat-7.0.33\lib\catalina.jar 220: File (RW-) C:\java\apache-tomcat-7.0.33\lib\ecj-3.7.2.jar 224: File (RW-) C:\java\apache-tomcat-7.0.33\lib\el-api.jar 228: File (RW-) C:\java\apache-tomcat-7.0.33\lib\jasper-el.jar 22C: File (RW-) C:\java\apache-tomcat-7.0.33\lib\jasper.jar 230: File (RW-) C:\java\apache-tomcat-7.0.33\lib\jsp-api.jar 234: File (RW-) C:\java\apache-tomcat-7.0.33\lib\servlet-api.jar 238: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-api.jar 23C: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-coyote.jar 240: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-dbcp.jar 244: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-i18n-es.jar 248: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-i18n-fr.jar 24C: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-i18n-ja.jar 250: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-jdbc.jar 254: File (RW-) C:\java\apache-tomcat-7.0.33\lib\tomcat-util.jar 27C: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\ext\localedata.jar 288: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\resources.jar 304: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\jce.jar 308: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\ext\sunjce_provider.jar 31C: File (R-D) C:\Windows\System32\en-US\KernelBase.dll.mui 338: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\charsets.jar 33C: File (RW-) C:\java\apache-tomcat-7.0.33\logs\localhost_access_log.2013-03-15.txt 354: File (RW-) C:\java\jdk1.6.0_35_x64\jre\lib\charsets.jar 440: File (RW-) C:\java\apache-tomcat-7.0.33\conf\web.xml 454: File (RW-) C:\java\apache-tomcat-7.0.33\conf\web.xml 964: File (RW-) C:\java\apache-tomcat-7.0.33\temp\system4547162881526958771.jar 990: File (RW-) C:\java\apache-tomcat-7.0.33\temp\bootstrap5643731443438317122.jar 9A8: File (RW-) C:\workspaces\pmc_Contrex\jvmagent\jvmagent.jar So the sys internal utility observes it in a real situation. I've discoverer this bug thanks a JVM agent which rewrites FileInputStream and FileOutputStream bytecodes. This one ensures that FileInputStream.close is called after the constructor invocation. -- 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
[Tomcat Wiki] Trivial Update of TerraCree by TerraCree
Dear Wiki user, You have subscribed to a wiki page or wiki category on Tomcat Wiki for change notification. The TerraCree page has been changed by TerraCree: http://wiki.apache.org/tomcat/TerraCree New page: There is nothing to say about me really.BR Nice to be here and a part of apache.org.BR I really hope Im useful in one way here.BR BR my blog post :: [[http://www.parapharmacie-faure.com/16_furterer|parapharmacie leclerc en ligne]] - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456872 - in /tomcat/trunk/java/org/apache: catalina/connector/ tomcat/util/http/fileupload/ tomcat/util/http/fileupload/disk/ tomcat/util/http/fileupload/servlet/ tomcat/util/http/fileup
Author: markt Date: Fri Mar 15 10:37:13 2013 New Revision: 1456872 URL: http://svn.apache.org/r1456872 Log: Merge updates from Commons FileUpload to r1453230 Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.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=1456872r1=1456871r2=1456872view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Mar 15 10:37:13 2013 @@ -92,6 +92,7 @@ import org.apache.tomcat.util.http.fileu import org.apache.tomcat.util.http.fileupload.FileUploadException; import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory; import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload; +import org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext; import org.apache.tomcat.util.res.StringManager; @@ -2591,7 +2592,8 @@ public class Request parts = new ArrayList(); try { -ListFileItem items = upload.parseRequest(this); +ListFileItem items = +upload.parseRequest(new ServletRequestContext(this)); int maxPostSize = getConnector().getMaxPostSize(); int postSize = 0; String enc = getCharacterEncoding(); Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453203-1453230 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1456872r1=1456871r2=1456872view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java Fri Mar 15 10:37:13 2013 @@ -52,10 +52,8 @@ import java.io.UnsupportedEncodingExcept */ public interface FileItem extends Serializable, FileItemHeadersSupport { - // --- Methods from javax.activation.DataSource - /** * Returns an {@link java.io.InputStream InputStream} that can be * used to retrieve the contents of the file. @@ -67,7 +65,6 @@ public interface FileItem extends Serial */ InputStream getInputStream() throws IOException; - /** * Returns the content type passed by the browser or codenull/code if * not defined. @@ -77,7 +74,6 @@ public interface FileItem extends Serial */ String getContentType(); - /** * Returns the original filename in the client's filesystem, as provided by * the browser (or other client software). In most cases, this will be the @@ -92,10 +88,8 @@ public interface FileItem extends Serial */ String getName(); - // --- FileItem methods - /** * Provides a hint as to whether or not the file contents will be read * from memory. @@ -105,7 +99,6 @@ public interface FileItem extends Serial */ boolean isInMemory(); -
svn commit: r1456882 - /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java
Author: markt Date: Fri Mar 15 10:47:42 2013 New Revision: 1456882 URL: http://svn.apache.org/r1456882 Log: (empty) Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java?rev=1456882r1=1456881r2=1456882view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java Fri Mar 15 10:47:42 2013 @@ -105,10 +105,9 @@ public class ServletRequestContext imple */ @Override public String toString() { -return ContentLength= -+ this.getContentLength() -+ , ContentType= -+ this.getContentType(); +return String.format(ContentLength=%s, ContentType=%s, + Integer.valueOf(this.getContentLength()), + this.getContentType()); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456885 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ disk/ servlet/ util/
Author: markt Date: Fri Mar 15 10:57:08 2013 New Revision: 1456885 URL: http://svn.apache.org/r1456885 Log: Merge updates from Commons FileUpload to r1453285 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/RequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453231-1453285 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1456885r1=1456884r2=1456885view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java Fri Mar 15 10:57:08 2013 @@ -49,6 +49,7 @@ import java.io.UnsupportedEncodingExcept * @author a href=mailto:mart...@apache.org;Martin Cooper/a * * @version $Id$ + * @since 1.3 additionally implements FileItemHeadersSupport */ public interface FileItem extends Serializable, FileItemHeadersSupport { Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java?rev=1456885r1=1456884r2=1456885view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java Fri Mar 15 10:57:08 2013 @@ -24,7 +24,7 @@ import java.util.Iterator; * request./p * * @author Michael C. Macaluso - * @since 1.3 + * @since 1.2.1 */ public interface FileItemHeaders { @@ -71,4 +71,5 @@ public interface FileItemHeaders { * any headers return an empty codeIterator/code */ IteratorString getHeaderNames(); + } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java?rev=1456885r1=1456884r2=1456885view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java Fri Mar 15 10:57:08 2013 @@ -21,7 +21,7 @@ package org.apache.tomcat.util.http.file * implementations will accept the headers read for the item. * * @author Michael C. Macaluso - * @since 1.3 + * @since 1.2.1 * * @see FileItem * @see FileItemStream @@ -45,4 +45,5 @@ public interface FileItemHeadersSupport * for this instance. */ void setHeaders(FileItemHeaders headers); + } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456885r1=1456884r2=1456885view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 10:57:08 2013 @@ -321,8 +321,8 @@ public abstract class FileUploadBase { throw (FileUploadException) e.getCause(); } catch (IOException e) { throw new IOFileUploadException( -Processing of + MULTIPART_FORM_DATA -+ request failed. + e.getMessage(), e); +String.format(Processing of %s request failed. , +MULTIPART_FORM_DATA, e.getMessage()), e);
svn commit: r1456895 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ disk/ servlet/ util/
Author: markt Date: Fri Mar 15 11:10:27 2013 New Revision: 1456895 URL: http://svn.apache.org/r1456895 Log: Merge updates from Commons FileUpload to r1453817 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/package-info.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453286-1453817 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456895r1=1456894r2=1456895view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 11:10:27 2013 @@ -87,16 +87,13 @@ public abstract class FileUploadBase { return false; } - // - Manifest constants - /** * HTTP content type header name. */ public static final String CONTENT_TYPE = Content-type; - /** * HTTP content disposition header name. */ @@ -107,40 +104,33 @@ public abstract class FileUploadBase { */ public static final String CONTENT_LENGTH = Content-length; - /** * Content-disposition value for form data. */ public static final String FORM_DATA = form-data; - /** * Content-disposition value for file attachment. */ public static final String ATTACHMENT = attachment; - /** * Part of HTTP content type header. */ public static final String MULTIPART = multipart/; - /** * HTTP content type header for multipart forms. */ public static final String MULTIPART_FORM_DATA = multipart/form-data; - /** * HTTP content type header for multiple uploads. */ public static final String MULTIPART_MIXED = multipart/mixed; - // --- Data members - /** * The maximum size permitted for the complete request, as opposed to * {@link #fileSizeMax}. A value of -1 indicates no maximum. @@ -165,7 +155,6 @@ public abstract class FileUploadBase { // - Property accessors - /** * Returns the factory class used when creating file items. * @@ -173,7 +162,6 @@ public abstract class FileUploadBase { */ public abstract FileItemFactory getFileItemFactory(); - /** * Sets the factory class to use when creating file items. * @@ -181,7 +169,6 @@ public abstract class FileUploadBase { */ public abstract void setFileItemFactory(FileItemFactory factory); - /** * Returns the maximum allowed size of a complete request, as opposed * to {@link #getFileSizeMax()}. @@ -196,7 +183,6 @@ public abstract class FileUploadBase { return sizeMax; } - /** * Sets the maximum allowed size of a complete request, as opposed * to {@link #setFileSizeMax(long)}. @@ -245,7 +231,6 @@ public abstract class FileUploadBase { return headerEncoding; } - /** * Specifies the character encoding to be used when reading the headers of * individual part. When not specified, or codenull/code, the request @@ -258,10 +243,8 @@ public abstract class FileUploadBase { headerEncoding = encoding; } - // - Public methods - /** * Processes an a href=http://www.ietf.org/rfc/rfc1867.txt;RFC 1867/a * compliant codemultipart/form-data/code stream. @@ -348,10 +331,8 @@ public abstract class FileUploadBase { } } - // -- Protected methods - /** * Retrieves the boundary from the codeContent-type/code header. *
svn commit: r1456899 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ FileUploadBase.java InvalidFileNameException.java disk/DiskFileItem.java util/FileItemHeadersImpl.java
Author: markt Date: Fri Mar 15 11:21:18 2013 New Revision: 1456899 URL: http://svn.apache.org/r1456899 Log: Merge updates from Commons FileUpload to r1453844 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453818-1453844 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456899r1=1456898r2=1456899view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 11:21:18 2013 @@ -596,10 +596,10 @@ public abstract class FileUploadBase { if (pContentLength != -1 pContentLength fileSizeMax) { FileSizeLimitExceededException e = -new FileSizeLimitExceededException(String.format( -The field %s exceeds its maximum permitted size of %s bytes., +new FileSizeLimitExceededException( +String.format(The field %s exceeds its maximum permitted size of %s bytes., fieldName, Long.valueOf(fileSizeMax)), -pContentLength, fileSizeMax); +pContentLength, fileSizeMax); e.setFileName(pName); e.setFieldName(pFieldName); throw new FileUploadIOException(e); @@ -610,10 +610,10 @@ public abstract class FileUploadBase { throws IOException { itemStream.close(true); FileSizeLimitExceededException e = -new FileSizeLimitExceededException(String.format( -The field %s exceeds its maximum permitted size of %s bytes., +new FileSizeLimitExceededException( +String.format(The field %s exceeds its maximum permitted size of %s bytes., fieldName, Long.valueOf(pSizeMax)), - pCount, pSizeMax); +pCount, pSizeMax); e.setFieldName(fieldName); e.setFileName(name); throw new FileUploadIOException(e); @@ -1039,7 +1039,9 @@ public abstract class FileUploadBase { */ public abstract static class SizeException extends FileUploadException { - +/** + * Serial version UID, being used, if serialized. + */ private static final long serialVersionUID = -8776225574705254126L; /** @@ -1200,6 +1202,8 @@ public abstract class FileUploadBase { /** * Sets the file name of the item, which caused the * exception. + * + * @param pFileName the file name of the item, which caused the exception. */ public void setFileName(String pFileName) { fileName = pFileName; @@ -1218,6 +1222,9 @@ public abstract class FileUploadBase { /** * Sets the field name of the item, which caused the * exception. + * + * @param pFieldName the field name of the item, + *which caused the exception. */ public void setFieldName(String pFieldName) { fieldName = pFieldName; Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java?rev=1456899r1=1456898r2=1456899view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java Fri Mar 15 11:21:18 2013 @@ -28,8 +28,15 @@ package
svn commit: r1456904 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ disk/ servlet/ util/
Author: markt Date: Fri Mar 15 11:36:53 2013 New Revision: 1456904 URL: http://svn.apache.org/r1456904 Log: Merge updates from Commons FileUpload to r1455031 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ProgressListener.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453845-1455031 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1456904r1=1456903r2=1456904view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java Fri Mar 15 11:36:53 2013 @@ -43,11 +43,6 @@ import java.io.UnsupportedEncodingExcept * implementation of this interface to also implement * codejavax.activation.DataSource/code with minimal additional work. * - * @author a href=mailto:rafal.krzew...@e-point.pl;Rafal Krzewski/a - * @author a href=mailto:s...@informage.net;Sean Legassick/a - * @author a href=mailto:jvan...@apache.org;Jason van Zyl/a - * @author a href=mailto:mart...@apache.org;Martin Cooper/a - * * @version $Id$ * @since 1.3 additionally implements FileItemHeadersSupport */ Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java?rev=1456904r1=1456903r2=1456904view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java Fri Mar 15 11:36:53 2013 @@ -21,8 +21,6 @@ package org.apache.tomcat.util.http.file * can provide their own custom configuration, over and above that provided * by the default file upload implementation./p * - * @author a href=mailto:mart...@apache.org;Martin Cooper/a - * * @version $Id$ */ public interface FileItemFactory { Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java?rev=1456904r1=1456903r2=1456904view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java Fri Mar 15 11:36:53 2013 @@ -23,8 +23,9 @@ import java.util.Iterator; * item that was received within a codemultipart/form-data/code POST * request./p * - * @author Michael C. Macaluso * @since 1.2.1 + * + * @version $Id$ */ public interface FileItemHeaders { Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java URL:
[Bug 54702] File descriptor leak at web.xml loading
https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 --- Comment #3 from Jean-Marie LAMARE jeanmarie.lam...@free.fr --- Is the bugs due to a missing close call there ? 1312if (entry != null entry.getGlobalTimeStamp() == globalTimeStamp 1313entry.getHostTimeStamp() == hostTimeStamp) { 1314return entry.getWebXml(); 1315} ... 1321entry = hostWebXmlCache.get(host); 1322if (entry != null entry.getGlobalTimeStamp() == globalTimeStamp 1323entry.getHostTimeStamp() == hostTimeStamp) { 1324return entry.getWebXml(); 1325} Sometimes, the web.xml file is not parsed and the stream is not closed -- 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: r1456916 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ disk/ servlet/ util/mime/
Author: markt Date: Fri Mar 15 12:08:38 2013 New Revision: 1456916 URL: http://svn.apache.org/r1456916 Log: Merge updates from Commons FileUpload to r1456912 Added: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/UploadContext.java - copied, changed from r1455855, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/UploadContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/ - copied from r1456515, commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/RequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/Base64Decoder.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/ParseException.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/package-info.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1455032-1456912 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456916r1=1456915r2=1456916view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 12:08:38 2013 @@ -20,6 +20,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -256,7 +257,12 @@ public abstract class FileUploadBase { */ public FileItemIterator getItemIterator(RequestContext ctx) throws FileUploadException, IOException { -return new FileItemIteratorImpl(ctx); +try { +return new FileItemIteratorImpl(ctx); +} catch (FileUploadIOException e) { +// unwrap encapsulated SizeException +throw (FileUploadException) e.getCause(); +} } /** @@ -279,20 +285,17 @@ public abstract class FileUploadBase { FileItemIterator iter = getItemIterator(ctx); FileItemFactory fac = getFileItemFactory(); if (fac == null) { -throw new NullPointerException( -No FileItemFactory has been set.); +throw new NullPointerException(No FileItemFactory has been set.); } while (iter.hasNext()) { final FileItemStream item = iter.next(); // Don't use getName() here to prevent an InvalidFileNameException. final String fileName = ((FileItemIteratorImpl.FileItemStreamImpl) item).name; -FileItem fileItem = fac.createItem(item.getFieldName(), -item.getContentType(), item.isFormField(), -fileName); +FileItem fileItem = fac.createItem(item.getFieldName(), item.getContentType(), + item.isFormField(), fileName); items.add(fileItem); try { -Streams.copy(item.openStream(), fileItem.getOutputStream(), -true); +Streams.copy(item.openStream(), fileItem.getOutputStream(), true); } catch (FileUploadIOException e) { throw (FileUploadException) e.getCause(); } catch (IOException e) { @@ -324,6 +327,39 @@ public abstract class FileUploadBase { } } +/** + * Processes an a href=http://www.ietf.org/rfc/rfc1867.txt;RFC 1867/a + * compliant codemultipart/form-data/code stream. + * + * @param ctx The context for the request to be parsed. + * +
svn commit: r1456920 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ./ FileUploadBase.java package-info.java
Author: markt Date: Fri Mar 15 12:13:51 2013 New Revision: 1456920 URL: http://svn.apache.org/r1456920 Log: Merge updates from Commons FileUpload to r1456918 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1456918 Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456920r1=1456919r2=1456920view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 12:13:51 2013 @@ -303,10 +303,8 @@ public abstract class FileUploadBase { String.format(Processing of %s request failed. , MULTIPART_FORM_DATA, e.getMessage()), e); } -if (fileItem instanceof FileItemHeadersSupport) { -final FileItemHeaders fih = item.getHeaders(); -fileItem.setHeaders(fih); -} +final FileItemHeaders fih = item.getHeaders(); +fileItem.setHeaders(fih); } successful = true; return items; Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java?rev=1456920r1=1456919r2=1456920view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java Fri Mar 15 12:13:51 2013 @@ -18,7 +18,7 @@ /** * pbNOTE:/b This code has been copied from commons-fileupload trunk - * revision 1xx and commons-io 1.4 and package renamed to avoid clashes with + * revision 1456918 and commons-io 1.4 and package renamed to avoid clashes with * any web apps that may wish to use these libraries. * /p * p - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456926 - /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
Author: markt Date: Fri Mar 15 12:22:03 2013 New Revision: 1456926 URL: http://svn.apache.org/r1456926 Log: Re-remove deprecated code that sneaked back in during a merge Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456926r1=1456925r2=1456926view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 12:22:03 2013 @@ -1118,46 +1118,6 @@ public abstract class FileUploadBase { } /** - .working -=== - * Thrown to indicate that the request size is not specified. In other - * words, it is thrown, if the content-length header is missing or - * contains the value -1. - * - * @deprecated 1.2 As of commons-fileupload 1.2, the presence of a - * content-length header is no longer required. - */ -@Deprecated -public static class UnknownSizeException -extends FileUploadException { - -/** - * The exceptions UID, for serializing an instance. - */ -private static final long serialVersionUID = 7062279004812015273L; - -/** - * Constructs a codeUnknownSizeException/code with no - * detail message. - */ -public UnknownSizeException() { -super(); -} - -/** - * Constructs an codeUnknownSizeException/code with - * the specified detail message. - * - * @param message The detail message. - */ -public UnknownSizeException(String message) { -super(message); -} - -} - -/** - .merge-right.r1453817 * Thrown to indicate that the request size exceeds the configured maximum. */ public static class SizeLimitExceededException - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456932 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ParameterParser.java util/mime/QuotedPrintableDecoder.java
Author: markt Date: Fri Mar 15 12:34:48 2013 New Revision: 1456932 URL: http://svn.apache.org/r1456932 Log: Review the diff to FileUpload trunk and better our fork Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java?rev=1456932r1=1456931r2=1456932view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java Fri Mar 15 12:34:48 2013 @@ -266,24 +266,24 @@ public class ParameterParser { * Extracts a map of name/value pairs from the given array of * characters. Names are expected to be unique. * - * @param inputChars the array of characters that contains a sequence of + * @param chars the array of characters that contains a sequence of * name/value pairs * @param separator the name/value pairs separator * * @return a map of name/value pairs */ -public MapString,String parse(final char[] inputChars, char separator) { -if (inputChars == null) { +public MapString,String parse(final char[] chars, char separator) { +if (chars == null) { return new HashMap(); } -return parse(inputChars, 0, inputChars.length, separator); +return parse(chars, 0, chars.length, separator); } /** * Extracts a map of name/value pairs from the given array of * characters. Names are expected to be unique. * - * @param inputChars the array of characters that contains a sequence of + * @param chars the array of characters that contains a sequence of * name/value pairs * @param offset - the initial offset. * @param length - the length. @@ -292,16 +292,16 @@ public class ParameterParser { * @return a map of name/value pairs */ public MapString,String parse( -final char[] inputChars, +final char[] chars, int offset, int length, char separator) { -if (inputChars == null) { +if (chars == null) { return new HashMap(); } HashMapString,String params = new HashMap(); -this.chars = inputChars; +this.chars = chars; this.pos = offset; this.len = length; Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456932r1=1456931r2=1456932view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 12:34:48 2013 @@ -38,7 +38,7 @@ final class QuotedPrintableDecoder { private static final int OUT_SHIFT = 4; /** - * The decoding table size. + * the decoding table size. */ private static final int DECODING_TABLE_SIZE = 128; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456934 - in /tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload: ./ disk/ servlet/ util/
Author: markt Date: Fri Mar 15 12:42:03 2013 New Revision: 1456934 URL: http://svn.apache.org/r1456934 Log: Backport Commons FileUpload changes from trunk Added: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java - copied unchanged from r1456844, tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/package-info.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java - copied unchanged from r1456844, tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/package-info.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java - copied unchanged from r1456844, tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/package-info.java - copied unchanged from r1456844, tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/package-info.java Removed: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/package.html Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ProgressListener.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/RequestContext.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ -- --- svn:mergeinfo (added) +++ svn:mergeinfo Fri Mar 15 12:42:03 2013 @@ -0,0 +1,2 @@ +/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:605690-1453202 +/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222328,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1237995,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,123 9785-1240046,1240101,1240106,1240109,1240112,1240114,1240116,1240118,1240121,1240329,1240474-1240850,1240857,1241087,1241160,1241408-1241822,1241908-1241909,1241912-1242110,1242371-1292130,1292134-1292458,1292464-1292670,1292672-1292776,1292780-1293392,1293397-1297017,1297019-1297963,1297965-1299820,1300108,1300111-1300460,1300520-1300948,1300997,1301006,1301280,1302332,1302348,1302608-1302610,1302649,1302837,1303138,1303163,1303338,1303521,1303587,1303698,1303803,1303852,1304011,1304035,1304037,1304135,1304249,1304253,1304260,1304271,1304275,1304468,1304895,1304930-1304932,1305194,1305943,1305965,1306556,1306579-1306580,1307084,1307310,1307511-1307512,1307579,1307591,1307597,1310636,1310639-1310640,1310642,1310701,1311212,1311995,1327617,1327670,1331766,1333161,1333173,1333827,1334787,1335026,1335257,1335547,1335692,1335711,1335731,1336515,1336813,1336864,1336868,1336884,1337419,1337426,1337546,1337572,1337591-1337595,1337643,1337707,1337719,1337734,1337741,1337745,1338151-
svn commit: r1456935 [2/2] - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/ java/org/apache/tomcat/util/http/fileupload/ java/org/apache/tomcat/util/http/fileupload/disk/ java/org/ap
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java?rev=1456935r1=1456934r2=1456935view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/package-info.java Fri Mar 15 12:47:29 2013 @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** *p * An implementation of Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java?rev=1456935r1=1456934r2=1456935view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java Fri Mar 15 12:47:29 2013 @@ -18,21 +18,26 @@ package org.apache.tomcat.util.http.file import java.io.IOException; - /** * Interface of an object, which may be closed. + * + * @version $Id$ */ public interface Closeable { + /** * Closes the object. + * * @throws IOException An I/O error occurred. */ void close() throws IOException; /** * Returns, whether the object is already closed. + * * @return True, if the object is closed, otherwise false. * @throws IOException An I/O error occurred. */ boolean isClosed() throws IOException; + } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java?rev=1456935r1=1456934r2=1456935view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java Fri Mar 15 12:47:29 2013 @@ -31,10 +31,15 @@ import org.apache.tomcat.util.http.fileu /** * Default implementation of the {@link FileItemHeaders} interface. * - * @author Michael C. Macaluso - * @since 1.3 + * @since 1.2.1 + * + * @version $Id$ */ public class FileItemHeadersImpl implements FileItemHeaders, Serializable { + +/** + * Serial version UID, being used, if serialized. + */ private static final long serialVersionUID = -4455695752627032559L; /** @@ -44,6 +49,9 @@ public class FileItemHeadersImpl impleme private final MapString,ListString headerNameToValueListMap = new LinkedHashMapString,ListString(); +/** + * {@inheritDoc} + */ @Override public String getHeader(String name) { String nameLower = name.toLowerCase(Locale.ENGLISH); @@ -54,11 +62,17 @@ public class FileItemHeadersImpl impleme return headerValueList.get(0); } +/** + * {@inheritDoc} + */ @Override public IteratorString getHeaderNames() { return headerNameToValueListMap.keySet().iterator(); } +/** + * {@inheritDoc} + */ @Override public IteratorString getHeaders(String name) { String nameLower = name.toLowerCase(Locale.ENGLISH); @@ -84,4 +98,5 @@ public class FileItemHeadersImpl impleme } headerValueList.add(value); } + } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java?rev=1456935r1=1456934r2=1456935view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java Fri Mar 15 12:47:29 2013 @@ -20,21 +20,24 @@ import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; - /** * An input stream, which limits its data size. This stream is * used, if the content length is unknown. + * + * @version $Id$ */ -public abstract class LimitedInputStream -extends FilterInputStream implements Closeable { +public abstract class LimitedInputStream extends FilterInputStream implements Closeable { + /** * The maximum size of an item, in bytes. */ -private
Re: svn commit: r1456491 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
On Mar 15, 2013, at 4:50, Rainer Jung rainer.j...@kippdata.de wrote: On 14.03.2013 16:47, ma...@apache.org wrote: Author: markt Date: Thu Mar 14 15:47:24 2013 New Revision: 1456491 URL: http://svn.apache.org/r1456491 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54660 Allow the AccessLogValve file data format to be changed via JMX. The change takes effect as soon as the next message is logged. 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=1456491r1=1456490r2=1456491view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Thu Mar 14 15:47:24 2013 ... @@ -961,6 +972,34 @@ public class AccessLogValve extends Valv /** + * Rotate the log file if necessary. + */ +public void rotate() { It might be nice to publish this new method via JMX. Would be useful to trigger a rotation e.g. at midnight on an idle system that would otherwise only rotate when the next access is logged. That way you can then run reliably your post rotation batches (compression, file transfer) at a defined time. Of course one can also send a dummy request to trigger rotation, but that means switching to a different type of script and might not be easily doable (network access to the right port). The other JMX accessible rotate method needs to be passed a file name which is only useful if you want to control every aspect of the rotation externally. +1 +if (rotatable) { +// Only do a logfile switch check once a second, max. +long systime = System.currentTimeMillis(); +if ((systime - rotationLastChecked) 1000) { +synchronized(this) { +if ((systime - rotationLastChecked) 1000) { +rotationLastChecked = systime; + +String tsDate; +// Check for a change of date +tsDate = fileDateFormatter.format(new Date(systime)); + +// If the date has changed, switch log files +if (!dateStamp.equals(tsDate)) { +close(true); +dateStamp = tsDate; +open(); +} +} +} +} +} +} + +/** * Rename the existing log file to something else. Then open the * old log file name up once again. Intended to be called by a JMX * agent. @@ -1091,28 +1130,8 @@ public class AccessLogValve extends Valv * @param message Message to be logged */ public void log(CharArrayWriter message) { -if (rotatable) { -// Only do a logfile switch check once a second, max. -long systime = System.currentTimeMillis(); -if ((systime - rotationLastChecked) 1000) { -synchronized(this) { -if ((systime - rotationLastChecked) 1000) { -rotationLastChecked = systime; - -String tsDate; -// Check for a change of date -tsDate = fileDateFormatter.format(new Date(systime)); -// If the date has changed, switch log files -if (!dateStamp.equals(tsDate)) { -close(true); -dateStamp = tsDate; -open(); -} -} -} -} -} +rotate(); /* In case something external rotated the file instead */ if (checkExists) { Regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org smime.p7s Description: S/MIME cryptographic signature - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Tomcat Wiki] Update of LocalBadContent by ChuckCaldarale
Dear Wiki user, You have subscribed to a wiki page or wiki category on Tomcat Wiki for change notification. The LocalBadContent page has been changed by ChuckCaldarale: http://wiki.apache.org/tomcat/LocalBadContent?action=diffrev1=80rev2=81 o-f\.com paisi\.com paisidesign\.com + parapharmacie-faure\.com payasocabezon\.com payrollservicesaustralia\.com pbali - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456959 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
Author: violetagg Date: Fri Mar 15 13:57:19 2013 New Revision: 1456959 URL: http://svn.apache.org/r1456959 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 Close the stream at the end of the parse operation. Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1456959r1=1456958r2=1456959view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Mar 15 13:57:19 2013 @@ -1725,6 +1725,17 @@ public class ContextConfig implements Li } +/** + * Parses the given source and stores the parsed data in the given web.xml + * representation. The byte stream will be closed at the end of the parse + * operation. + * + * @param source Input source containing the XML data to be parsed + * @param dest The object representation of common elements of web.xml and + * web-fragment.xml + * @param fragment Specifies whether the source is web-fragment.xml or + * web.xml + */ protected void parseWebXml(InputSource source, WebXml dest, boolean fragment) { @@ -1774,6 +1785,15 @@ public class ContextConfig implements Li } finally { digester.reset(); ruleSet.recycle(); + +InputStream is = source.getByteStream(); +if (is != null) { +try { +is.close(); +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +} +} } } @@ -2517,13 +2537,6 @@ public class ContextConfig implements Li parseWebXml(source, fragment, true); } } finally { -if (is != null) { -try { -is.close(); -} catch (IOException ioe) { -// Ignore -} -} if (jar != null) { jar.close(); } @@ -2563,13 +2576,6 @@ public class ContextConfig implements Li parseWebXml(source, fragment, true); } } finally { -if (stream != null) { -try { -stream.close(); -} catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -} -} fragment.setURL(file.toURI().toURL()); if (fragment.getName() == null) { fragment.setName(fragment.getURL().toString()); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54703] New: Nullpointer exception in HttpParser.parseMediaType
https://issues.apache.org/bugzilla/show_bug.cgi?id=54703 Bug ID: 54703 Summary: Nullpointer exception in HttpParser.parseMediaType Product: Tomcat 7 Version: 7.0.37 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: sandy.me...@bosch-si.com Classification: Unclassified input for parseMediaType() is -- multipart/signed; protocol=application/pkcs7-signature; micalg=sha-256; boundary==_Part_121_929034657.1363355797756 -- exception trace java.lang.NullPointerException at org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(HttpParser.java:215) at org.apache.tomcat.util.http.parser.MediaTypeCache.parse(MediaTypeCache.java:54) at org.apache.catalina.connector.Response.setContentType(Response.java:806) at org.apache.catalina.connector.Response.checkSpecialHeader(Response.java:1119) at org.apache.catalina.connector.Response.setHeader(Response.java:1446) at org.apache.catalina.connector.ResponseFacade.setHeader(ResponseFacade.java:535) -- 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
[Bug 54703] Nullpointer exception in HttpParser.parseMediaType
https://issues.apache.org/bugzilla/show_bug.cgi?id=54703 Sandy Meier sandy.me...@bosch-si.com changed: What|Removed |Added CC||sandy.me...@bosch-si.com -- 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: r1456963 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: ByteArrayOutputStream.java DeferredFileOutputStream.java FileCleaningTracker.java FileDeleteStrategy.java FileUtils
Author: markt Date: Fri Mar 15 14:21:24 2013 New Revision: 1456963 URL: http://svn.apache.org/r1456963 Log: Update to Commons IO 2.4 and run UCDetector over the copied classes Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUtils.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java?rev=1456963r1=1456962r2=1456963view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java Fri Mar 15 14:21:24 2013 @@ -19,7 +19,6 @@ package org.apache.tomcat.util.http.file import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; @@ -35,7 +34,7 @@ import java.util.List; * this class can be called after the stream has been closed without * generating an ttIOException/tt. * p - * This is an alternative implementation of the java.io.ByteArrayOutputStream + * This is an alternative implementation of the {@link java.io.ByteArrayOutputStream} * class. The original implementation only allocates 32 bytes at the beginning. * As this class is designed for heavy duty it starts at 1024 bytes. In contrast * to the original it doesn't reallocate the whole memory block but allocates @@ -44,8 +43,6 @@ import java.util.List; * designed to behave exactly like the original. The only exception is the * deprecated toString(int) method that has been ignored. * - * @author a href=mailto:jerem...@apache.org;Jeremias Maerki/a - * @author Holger Hoffstatte * @version $Id$ */ public class ByteArrayOutputStream extends OutputStream { @@ -54,7 +51,7 @@ public class ByteArrayOutputStream exten private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /** The list of buffers, which grows and never reduces. */ -private Listbyte[] buffers = new ArrayList(); +private final Listbyte[] buffers = new ArrayList(); /** The index of the current buffer. */ private int currentBufferIndex; /** The total count of bytes in all the filled buffers. */ @@ -84,18 +81,9 @@ public class ByteArrayOutputStream exten throw new IllegalArgumentException( Negative initial size: + size); } -needNewBuffer(size); -} - -/** - * Return the appropriate codebyte[]/code buffer - * specified by index. - * - * @param index the index of the buffer required - * @return the buffer - */ -private byte[] getBuffer(int index) { -return buffers.get(index); +synchronized (this) { +needNewBuffer(size); +} } /** @@ -110,7 +98,7 @@ public class ByteArrayOutputStream exten filledBufferSum += currentBuffer.length; currentBufferIndex++; -currentBuffer = getBuffer(currentBufferIndex); +currentBuffer = buffers.get(currentBufferIndex); } else { //Creating new buffer int newBufferSize; @@ -188,7 +176,7 @@ public class ByteArrayOutputStream exten * @return total number of bytes read from the input stream * (and written to this stream) * @throws IOException if an I/O error occurs while reading the input stream - * @since Commons IO 1.4 + * @since 1.4 */ public synchronized int write(InputStream in) throws IOException { int readCount = 0; @@ -208,14 +196,6 @@ public class ByteArrayOutputStream exten } /** - * Return the current size of the byte array. - * @return the current size of the byte array - */ -public synchronized int size() { -return count; -} - -/** * Closing a ttByteArrayOutputStream/tt has no effect. The methods in * this class can be called after the stream has been closed without * generating an ttIOException/tt. @@ -229,16 +209,6 @@ public class ByteArrayOutputStream exten } /** - * @see java.io.ByteArrayOutputStream#reset() - */ -public synchronized void reset() { -count = 0; -filledBufferSum = 0; -
svn commit: r1456964 - /tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java
Author: markt Date: Fri Mar 15 14:23:13 2013 New Revision: 1456964 URL: http://svn.apache.org/r1456964 Log: is Java 7 only Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java?rev=1456964r1=1456963r2=1456964view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/util/mime/MimeUtility.java Fri Mar 15 14:23:13 2013 @@ -38,7 +38,8 @@ public final class MimeUtility { /** * Mappings between MIME and Java charset. */ -private static final MapString, String MIME2JAVA = new HashMap(); +private static final MapString,String MIME2JAVA = +new HashMapString,String(); static { MIME2JAVA.put(iso-2022-cn, ISO2022CN); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456968 - in /tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload: FileUploadBase.java FileUploadException.java
Author: markt Date: Fri Mar 15 14:35:32 2013 New Revision: 1456968 URL: http://svn.apache.org/r1456968 Log: Diff trunk and 7.0.x and apply missing updates to 7.0.x Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456968r1=1456967r2=1456968view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 14:35:32 2013 @@ -341,14 +341,15 @@ public abstract class FileUploadBase { public MapString, ListFileItem parseParameterMap(RequestContext ctx) throws FileUploadException { final ListFileItem items = parseRequest(ctx); -final MapString, ListFileItem itemsMap = new HashMap(items.size()); +final MapString, ListFileItem itemsMap = +new HashMapString, ListFileItem(items.size()); for (FileItem fileItem : items) { String fieldName = fileItem.getFieldName(); ListFileItem mappedItems = itemsMap.get(fieldName); if (mappedItems == null) { -mappedItems = new ArrayList(); +mappedItems = new ArrayListFileItem(); itemsMap.put(fieldName, mappedItems); } @@ -986,32 +987,23 @@ public abstract class FileUploadBase { * {@link FileUploadException} in an {@link IOException}. */ public static class FileUploadIOException extends IOException { -/** The exceptions UID, for serializing an instance. - */ -private static final long serialVersionUID = -7047616958165584154L; -/** The exceptions cause; we overwrite the parent - * classes field, which is available since Java - * 1.4 only. - */ -private final FileUploadException cause; -/** - * Creates a codeFileUploadIOException/code with the - * given cause. - * @param pCause The exceptions cause, if any, or null. - */ -public FileUploadIOException(FileUploadException pCause) { -// We're not doing super(pCause) cause of 1.3 compatibility. -cause = pCause; +private static final long serialVersionUID = -3082868232248803474L; + +public FileUploadIOException() { +super(); } -/** - * Returns the exceptions cause. - * @return The exceptions cause, if any, or null. - */ -@Override -public Throwable getCause() { -return cause; +public FileUploadIOException(String message, Throwable cause) { +super(message, cause); +} + +public FileUploadIOException(String message) { +super(message); +} + +public FileUploadIOException(Throwable cause) { +super(cause); } } @@ -1050,32 +1042,23 @@ public abstract class FileUploadBase { * Thrown to indicate an IOException. */ public static class IOFileUploadException extends FileUploadException { -/** The exceptions UID, for serializing an instance. - */ -private static final long serialVersionUID = 1749796615868477269L; -/** The exceptions cause; we overwrite the parent - * classes field, which is available since Java - * 1.4 only. - */ -private final IOException cause; -/** - * Creates a new instance with the given cause. - * @param pMsg The detail message. - * @param pException The exceptions cause. - */ -public IOFileUploadException(String pMsg, IOException pException) { -super(pMsg); -cause = pException; +private static final long serialVersionUID = -5858565745868986701L; + +public IOFileUploadException() { +super(); } -/** - * Returns the exceptions cause. - * @return The exceptions cause, if any, or null. - */ -@Override -public Throwable getCause() { -return cause; +public IOFileUploadException(String message, Throwable cause) { +super(message, cause); +} + +public IOFileUploadException(String message) { +super(message); +} + +public IOFileUploadException(Throwable cause) { +super(cause); } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java URL:
svn commit: r1456969 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/http/fileupload/ webapps/docs/
Author: markt Date: Fri Mar 15 14:37:04 2013 New Revision: 1456969 URL: http://svn.apache.org/r1456969 Log: Update to Commons IO 2.4 and run UCDetector over the copied classes Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUtils.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1456963 Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ -- Merged /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload:r1456963 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java?rev=1456969r1=1456968r2=1456969view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java Fri Mar 15 14:37:04 2013 @@ -19,7 +19,6 @@ package org.apache.tomcat.util.http.file import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; @@ -35,7 +34,7 @@ import java.util.List; * this class can be called after the stream has been closed without * generating an ttIOException/tt. * p - * This is an alternative implementation of the java.io.ByteArrayOutputStream + * This is an alternative implementation of the {@link java.io.ByteArrayOutputStream} * class. The original implementation only allocates 32 bytes at the beginning. * As this class is designed for heavy duty it starts at 1024 bytes. In contrast * to the original it doesn't reallocate the whole memory block but allocates @@ -44,8 +43,6 @@ import java.util.List; * designed to behave exactly like the original. The only exception is the * deprecated toString(int) method that has been ignored. * - * @author a href=mailto:jerem...@apache.org;Jeremias Maerki/a - * @author Holger Hoffstatte * @version $Id$ */ public class ByteArrayOutputStream extends OutputStream { @@ -54,7 +51,7 @@ public class ByteArrayOutputStream exten private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /** The list of buffers, which grows and never reduces. */ -private Listbyte[] buffers = new ArrayListbyte[](); +private final Listbyte[] buffers = new ArrayListbyte[](); /** The index of the current buffer. */ private int currentBufferIndex; /** The total count of bytes in all the filled buffers. */ @@ -84,18 +81,9 @@ public class ByteArrayOutputStream exten throw new IllegalArgumentException( Negative initial size: + size); } -needNewBuffer(size); -} - -/** - * Return the appropriate codebyte[]/code buffer - * specified by index. - * - * @param index the index of the buffer required - * @return the buffer - */ -private byte[] getBuffer(int index) { -return buffers.get(index); +synchronized (this) { +needNewBuffer(size); +} } /** @@ -110,7 +98,7 @@ public class ByteArrayOutputStream exten filledBufferSum += currentBuffer.length; currentBufferIndex++; -currentBuffer = getBuffer(currentBufferIndex); +currentBuffer = buffers.get(currentBufferIndex); } else { //Creating new buffer int newBufferSize; @@ -188,7 +176,7 @@ public class ByteArrayOutputStream exten * @return total number of bytes read from the input stream * (and written to this stream) * @throws IOException if an I/O error occurs while reading the input stream - * @since Commons IO 1.4 + * @since 1.4 */ public synchronized int write(InputStream in) throws IOException { int readCount = 0; @@ -208,14 +196,6 @@ public
svn commit: r1456970 - /tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml
Author: markt Date: Fri Mar 15 14:42:47 2013 New Revision: 1456970 URL: http://svn.apache.org/r1456970 Log: Expose new rotate method via JMX Modified: tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml Modified: tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml?rev=1456970r1=1456969r2=1456970view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml (original) +++ tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml Fri Mar 15 14:42:47 2013 @@ -109,6 +109,12 @@ type=java.lang.String/ operation name=rotate + description=Check if the log file is due to be rotated and rotate if it is + impact=ACTION + returnType=void +/operation + +operation name=rotate description=Move the existing log file to a new name impact=ACTION returnType=boolean @@ -267,6 +273,12 @@ type=java.lang.String/ operation name=rotate + description=Check if the log file is due to be rotated and rotate if it is + impact=ACTION + returnType=void +/operation + +operation name=rotate description=Move the existing log file to a new name impact=ACTION returnType=boolean - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1456971 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/valves/mbeans-descriptors.xml
Author: markt Date: Fri Mar 15 14:43:23 2013 New Revision: 1456971 URL: http://svn.apache.org/r1456971 Log: Expose new rotate method via JMX Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1456970 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml?rev=1456971r1=1456970r2=1456971view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml Fri Mar 15 14:43:23 2013 @@ -114,6 +114,12 @@ type=java.lang.String/ operation name=rotate + description=Check if the log file is due to be rotated and rotate if it is + impact=ACTION + returnType=void +/operation + +operation name=rotate description=Move the existing log file to a new name impact=ACTION returnType=boolean @@ -282,6 +288,12 @@ type=java.lang.String/ operation name=rotate + description=Check if the log file is due to be rotated and rotate if it is + impact=ACTION + returnType=void +/operation + +operation name=rotate description=Move the existing log file to a new name impact=ACTION returnType=boolean - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54703] Nullpointer exception in HttpParser.parseMediaType
https://issues.apache.org/bugzilla/show_bug.cgi?id=54703 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Mark Thomas ma...@apache.org --- New lines are not permitted in header values. -- 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: r1456982 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml
Author: violetagg Date: Fri Mar 15 15:07:15 2013 New Revision: 1456982 URL: http://svn.apache.org/r1456982 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 Merged revision 1456959 from tomcat/trunk: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 Close the stream at the end of the parse operation. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1456959 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1456982r1=1456981r2=1456982view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Mar 15 15:07:15 2013 @@ -1850,6 +1850,17 @@ public class ContextConfig implements Li } +/** + * Parses the given source and stores the parsed data in the given web.xml + * representation. The byte stream will be closed at the end of the parse + * operation. + * + * @param source Input source containing the XML data to be parsed + * @param dest The object representation of common elements of web.xml and + * web-fragment.xml + * @param fragment Specifies whether the source is web-fragment.xml or + * web.xml + */ protected void parseWebXml(InputSource source, WebXml dest, boolean fragment) { @@ -1897,6 +1908,15 @@ public class ContextConfig implements Li } finally { digester.reset(); ruleSet.recycle(); + +InputStream is = source.getByteStream(); +if (is != null) { +try { +is.close(); +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +} +} } } @@ -2662,13 +2682,6 @@ public class ContextConfig implements Li parseWebXml(source, fragment, true); } } finally { -if (is != null) { -try { -is.close(); -} catch (IOException ioe) { -// Ignore -} -} if (jar != null) { jar.close(); } @@ -2708,13 +2721,6 @@ public class ContextConfig implements Li parseWebXml(source, fragment, true); } } finally { -if (stream != null) { -try { -stream.close(); -} catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -} -} fragment.setURL(file.toURI().toURL()); if (fragment.getName() == null) { fragment.setName(fragment.getURL().toString()); Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1456982r1=1456981r2=1456982view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Mar 15 15:07:15 2013 @@ -82,6 +82,11 @@ revision 1456918 and the associated extract from Commons IO to 2.4. (markt) /update + fix +bug54702/bug: Prevent file descriptors leak and ensure that files +are closed when parsing web application deployment descriptors. +(violetagg) + /fix /changelog /subsection subsection name=Coyote - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54702] File descriptor leak at web.xml loading
https://issues.apache.org/bugzilla/show_bug.cgi?id=54702 Violeta Georgieva violet...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Violeta Georgieva violet...@apache.org --- Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.39 onwards. -- 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
[Bug 54707] New: Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=00000001)
https://issues.apache.org/bugzilla/show_bug.cgi?id=54707 Bug ID: 54707 Summary: Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=0001) Product: Tomcat 7 Version: 7.0.37 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: br...@iris.washington.edu Classification: Unclassified This problem was discovered while trying to make the Perl LWP library work with tomcat where a path was being protected with digest authentication. Ultimately, this is a bug with Perl (see https://rt.cpan.org/Public/Bug/Display.html?id=43354), and it has been possibly fixed. HOWEVER, this requires users to update their perl libraries etc (a big pain for our customers and for us). A simple fix to tomcat would solve this problem for us and make life good again. A typical digest response header from perl looks like: Authorization: Digest username=joe, realm=ACME, qop=auth, algorithm=MD5, uri=/my/protected/path, nonce=1363130363664:71e75a43d7fdbfff8c54bece373058b8, nc=0001, cnonce=513fb7fb, response=baeeff0b6b9b7e74e769630160d3725b, message-digest=d41d8cd98f00b204e9800998ecf8427e, opaque=9C2C62C52D30A7D5707F75F5A813F113 The entry nc=0001 causes tomcat to reject the request. It should be nc=0001 (the perl client's mistake) The following perl script demonstrates the problem: #!/usr/bin/perl use strict; use LWP; doGet(myname, mypassword, myrealmname, myhost, 8080, /my/protected/path); sub doGet { my ($username, $password, $realm, $host, $port, $uri) = @_; my $url = http://.$host.:.$port.$uri; print GET: $url\n; my $browser = LWP::UserAgent-new; $browser-agent('Debug Digest Problem'); $browser-credentials($host.:.$port,$realm,$username=$password); my $response=$browser-get($url); print HTTP STATUS:.$response-status_line.\n; print $response-content; } The fix should be in org.apache.tomcat.util.http.parser.HttpParser.java Looking at build 7.0.37 code: Around line 147: case 3: // FIELD_TYPE_LHEX value = readLhex(input); break; This switch is hit when the field is 'nc' (due to line 72 fieldTypes.put(nc, FIELD_TYPE_LHEX); ] The method readLhex() does not tolerant quotes. (see line 434 and below). A similar tomcat issue was fixed a while back for the quoted qop field. (the qop response field should also not be quoted, but tomcat handles this). Also see line 375 * This is not defined in any RFC. It is a special case to handle data from * buggy clients (known buggy clients include Microsoft IE 8 9, Apple * Safari for OSX and iOS) that add quotes to values that should be tokens. Server software which tolerates this mistake in the perl client includes Apache and Spring's security filter (org.springframework.security.web.authentication.www.DigestAuthenticationFilter). -- 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
[Bug 54707] Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=00000001)
https://issues.apache.org/bugzilla/show_bug.cgi?id=54707 bruce weertman br...@iris.washington.edu changed: What|Removed |Added CC||br...@iris.washington.edu OS||All -- 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
[Bug 54693] Add a validationQueryTimeout property
https://issues.apache.org/bugzilla/show_bug.cgi?id=54693 Christopher Schultz ch...@christopherschultz.net changed: What|Removed |Added OS||All --- Comment #2 from Christopher Schultz ch...@christopherschultz.net --- Only one comment: since a value of 0 disabled query timeout (it will wait forever), why not make the default 0 instead of -1? Also, you mention that QueryTimeoutInterceptor will modify the query timeouts of all queries... how does it interact with this patch? Will QueryTimeoutInterceptor set the query timeout and then your code re-sets the query timeout (presumably to a different value)? If that's the case, what happens when validationQueryTimeout=0 and you are using the QueryTimeoutInterceptor? A reasonable user might expect that the validation query would /never/ time out, but the QueryTimeoutInterceptor would affect it. -- 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: r1457087 - /tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Author: markt Date: Fri Mar 15 19:57:05 2013 New Revision: 1457087 URL: http://svn.apache.org/r1457087 Log: Need to check all types for OnParam and if one is found, move on to the next parameter Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1457087r1=1457086r2=1457087view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Fri Mar 15 19:57:05 2013 @@ -279,17 +279,22 @@ public class PojoMethodMapping { Annotation[][] paramsAnnotations = m.getParameterAnnotations(); for (int i = 0; i types.length; i++) { -if (types[i] == String.class) { -Annotation[] paramAnnotations = paramsAnnotations[i]; -for (Annotation paramAnnotation : paramAnnotations) { -if (paramAnnotation.annotationType().equals( -PathParam.class)) { -indexPathParams.put( -Integer.valueOf(i), new PojoPathParam(types[i], -((PathParam) paramAnnotation).value())); -break; -} +boolean paramFound = false; +Annotation[] paramAnnotations = paramsAnnotations[i]; +for (Annotation paramAnnotation : paramAnnotations) { +if (paramAnnotation.annotationType().equals( +PathParam.class)) { +indexPathParams.put( +Integer.valueOf(i), new PojoPathParam(types[i], +((PathParam) paramAnnotation).value())); +paramFound = true; +break; } +} +if (paramFound) { +continue; +} +if (types[i] == String.class) { if (indexString == -1) { indexString = i; } else { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1457104 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsFrameBase.java WsRemoteEndpointImplBase.java WsSession.java
Author: markt Date: Fri Mar 15 20:40:53 2013 New Revision: 1457104 URL: http://svn.apache.org/r1457104 Log: Correctly handle two stage close process. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Fri Mar 15 20:40:53 2013 @@ -51,6 +51,7 @@ wsSession.duplicateHandlerBinary=A binar wsSession.duplicateHandlerPong=A pong message handler has already been configured wsSession.duplicateHandlerText=A text message handler has already been configured wsSession.expireFailed=Unable to close expired session cleanly +wsSession.sendCloseFail=Failed to send close message to remote endpoint wsSession.invalidHandlerTypePong=A pong message handler must implement MessageHandler.Basic wsSession.removeHandlerFailed=Unable to remove the handler [{0}] as it was not registered with this session wsSession.unknownHandler=Unable to add the message handler [{0}] as it was for the unrecognised type [{1}] Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java Fri Mar 15 20:40:53 2013 @@ -283,7 +283,7 @@ public abstract class WsFrameBase { reason = controlBufferText.toString(); } } -wsSession.close(new CloseReason(Util.getCloseCode(code), reason)); +wsSession.onClose(new CloseReason(Util.getCloseCode(code), reason)); } else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary); Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Fri Mar 15 20:40:53 2013 @@ -243,12 +243,8 @@ public abstract class WsRemoteEndpointIm boolean dataMessage) { synchronized (messagePartLock) { -if (closed) { -close(); -} else { -fragmented = nextFragmented; -text = nextText; -} +fragmented = nextFragmented; +text = nextText; if (dataMessage) { dataMessageInProgress = false; Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Fri Mar 15 20:40:53 2013 @@ -70,8 +70,8 @@ public class WsSession implements Sessio private MessageHandler textMessageHandler = null; private MessageHandler binaryMessageHandler = null; private MessageHandler.WholePongMessage pongMessageHandler = null; -private volatile boolean open = true; -private final Object closeLock = new Object(); +private State state = State.OPEN; +private final Object stateLock = new Object(); private final MapString,Object userProperties = new ConcurrentHashMap(); private volatile int maxBinaryMessageBufferSize = Constants.DEFAULT_BUFFER_SIZE; @@ -226,7 +226,7 @@ public class WsSession implements Sessio @Override public boolean isOpen() { -return open; +return state == State.OPEN; } @@ -293,45 +293,84 @@ public class WsSession implements Sessio @Override public void close(CloseReason closeReason) throws IOException { // Double-checked locking. OK because open is volatile -
svn commit: r1457105 - /tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java
Author: markt Date: Fri Mar 15 20:41:58 2013 New Revision: 1457105 URL: http://svn.apache.org/r1457105 Log: Add a test that confirms BZ 54631 is not an issue. An added bonus was that this test found the close process was not correct. That has now been fixed. Added: tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java (with props) Added: tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java?rev=1457105view=auto == --- tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java (added) +++ tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java Fri Mar 15 20:41:58 2013 @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomcat.websocket.pojo; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +import javax.websocket.ClientEndpoint; +import javax.websocket.ContainerProvider; +import javax.websocket.OnClose; +import javax.websocket.OnMessage; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.WebSocketContainer; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; + +import org.junit.Assert; +import org.junit.Test; + +import org.apache.catalina.Context; +import org.apache.catalina.startup.Tomcat; +import org.apache.catalina.startup.TomcatBaseTest; +import org.apache.tomcat.websocket.pojo.Util.ServerConfigListener; +import org.apache.tomcat.websocket.pojo.Util.SingletonConfigurator; + +public class TestPojoMethodMapping extends TomcatBaseTest { + +private static final String PARAM_ONE = abcde; +private static final String PARAM_TWO = 12345; +private static final String PARAM_THREE = true; + +@Test +public void test() throws Exception { + +// Set up utility classes +Server server = new Server(); +SingletonConfigurator.setInstance(server); +ServerConfigListener.setPojoClazz(Server.class); + +Tomcat tomcat = getTomcatInstance(); +// Must have a real docBase - just use temp +Context ctx = +tomcat.addContext(, System.getProperty(java.io.tmpdir)); +ctx.addApplicationListener(ServerConfigListener.class.getName()); + +WebSocketContainer wsContainer = +ContainerProvider.getWebSocketContainer(); + + +tomcat.start(); + +Client client = new Client(); +URI uri = new URI(http://localhost:; + getPort() + / + PARAM_ONE + +/ + PARAM_TWO + / + PARAM_THREE); + +Session session = wsContainer.connectToServer(client, uri); +session.getBasicRemote().sendText(NO-OP); +session.close(); + +// Give server 5s to close +int count = 0; +while (count 50) { +if (server.isClosed()) { +break; +} +count++; +Thread.sleep(100); +} +if (count == 50) { +Assert.fail(Server did not process an onClose event within 5 + +seconds of the client sending a close message); +} + +// Check no errors +ListString errors = server.getErrors(); +for (String error : errors) { +System.err.println(error); +} +Assert.assertEquals(Found errors, 0, errors.size()); +} + + +@ClientEndpoint +public static final class Client { +} + + +@ServerEndpoint(value=/{one}/{two}/{three}, +configurator=SingletonConfigurator.class) +public static final class Server { + +private final ListString errors = new ArrayList(); +private volatile boolean closed; + +@OnOpen +public void onOpen(@PathParam(one) String p1, @PathParam(two)int p2, +@PathParam(three)boolean p3) { +checkParams(onOpen, p1, p2, p3); +} + +@OnMessage +public void onMessage(@SuppressWarnings(unused) String msg, +@PathParam(one)
[Bug 54631] @PathParam is not working with @OnMessage
https://issues.apache.org/bugzilla/show_bug.cgi?id=54631 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Mark Thomas ma...@apache.org --- Thanks for the report. I wrote a test case and did find some parameter related issues that may have caused the problem you are seeing. The test also found some issues with closing connections that have been fixed. If you try with the latest code from trunk things should be working correctly now. -- 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
[Bug 54700] Improvement: Add support for system property to specify location of APR/native library
https://issues.apache.org/bugzilla/show_bug.cgi?id=54700 Mark Thomas ma...@apache.org changed: What|Removed |Added Severity|normal |enhancement -- 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: r1457104 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsFrameBase.java WsRemoteEndpointImplBase.java WsSession.java
2013/3/16 ma...@apache.org: Author: markt Date: Fri Mar 15 20:40:53 2013 New Revision: 1457104 URL: http://svn.apache.org/r1457104 Log: Correctly handle two stage close process. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Fri Mar 15 20:40:53 2013 @@ -70,8 +70,8 @@ public class WsSession implements Sessio private MessageHandler textMessageHandler = null; private MessageHandler binaryMessageHandler = null; private MessageHandler.WholePongMessage pongMessageHandler = null; -private volatile boolean open = true; -private final Object closeLock = new Object(); +private State state = State.OPEN; +private final Object stateLock = new Object(); private final MapString,Object userProperties = new ConcurrentHashMap(); private volatile int maxBinaryMessageBufferSize = Constants.DEFAULT_BUFFER_SIZE; @@ -226,7 +226,7 @@ public class WsSession implements Sessio @Override public boolean isOpen() { -return open; +return state == State.OPEN; } @@ -293,45 +293,84 @@ public class WsSession implements Sessio @Override public void close(CloseReason closeReason) throws IOException { // Double-checked locking. OK because open is volatile The above comment is obsoleted by this commit, as open field is removed and state is not volatile. I'd say that it is ok for the state to be non volatile because it only changes one way (open-closing-closed) and thus no harm for seeing stale value if the stale value is State.OPEN. -if (!open) { +if (state != State.OPEN) { return; } -synchronized (closeLock) { -if (!open) { +synchronized (stateLock) { +if (state != State.OPEN) { return; } -open = false; +state = State.CLOSING; -// Send the close message -// 125 is maximum size for the payload of a control message -ByteBuffer msg = ByteBuffer.allocate(125); -msg.putShort((short) closeReason.getCloseCode().getCode()); -String reason = closeReason.getReasonPhrase(); -if (reason != null reason.length() 0) { -msg.put(reason.getBytes(UTF8)); +sendCloseMessage(closeReason); +} +} 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: r1457104 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsFrameBase.java WsRemoteEndpointImplBase.java WsSession.java
On 15/03/2013 21:00, Konstantin Kolinko wrote: 2013/3/16 ma...@apache.org: Author: markt Date: Fri Mar 15 20:40:53 2013 New Revision: 1457104 URL: http://svn.apache.org/r1457104 Log: Correctly handle two stage close process. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1457104r1=1457103r2=1457104view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Fri Mar 15 20:40:53 2013 @@ -70,8 +70,8 @@ public class WsSession implements Sessio private MessageHandler textMessageHandler = null; private MessageHandler binaryMessageHandler = null; private MessageHandler.WholePongMessage pongMessageHandler = null; -private volatile boolean open = true; -private final Object closeLock = new Object(); +private State state = State.OPEN; +private final Object stateLock = new Object(); private final MapString,Object userProperties = new ConcurrentHashMap(); private volatile int maxBinaryMessageBufferSize = Constants.DEFAULT_BUFFER_SIZE; @@ -226,7 +226,7 @@ public class WsSession implements Sessio @Override public boolean isOpen() { -return open; +return state == State.OPEN; } @@ -293,45 +293,84 @@ public class WsSession implements Sessio @Override public void close(CloseReason closeReason) throws IOException { // Double-checked locking. OK because open is volatile The above comment is obsoleted by this commit, as open field is removed and state is not volatile. I'd say that it is ok for the state to be non volatile because it only changes one way (open-closing-closed) and thus no harm for seeing stale value if the stale value is State.OPEN. I think there might be some potential harm there. I'll make it volatile and fix the comment. Thanks for the catch. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1457118 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java
Author: markt Date: Fri Mar 15 21:08:34 2013 New Revision: 1457118 URL: http://svn.apache.org/r1457118 Log: Update comment. Make state volatile Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1457118r1=1457117r2=1457118view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Fri Mar 15 21:08:34 2013 @@ -70,7 +70,7 @@ public class WsSession implements Sessio private MessageHandler textMessageHandler = null; private MessageHandler binaryMessageHandler = null; private MessageHandler.WholePongMessage pongMessageHandler = null; -private State state = State.OPEN; +private volatile State state = State.OPEN; private final Object stateLock = new Object(); private final MapString,Object userProperties = new ConcurrentHashMap(); private volatile int maxBinaryMessageBufferSize = @@ -292,7 +292,7 @@ public class WsSession implements Sessio @Override public void close(CloseReason closeReason) throws IOException { -// Double-checked locking. OK because open is volatile +// Double-checked locking. OK because state is volatile if (state != State.OPEN) { return; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54707] Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=00000001)
https://issues.apache.org/bugzilla/show_bug.cgi?id=54707 --- Comment #1 from bruce weertman br...@iris.washington.edu --- Created attachment 30055 -- https://issues.apache.org/bugzilla/attachment.cgi?id=30055action=edit Possible change to HttpParser.readLhex and HttpParser.readQuotedLhex To fix the problem, readLhex() must be changed. The existing readQuotedLhex() calls readLhex(), therefore it must also be changed. This fix places the old readLhex() code inside of readQuotedLhex() so that it does not call readLhex(). The new readLhex() can tolerate an optional starting quote. If there's a starting quote, but no ending quote, readLhex() returns null. Easy as Pi. -- 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
[Bug 54707] Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=00000001)
https://issues.apache.org/bugzilla/show_bug.cgi?id=54707 --- Comment #3 from bruce weertman br...@iris.washington.edu --- I believe this will make Perl work and everything else fail!. Another alternative would be to make quotes optional all the way round, but I'm not sure that's good idea? Maybe it is, I don't know. -- 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
[Bug 54707] Buggy Perl http clients cause tomcat digest auth to fail due to quoted nc values (e.g. nc=00000001)
https://issues.apache.org/bugzilla/show_bug.cgi?id=54707 --- Comment #4 from bruce weertman br...@iris.washington.edu --- This doesn't really cause a problem since there's a fall through that catches the mistake... But at line 66 you'll see: fieldTypes.put(digest-uri, FIELD_TYPE_QUOTED_STRING); I believe that's a typo. Should read: fieldTypes.put(uri, FIELD_TYPE_QUOTED_STRING); See: http://tools.ietf.org/html/rfc2617 3.2.2 The Authorization Request Header digest-uri = uri = digest-uri-value digest-uri-value = request-uri ; As specified by HTTP/1.1 The RFC's are hard to read! -- 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