cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
yoavs 2004/05/27 09:09:48 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Added support for threadPriority attribute (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28914). Revision ChangesPath 1.43 +28 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- CoyoteConnector.java 24 Apr 2004 14:52:09 - 1.42 +++ CoyoteConnector.java 27 May 2004 16:09:48 - 1.43 @@ -164,6 +164,12 @@ /** + * The thread priority for processors. + */ +private int threadPriority = Thread.NORM_PRIORITY; + + +/** * Linger value on the incoming connection. * Note : a value inferior to 0 means no linger. */ @@ -772,6 +778,27 @@ setProperty(maxThreads, String.valueOf(maxProcessors)); } + +/** + * Return the processor thread priority. + * + * @return int + */ +public int getThreadPriority() { + return threadPriority; +} + + +/** + * Sets the processor thread priority. + * + * @param threadPriority The new priority level + */ +public void setThreadPriority(int threadPriority) { + this.threadPriority = threadPriority; + setProperty(threadPriority, String.valueOf(threadPriority)); +} + /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2004/04/24 07:52:09 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Always introspect for protocol hadlers, so that the attributes are meaningful. This fixes all the errors which are displayed when using the JMX proxy to view the JK handler. Revision ChangesPath 1.42 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- CoyoteConnector.java 27 Feb 2004 14:58:52 - 1.41 +++ CoyoteConnector.java 24 Apr 2004 14:52:09 - 1.42 @@ -1486,7 +1486,7 @@ try { Registry.getRegistry(null, null).registerComponent (protocolHandler, this.domain + :type=protocolHandler,className= - + protocolHandlerClassName, protocolHandler); + + protocolHandlerClassName, null); } catch (Exception ex) { log.error(sm.getString (coyoteConnector.protocolRegistrationFailed), ex); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java LocalStrings.properties
remm2004/02/26 07:26:13 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java LocalStrings.properties Log: - Add missing properties. Display the root cause if something bad happens, and don't rethrow the exception. Revision ChangesPath 1.40 +6 -8 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- CoyoteConnector.java 26 Jan 2004 20:19:10 - 1.39 +++ CoyoteConnector.java 26 Feb 2004 15:26:13 - 1.40 @@ -1348,7 +1348,7 @@ { if (initialized) { log.info(sm.getString(coyoteConnector.alreadyInitialized)); -return; + return; } this.initialized = true; @@ -1459,9 +1459,8 @@ try { protocolHandler.pause(); } catch (Exception e) { -throw new LifecycleException -(sm.getString - (coyoteConnector.protocolHandlerPauseFailed, e)); +log.error(sm.getString + (coyoteConnector.protocolHandlerPauseFailed), e); } } @@ -1474,9 +1473,8 @@ try { protocolHandler.resume(); } catch (Exception e) { -throw new LifecycleException -(sm.getString - (coyoteConnector.protocolHandlerResumeFailed, e)); +log.error(sm.getString + (coyoteConnector.protocolHandlerResumeFailed), e); } } 1.3 +2 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/LocalStrings.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 15 Nov 2003 09:45:02 - 1.2 +++ LocalStrings.properties 26 Feb 2004 15:26:13 - 1.3 @@ -12,6 +12,8 @@ coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation failed: {0} coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed: {0} coyoteConnector.protocolRegistrationFailed=Protocol JMX registration failed +coyoteConnector.protocolHandlerPauseFailed=Protocol handler pause failed +coyoteConnector.protocolHandlerResumeFailed=Protocol handler resume failed # # CoyoteAdapter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
remm2004/01/26 10:15:01 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: - Implement clean shutdown of the connectors (my third proposal). - Add pause and resume methods. Revision ChangesPath 1.38 +32 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- CoyoteConnector.java 24 Jan 2004 07:21:04 - 1.37 +++ CoyoteConnector.java 26 Jan 2004 18:15:01 - 1.38 @@ -1449,6 +1449,37 @@ } } + +/** + * Pause the connector. + */ +public void pause() +throws LifecycleException { +try { +protocolHandler.pause(); +} catch (Exception e) { +throw new LifecycleException +(sm.getString + (coyoteConnector.protocolHandlerPauseFailed, e)); +} +} + + +/** + * Pause the connector. + */ +public void resume() +throws LifecycleException { +try { +protocolHandler.resume(); +} catch (Exception e) { +throw new LifecycleException +(sm.getString + (coyoteConnector.protocolHandlerResumeFailed, e)); +} +} + + /* * Translate the attribute name from the legacy Factory names to their * internal protocol names. 1.16 +2 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- mbeans-descriptors.xml25 Jan 2004 01:52:48 - 1.15 +++ mbeans-descriptors.xml26 Jan 2004 18:15:01 - 1.16 @@ -192,6 +192,8 @@ operation name=start description=Start impact=ACTION returnType=void / operation name=stop description=Stop impact=ACTION returnType=void / +operation name=pause description=Start impact=ACTION returnType=void / +operation name=resume description=Stop impact=ACTION returnType=void / operation name=init description=Init impact=ACTION returnType=void / operation name=destroy description=Destroy impact=ACTION returnType=void / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml
billbarker2004/01/23 23:21:04 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml Log: Add support for the new values of clientAuth. Revision ChangesPath 1.37 +8 -10 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- CoyoteConnector.java 22 Jan 2004 18:27:04 - 1.36 +++ CoyoteConnector.java 24 Jan 2004 07:21:04 - 1.37 @@ -1398,10 +1398,8 @@ (CoyoteServerSocketFactory) factory; IntrospectionUtils.setProperty(protocolHandler, algorithm, ssf.getAlgorithm()); -if (ssf.getClientAuth()) { -IntrospectionUtils.setProperty(protocolHandler, clientauth, -+ ssf.getClientAuth()); -} +IntrospectionUtils.setProperty(protocolHandler, clientauth, + ssf.getClientAuth()); IntrospectionUtils.setProperty(protocolHandler, keystore, ssf.getKeystoreFile()); IntrospectionUtils.setProperty(protocolHandler, randomfile, @@ -1573,12 +1571,12 @@ // Management methods -public boolean getClientAuth() { -boolean ret = false; +public String getClientAuth() { +String ret = false; String prop = (String) getProperty(clientauth); if (prop != null) { -ret = Boolean.valueOf(prop).booleanValue(); +ret = prop; } else { ServerSocketFactory factory = this.getFactory(); if (factory instanceof CoyoteServerSocketFactory) { @@ -1589,8 +1587,8 @@ return ret; } -public void setClientAuth(boolean clientAuth) { -setProperty(clientauth, String.valueOf(clientAuth)); +public void setClientAuth(String clientAuth) { +setProperty(clientauth, clientAuth); ServerSocketFactory factory = this.getFactory(); if (factory instanceof CoyoteServerSocketFactory) { ((CoyoteServerSocketFactory)factory).setClientAuth(clientAuth); 1.6 +9 -5 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java Index: CoyoteServerSocketFactory.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- CoyoteServerSocketFactory.java2 Sep 2003 21:21:59 - 1.5 +++ CoyoteServerSocketFactory.java24 Jan 2004 07:21:04 - 1.6 @@ -94,7 +94,7 @@ implements org.apache.catalina.net.ServerSocketFactory { private String algorithm = null; -private boolean clientAuth = false; +private String clientAuth = false; private String keystoreFile = System.getProperty(user.home) + File.separator + .keystore; private String randomFile = @@ -132,19 +132,23 @@ /** * Provides information about whether client authentication is enforced. * - * @return true if client authentication is enforced, false otherwise + * @return codetrue/code if client authentication is enforced, + * codewant/code if client authentication is desired, + * codefalse/code otherwise */ -public boolean getClientAuth() { +public String getClientAuth() { return (this.clientAuth); } /** * Sets the requirement of client authentication. * - * @param clientAuth true if client authentication is enforced, false + * @param clientAuth codetrue/code if client authentication is enforced, + * codewant/code if client authentication is desired, + * codefalse/code * otherwise */ -public void setClientAuth(boolean clientAuth) { +public void setClientAuth(String clientAuth) { this.clientAuth = clientAuth; } 1.14 +1 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file:
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
remm2004/01/22 10:27:04 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: - Allow configuring the header size (for most use cases, it was too big, and since it represents 75% of the memory allocated by Tomcat). - New default size: 4 KB (the whole HTTP header must fit inside that, for both the request and the response). - Allocations of these buffers can't be dynamic: there are too many references lying around, and this guarantees leaks. The only safe way to reallocate the buffers if to get rid of the processor. - Note: In Tomcat 4.1.30, I'll integrate the same connectors as in 5.0.18, to avoid possible problems. Revision ChangesPath 1.36 +23 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- CoyoteConnector.java 10 Jan 2004 20:39:50 - 1.35 +++ CoyoteConnector.java 22 Jan 2004 18:27:04 - 1.36 @@ -301,6 +301,12 @@ /** + * Maximum size of a HTTP header. 4KB is the default. + */ +private int maxHttpHeaderSize = 4 * 1024; + + +/** * Maximum number of Keep-Alive requests to honor per connection. */ private int maxKeepAliveRequests = 100; @@ -1041,6 +1047,21 @@ } /** + * Return the maximum HTTP header size. + */ +public int getMaxHttpHeaderSize() { +return maxHttpHeaderSize; +} + +/** + * Set the maximum HTTP header size. + */ +public void setMaxHttpHeaderSize(int size) { +maxHttpHeaderSize = size; +setProperty(maxHttpHeaderSize, String.valueOf(size)); +} + +/** * Return the maximum number of Keep-Alive requests to honor * per connection. */ @@ -1055,6 +1076,7 @@ maxKeepAliveRequests = mkar; setProperty(maxKeepAliveRequests, String.valueOf(mkar)); } + /** * Return the scheme that will be assigned to requests received 1.13 +4 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mbeans-descriptors.xml10 Jan 2004 20:39:50 - 1.12 +++ mbeans-descriptors.xml22 Jan 2004 18:27:04 - 1.13 @@ -85,6 +85,10 @@ description=Alias name of this connector's keypair and supporting certificate chain type=java.lang.String/ +attribute name=maxHttpHeaderSize + description=Maximum size in bytes of the HTTP header + type=int/ + attribute name=maxKeepAliveRequests description=Maximum number of Keep-Alive requests to honor per connection type=int/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml
remm2003/12/10 14:26:28 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml Log: - Add a flag to allow using the encoding specified in the contentType for the URI paramters. This is disabled by default, not compliant with the standards, but present for compatibility. Revision ChangesPath 1.34 +31 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- CoyoteConnector.java 17 Nov 2003 00:43:54 - 1.33 +++ CoyoteConnector.java 10 Dec 2003 22:26:28 - 1.34 @@ -375,6 +375,12 @@ private String URIEncoding = null; + /** + * URI encoding as body. + */ + private boolean useBodyEncodingForURI = false; + + // - Properties @@ -1124,6 +1130,30 @@ this.URIEncoding = URIEncoding; setProperty(uRIEncoding, URIEncoding); + + } + + + /** + * Return the true if the entity body encoding should be used for the URI. + */ + public boolean getUseBodyEncodingForURI() { + + return (this.useBodyEncodingForURI); + + } + + + /** + * Set if the entity body encoding should be used for the URI. + * + * @param useBodyEncodingForURI The new value for the flag. + */ + public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI) { + + this.useBodyEncodingForURI = useBodyEncodingForURI; + setProperty + (useBodyEncodingForURI, String.valueOf(useBodyEncodingForURI)); } 1.27 +15 -7 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java Index: CoyoteRequest.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- CoyoteRequest.java4 Dec 2003 13:49:28 - 1.26 +++ CoyoteRequest.java10 Dec 2003 22:26:28 - 1.27 @@ -481,7 +481,7 @@ /** * Associated Catalina connector. */ -protected Connector connector; +protected CoyoteConnector connector; /** * Return the Connector through which this Request was received. @@ -496,7 +496,7 @@ * @param connector The new connector */ public void setConnector(Connector connector) { -this.connector = connector; +this.connector = (CoyoteConnector) connector; } @@ -2324,11 +2324,19 @@ Parameters parameters = coyoteRequest.getParameters(); String enc = coyoteRequest.getCharacterEncoding(); +boolean useBodyEncodingForURI = connector.getUseBodyEncodingForURI(); if (enc != null) { parameters.setEncoding(enc); +if (useBodyEncodingForURI) { +parameters.setQueryStringEncoding(enc); +} } else { parameters.setEncoding (org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING); +if (useBodyEncodingForURI) { +parameters.setQueryStringEncoding +(org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING); +} } parameters.handleQueryParameters(); @@ -2354,7 +2362,7 @@ int len = getContentLength(); if (len 0) { -int maxPostSize = ((CoyoteConnector) connector).getMaxPostSize(); +int maxPostSize = connector.getMaxPostSize(); if ((maxPostSize 0) (len maxPostSize)) { log(sm.getString(coyoteRequest.postTooLarge)); throw new IllegalStateException(Post too large); 1.10 +4 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mbeans-descriptors.xml16 Nov 2003 21:19:49 - 1.9 +++ mbeans-descriptors.xml10 Dec 2003 22:26:28 - 1.10 @@ -173,6 +173,10 @@
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml
[EMAIL PROTECTED] wrote: remm2003/12/10 14:26:28 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml Log: - Add a flag to allow using the encoding specified in the contentType for the URI paramters. This is disabled by default, not compliant with the standards, but present for compatibility. This is bad, I am not as stubborn as I used to be: I only needed three or so bug reports to change my mind. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml
Remy Maucherat wrote: [EMAIL PROTECTED] wrote: remm2003/12/10 14:26:28 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java mbeans-descriptors.xml Log: - Add a flag to allow using the encoding specified in the contentType for the URI paramters. This is disabled by default, not compliant with the standards, but present for compatibility. This is bad, I am not as stubborn as I used to be: I only needed three or so bug reports to change my mind. I knew you would come around eventually if I just shut up ;-) Hans -- Hans Bergsten[EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com/ Author of O'Reilly's JavaServer Pages, covering JSP 2.0 and JSTL 1.1 Details athttp://TheJSPBook.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
Bill Barker wrote: remm2003/11/15 01:45:02 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties Log: - Add a limit to the size of a POST which will be processed using getParameter (which does allocate a significant amount of objects). int len = getContentLength(); if (len 0) { +if (len ((CoyoteConnector) connector).getMaxPostSize()) { +log(sm.getString(coyoteRequest.postTooLarge)); +return; +} try { byte[] formData = null; if (len CACHED_POST_LEN) { I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. This is a security issues, so I'll have to ignore your -1, since you give no alternative solution. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
Bill Barker wrote: I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. I disagree: the problem with this is that we allocate one array right away based on content-length, not that there's a big upload (which is fine). Obviously, keep-alive is not an option in that case (and Tomcat will attempt to swallow any remaining output). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
Bill Barker wrote: I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. One last thing I forgot: you can't do it beforehand, because you don't know if the servlet is going to use getParameterXXX. So I don't agree on putting this check in postParseRequest. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Sunday, November 16, 2003 2:34 AM Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties Bill Barker wrote: I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. I disagree: the problem with this is that we allocate one array right away based on content-length, not that there's a big upload (which is fine). The Adaptor can check for this: if(POST.equalsIgnoreCase(request.getMethod()) application/x-www-form-urlencoded.equals(contentType) request.getContentLength() connector.getMaxPostSize()) { response.setStatus(413); response.setMessage(POST Body exceeds maximum); return false; } Obviously, keep-alive is not an option in that case (and Tomcat will attempt to swallow any remaining output). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
Bill Barker wrote: Bill Barker wrote: I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. I disagree: the problem with this is that we allocate one array right away based on content-length, not that there's a big upload (which is fine). The Adaptor can check for this: if(POST.equalsIgnoreCase(request.getMethod()) application/x-www-form-urlencoded.equals(contentType) request.getContentLength() connector.getMaxPostSize()) { response.setStatus(413); response.setMessage(POST Body exceeds maximum); return false; } This is not very efficient (doing checks there as well as in parse parameters), and what if the servlet intended to stream the body by itself ? (in this case, there's no particular efficiency problem) So that's why I did do the check lazily (like the parsing itself, which must be lazy). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
billbarker2003/11/16 16:43:54 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: This is going to be needed in the Protocol as well, to handle the case of CLIENT-CERT auth. Revision ChangesPath 1.33 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- CoyoteConnector.java 15 Nov 2003 09:45:02 - 1.32 +++ CoyoteConnector.java 17 Nov 2003 00:43:54 - 1.33 @@ -798,7 +798,7 @@ public void setMaxPostSize(int maxPostSize) { this.maxPostSize = maxPostSize; - +setProperty(maxPostSize, String.valueOf(maxPostSize)); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
remm2003/11/15 01:45:02 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties Log: - Add a limit to the size of a POST which will be processed using getParameter (which does allocate a significant amount of objects). Revision ChangesPath 1.32 +36 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- CoyoteConnector.java 10 Nov 2003 21:08:09 - 1.31 +++ CoyoteConnector.java 15 Nov 2003 09:45:02 - 1.32 @@ -272,10 +272,12 @@ */ private boolean secure = false; + /** For jk, do tomcat authentication if true, trust server if false */ private boolean tomcatAuthentication = true; + /** * The string manager for this package. */ @@ -291,6 +293,7 @@ */ private boolean disableUploadTimeout = false; + /** * Maximum number of Keep-Alive requests to honor per connection. */ @@ -298,6 +301,13 @@ /** + * Maximum size of a POST which will be automatically parsed by the + * container. 2MB by default. + */ +private int maxPostSize = 2 * 1024 * 1024; + + +/** * Has this component been initialized yet? */ private boolean initialized = false; @@ -763,6 +773,31 @@ this.maxProcessors = maxProcessors; setProperty(maxThreads, String.valueOf(maxProcessors)); + +} + + +/** + * Return the maximum size of a POST which will be automatically + * parsed by the container. + */ +public int getMaxPostSize() { + +return (maxPostSize); + +} + + +/** + * Set the maximum size of a POST which will be automatically + * parsed by the container. + * + * @param maxPostSize The new maximum size in bytes of a POST which will + * be automatically parsed by the container + */ +public void setMaxPostSize(int maxPostSize) { + +this.maxPostSize = maxPostSize; } 1.18 +8 -4 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java Index: CoyoteRequest.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- CoyoteRequest.java18 Sep 2003 22:50:08 - 1.17 +++ CoyoteRequest.java15 Nov 2003 09:45:02 - 1.18 @@ -2320,6 +2320,10 @@ int len = getContentLength(); if (len 0) { +if (len ((CoyoteConnector) connector).getMaxPostSize()) { +log(sm.getString(coyoteRequest.postTooLarge)); +return; +} try { byte[] formData = null; if (len CACHED_POST_LEN) { 1.2 +1 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/LocalStrings.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LocalStrings.properties 19 Apr 2003 19:00:43 - 1.1 +++ LocalStrings.properties 15 Nov 2003 09:45:02 - 1.2 @@ -41,6 +41,7 @@ coyoteRequest.listenerStart=Exception sending context initialized event to listener instance of class {0} coyoteRequest.listenerStop=Exception sending context destroyed event to listener instance of class {0} coyoteRequest.attributeEvent=Exception thrown by attributes event listener +coyoteRequest.postTooLarge=Parameters were not parsed because the size of the posted data was too big. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs. # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
I like this idea. But if the client sends too much data, it appears there will be no post data for the Servlet/JSP to process causing strange user errors. (User: Why is getParameter(...) null?) Should an error of SC_REQUEST_ENTITY_TOO_LARGE be sent instead? Of course, checking this too early before the user has chance to use a reader or input stream could also cause problems. I guess I don't know what I want, but I wonder what to say in the future in case the assumption above is correct and I see a tomcat-user post about this. Would it also be reasonable to allow a value of 0 (or -1) to disable this feature? -Tim [EMAIL PROTECTED] wrote: remm2003/11/15 01:45:02 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties Log: - Add a limit to the size of a POST which will be processed using getParameter (which does allocate a significant amount of objects). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
Tim Funk wrote: I like this idea. But if the client sends too much data, it appears there will be no post data for the Servlet/JSP to process causing strange user errors. (User: Why is getParameter(...) null?) Should an error of SC_REQUEST_ENTITY_TOO_LARGE be sent instead? Of course, checking this too early before the user has chance to use a reader or input stream could also cause problems. For now, the error is logged, and that's it. I guess I don't know what I want, but I wonder what to say in the future in case the assumption above is correct and I see a tomcat-user post about this. Would it also be reasonable to allow a value of 0 (or -1) to disable this feature? -1 for unlimited sounds good to me. I should have tought about that. Good catch. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 1:45 AM Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties remm2003/11/15 01:45:02 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java LocalStrings.properties Log: - Add a limit to the size of a POST which will be processed using getParameter (which does allocate a significant amount of objects). int len = getContentLength(); if (len 0) { +if (len ((CoyoteConnector) connector).getMaxPostSize()) { +log(sm.getString(coyoteRequest.postTooLarge)); +return; +} try { byte[] formData = null; if (len CACHED_POST_LEN) { I'm -1 on this. It gives the Servlet no indication that anything is wrong, and leaves junk in the input stream for the next keep-alive request. I think that it would be better to handle this in the Adaptor's postParseRequest method. This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
amyroh 2003/11/10 13:08:09 Modified:catalina/src/share/org/apache/catalina/mbeans MBeanFactory.java catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Encode address property so Connector can handle IPV6 address in ObjectName. No longer throws MalformedObjectNameException with IPV6 address. Revision ChangesPath 1.20 +7 -7 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java Index: MBeanFactory.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- MBeanFactory.java 1 Oct 2003 01:31:36 - 1.19 +++ MBeanFactory.java 10 Nov 2003 21:08:09 - 1.20 @@ -491,9 +491,9 @@ Method getObjectName = cls.getMethod(getObjectName, null); // Return the corresponding MBean name -//ObjectName coname = (ObjectName)getObjectName.invoke(retobj, null); -ObjectName coname = -MBeanUtils.createObjectName(pname.getDomain(), (Connector)retobj); +ObjectName coname = (ObjectName)getObjectName.invoke(retobj, null); +//ObjectName coname = +//MBeanUtils.createObjectName(pname.getDomain(), (Connector)retobj); return (coname.toString()); } catch (Exception e) { throw new MBeanException(e); 1.31 +7 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- CoyoteConnector.java 6 Oct 2003 08:56:11 - 1.30 +++ CoyoteConnector.java 10 Nov 2003 21:08:09 - 1.31 @@ -60,6 +60,7 @@ package org.apache.coyote.tomcat5; +import java.net.URLEncoder; import java.util.HashMap; import java.util.Iterator; @@ -1241,7 +1242,11 @@ try { // we are loaded directly, via API - and no name was given to us StandardEngine cb=(StandardEngine)container; -String addSuffix=(getAddress()==null) ?: ,address= + getAddress(); +String encodedAddr = null; +if (getAddress() != null) { +encodedAddr = URLEncoder.encode(getAddress()); +} +String addSuffix=(getAddress()==null) ?: ,address= + encodedAddr; oname=new ObjectName(cb.getName() + :type=Connector,port=+ getPort() + addSuffix); Registry.getRegistry().registerComponent(this, oname, null); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/10/06 01:56:11 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Remove redundant change. Revision ChangesPath 1.30 +2 -8 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- CoyoteConnector.java 5 Oct 2003 21:00:38 - 1.29 +++ CoyoteConnector.java 6 Oct 2003 08:56:11 - 1.30 @@ -364,14 +364,8 @@ private String URIEncoding = null; -// Constructor - -public CoyoteConnector() { -setProperty(tcpNoDelay, String.valueOf(tcpNoDelay)); -} - - // - Properties + /** * Return a configured property. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
luehe 2003/10/05 14:00:38 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Set the tcpNoDelay property on the underlying socket even if this property has not been set explicitly on CoyoteConnector (in which case the property of the underlying socket is set to TRUE, the default in CoyoteConnector). This restores the behaviour in earlier CoyoteConnector versions and fixes a huge performance degradation. Revision ChangesPath 1.29 +8 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- CoyoteConnector.java 2 Sep 2003 21:21:59 - 1.28 +++ CoyoteConnector.java 5 Oct 2003 21:00:38 - 1.29 @@ -364,6 +364,13 @@ private String URIEncoding = null; +// Constructor + +public CoyoteConnector() { +setProperty(tcpNoDelay, String.valueOf(tcpNoDelay)); +} + + // - Properties /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 05, 2003 2:00 PM Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java luehe 2003/10/05 14:00:38 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Set the tcpNoDelay property on the underlying socket even if this property has not been set explicitly on CoyoteConnector (in which case the property of the underlying socket is set to TRUE, the default in CoyoteConnector). This restores the behaviour in earlier CoyoteConnector versions and fixes a huge performance degradation. I'm -1 on this. There shouldn't be default properties set from the Connector. If you want the default to be 'true', then change either default it in the Http11Protocol, or change the current default value in PoolTcpEndpoint. This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
Bill Barker wrote: luehe 2003/10/05 14:00:38 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Set the tcpNoDelay property on the underlying socket even if this property has not been set explicitly on CoyoteConnector (in which case the property of the underlying socket is set to TRUE, the default in CoyoteConnector). This restores the behaviour in earlier CoyoteConnector versions and fixes a huge performance degradation. I'm -1 on this. There shouldn't be default properties set from the Connector. If you want the default to be 'true', then change either default it in the Http11Protocol, or change the current default value in PoolTcpEndpoint. I completely agree with that. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
amyroh 2003/08/28 19:44:16 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Remove get/set I added previously. JMX management is done in ConnectorMBean now. I think we can remove other get/setters too. Revision ChangesPath 1.26 +1 -47 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- CoyoteConnector.java 25 Aug 2003 22:08:24 - 1.25 +++ CoyoteConnector.java 29 Aug 2003 02:44:16 - 1.26 @@ -1459,26 +1459,6 @@ // Management methods - -public String getAlgorithm() { -String ret = (String) getProperty(algorithm); -if (ret == null) { -ServerSocketFactory factory = this.getFactory(); -if (factory instanceof CoyoteServerSocketFactory) { -ret = ((CoyoteServerSocketFactory)factory).getAlgorithm(); -} -} - -return ret; -} - -public void setAlgorithm(String algorithm) { -setProperty(algorithm, algorithm); -ServerSocketFactory factory = this.getFactory(); -if (factory instanceof CoyoteServerSocketFactory) { -((CoyoteServerSocketFactory)factory).setAlgorithm(algorithm); -} -} public boolean getClientAuth() { boolean ret = false; @@ -1548,32 +1528,6 @@ ServerSocketFactory factory = getFactory(); if( factory instanceof CoyoteServerSocketFactory ) { ((CoyoteServerSocketFactory)factory).setKeystorePass(keystorePass); -} -} - -/** - * Return keystoreType - */ -public String getKeystoreType() { -String ret = (String) getProperty(keytype); -if (ret == null) { -ServerSocketFactory factory = getFactory(); -if (factory instanceof CoyoteServerSocketFactory ) { -return ((CoyoteServerSocketFactory)factory).getKeystoreType(); -} -} - -return ret; -} - -/** - * Set keystoreType - */ -public void setKeystoreType(String keystoreType) { -setProperty(keytype, keystoreType); -ServerSocketFactory factory = getFactory(); -if( factory instanceof CoyoteServerSocketFactory ) { -((CoyoteServerSocketFactory)factory).setKeystoreType(keystoreType); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/08/29 14:34:46 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Since port is mandatory, there should be no default value. (this is a quick fix obviously) Revision ChangesPath 1.27 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- CoyoteConnector.java 29 Aug 2003 02:44:16 - 1.26 +++ CoyoteConnector.java 29 Aug 2003 21:34:46 - 1.27 @@ -239,7 +239,7 @@ /** * The port number on which we listen for requests. */ -private int port = 8080; +private int port = 0; /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
amyroh 2003/08/25 15:08:24 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: Update connector mbean management attributes. Revision ChangesPath 1.25 +48 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- CoyoteConnector.java 20 Aug 2003 16:27:35 - 1.24 +++ CoyoteConnector.java 25 Aug 2003 22:08:24 - 1.25 @@ -1459,6 +1459,27 @@ // Management methods + +public String getAlgorithm() { +String ret = (String) getProperty(algorithm); +if (ret == null) { +ServerSocketFactory factory = this.getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +ret = ((CoyoteServerSocketFactory)factory).getAlgorithm(); +} +} + +return ret; +} + +public void setAlgorithm(String algorithm) { +setProperty(algorithm, algorithm); +ServerSocketFactory factory = this.getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +((CoyoteServerSocketFactory)factory).setAlgorithm(algorithm); +} +} + public boolean getClientAuth() { boolean ret = false; @@ -1530,6 +1551,32 @@ } } +/** + * Return keystoreType + */ +public String getKeystoreType() { +String ret = (String) getProperty(keytype); +if (ret == null) { +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory ) { +return ((CoyoteServerSocketFactory)factory).getKeystoreType(); +} +} + +return ret; +} + +/** + * Set keystoreType + */ +public void setKeystoreType(String keystoreType) { +setProperty(keytype, keystoreType); +ServerSocketFactory factory = getFactory(); +if( factory instanceof CoyoteServerSocketFactory ) { +((CoyoteServerSocketFactory)factory).setKeystoreType(keystoreType); +} +} + /** * Gets the list of SSL cipher suites that are to be enabled * 1.7 +48 -11 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- mbeans-descriptors.xml19 Aug 2003 16:13:37 - 1.6 +++ mbeans-descriptors.xml25 Aug 2003 22:08:24 - 1.7 @@ -15,6 +15,10 @@ description=The IP address on which to bind type=java.lang.String/ +attribute name=algorithm + description=The certificate encoding algorithm to be used + type=java.lang.String/ + attribute name=bufferSize description=The input buffer size we should create on input streams type=int/ @@ -32,26 +36,30 @@ description=Comma-separated list of SSL cipher suites to be enabled type=java.lang.String/ -attribute name=keyAlias - description=Alias name of this connector's keypair and supporting certificate chain - type=java.lang.String/ - -attribute name=sslProtocol - description=SSL protocol variant to be used +attribute name=compression + description=Compression value type=java.lang.String/ -attribute name=sslProtocols - description=Comma-separated list of SSL protocol variants to be enabled - type=java.lang.String/ +attribute name=connectionLinger + description=Linger value on the incoming connection + type=int/ attribute name=connectionTimeout description=Timeout value on the incoming connection type=int/ +attribute name=connectionUploadTimeout + description=Timeout value on the incoming connection during request processing + type=int/ + attribute name=debug description=The debugging detail level for this component type=int/ +attribute
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/08/20 09:27:35 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Revert Bill's patch. The problem is that some of the fields are accessed in the critical path (scheme, etc) as part of the main request processing code, and using reflection to get them is not acceptable, so the patch will need to be reworked. Revision ChangesPath 1.24 +352 -140 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- CoyoteConnector.java 18 Aug 2003 06:43:29 - 1.23 +++ CoyoteConnector.java 20 Aug 2003 16:27:35 - 1.24 @@ -128,15 +128,48 @@ /** + * The accept count for this Connector. + */ +private int acceptCount = 10; + + +/** + * The IP address on which to bind, if any. If codenull/code, all + * addresses on the server will be bound. + */ +private String address = null; + + +/** + * The input buffer size we should create on input streams. + */ +private int bufferSize = 2048; + + +/** * The Container used for processing requests received by this Connector. */ protected Container container = null; + +/** + * Compression value. + */ +private String compression = off; + + /** * The debugging detail level for this component. */ private int debug = 0; + +/** + * The enable DNS lookups flag for this Connector. + */ +private boolean enableLookups = false; + + /** * The server socket factory for this component. */ @@ -163,11 +196,114 @@ /** + * The minimum number of processors to start at initialization time. + */ +protected int minProcessors = 5; + + +/** + * The maximum number of processors allowed, or 0 for unlimited. + */ +private int maxProcessors = 20; + + +/** + * Linger value on the incoming connection. + * Note : a value inferior to 0 means no linger. + */ +private int connectionLinger = Constants.DEFAULT_CONNECTION_LINGER; + + +/** + * Timeout value on the incoming connection. + * Note : a value of 0 means no timeout. + */ +private int connectionTimeout = Constants.DEFAULT_CONNECTION_TIMEOUT; + + +/** + * Timeout value on the incoming connection during request processing. + * Note : a value of 0 means no timeout. + */ +private int connectionUploadTimeout = +Constants.DEFAULT_CONNECTION_UPLOAD_TIMEOUT; + + +/** + * Timeout value on the server socket. + * Note : a value of 0 means no timeout. + */ +private int serverSocketTimeout = Constants.DEFAULT_SERVER_SOCKET_TIMEOUT; + + +/** + * The port number on which we listen for requests. + */ +private int port = 8080; + + +/** + * The server name to which we should pretend requests to this Connector + * were directed. This is useful when operating Tomcat behind a proxy + * server, so that redirects get constructed accurately. If not specified, + * the server name included in the codeHost/code header is used. + */ +private String proxyName = null; + + +/** + * The server port to which we should pretent requests to this Connector + * were directed. This is useful when operating Tomcat behind a proxy + * server, so that redirects get constructed accurately. If not specified, + * the port number specified by the codeport/code property is used. + */ +private int proxyPort = 0; + + +/** + * The redirect port for non-SSL to SSL redirects. + */ +private int redirectPort = 443; + + +/** + * The request scheme that will be set on all requests received + * through this connector. + */ +private String scheme = http; + + +/** + * The secure connection flag that will be set on all requests received + * through this connector. + */ +private boolean secure = false; + +/** For jk, do tomcat authentication if true, trust server if false + */ +private boolean tomcatAuthentication = true; + +/** * The string manager for this package. */ private StringManager sm = StringManager.getManager(Constants.Package); + +/** + * Flag to disable setting a seperate time-out for uploads. +
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
billbarker2003/08/17 23:43:29 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Fixing getters for JMX. It looks like a big commit, but it really shouldn't be very much in terms of functionality. All default values are (almost) removed from the Connector. This may break other components that were depending on them. However that is why I'm committing now (so I can get more eyes to find the broken components). I've kludged getScheme for now, so that Tomcat is more or less functional. However, it looks like there is still a fair amount of cleanup to do in getting the default values set for the protocols. Revision ChangesPath 1.23 +141 -353 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- CoyoteConnector.java 11 Aug 2003 21:44:16 - 1.22 +++ CoyoteConnector.java 18 Aug 2003 06:43:29 - 1.23 @@ -128,48 +128,15 @@ /** - * The accept count for this Connector. - */ -private int acceptCount = 10; - - -/** - * The IP address on which to bind, if any. If codenull/code, all - * addresses on the server will be bound. - */ -private String address = null; - - -/** - * The input buffer size we should create on input streams. - */ -private int bufferSize = 2048; - - -/** * The Container used for processing requests received by this Connector. */ protected Container container = null; - -/** - * Compression value. - */ -private String compression = off; - - /** * The debugging detail level for this component. */ private int debug = 0; - -/** - * The enable DNS lookups flag for this Connector. - */ -private boolean enableLookups = false; - - /** * The server socket factory for this component. */ @@ -196,114 +163,11 @@ /** - * The minimum number of processors to start at initialization time. - */ -protected int minProcessors = 5; - - -/** - * The maximum number of processors allowed, or 0 for unlimited. - */ -private int maxProcessors = 20; - - -/** - * Linger value on the incoming connection. - * Note : a value inferior to 0 means no linger. - */ -private int connectionLinger = Constants.DEFAULT_CONNECTION_LINGER; - - -/** - * Timeout value on the incoming connection. - * Note : a value of 0 means no timeout. - */ -private int connectionTimeout = Constants.DEFAULT_CONNECTION_TIMEOUT; - - -/** - * Timeout value on the incoming connection during request processing. - * Note : a value of 0 means no timeout. - */ -private int connectionUploadTimeout = -Constants.DEFAULT_CONNECTION_UPLOAD_TIMEOUT; - - -/** - * Timeout value on the server socket. - * Note : a value of 0 means no timeout. - */ -private int serverSocketTimeout = Constants.DEFAULT_SERVER_SOCKET_TIMEOUT; - - -/** - * The port number on which we listen for requests. - */ -private int port = 8080; - - -/** - * The server name to which we should pretend requests to this Connector - * were directed. This is useful when operating Tomcat behind a proxy - * server, so that redirects get constructed accurately. If not specified, - * the server name included in the codeHost/code header is used. - */ -private String proxyName = null; - - -/** - * The server port to which we should pretent requests to this Connector - * were directed. This is useful when operating Tomcat behind a proxy - * server, so that redirects get constructed accurately. If not specified, - * the port number specified by the codeport/code property is used. - */ -private int proxyPort = 0; - - -/** - * The redirect port for non-SSL to SSL redirects. - */ -private int redirectPort = 443; - - -/** - * The request scheme that will be set on all requests received - * through this connector. - */ -private String scheme = http; - - -/** - * The secure connection flag that will be set on all requests received - * through this connector. - */ -private boolean secure = false; - -/** For jk, do tomcat authentication if true, trust server if false - */ -
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
jfarcand2003/08/06 13:31:24 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: With the removal of org.apache.catalina.connector.*, we need a way to allow cuto mized version of the connector. So I'm allowing the extension of this class. Also, the security manager will take care of the required security if a web app try to extends/modify that class. Revision ChangesPath 1.20 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- CoyoteConnector.java 3 Aug 2003 03:19:08 - 1.19 +++ CoyoteConnector.java 6 Aug 2003 20:31:24 - 1.20 @@ -107,7 +107,7 @@ */ -public final class CoyoteConnector +public class CoyoteConnector implements Connector, Lifecycle, MBeanRegistration { private static Log log = LogFactory.getLog(CoyoteConnector.class); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml
luehe 2003/08/11 11:06:11 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml Log: Added support for specifying alias name for server keypair and cert chain, to be used by the server to authenticate itself to SSL clients Revision ChangesPath 1.21 +32 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- CoyoteConnector.java 6 Aug 2003 20:31:24 - 1.20 +++ CoyoteConnector.java 11 Aug 2003 18:06:11 - 1.21 @@ -1307,6 +1307,8 @@ ssf.getSSLImplementation()); IntrospectionUtils.setProperty(protocolHandler, ciphers, ssf.getCiphers()); +IntrospectionUtils.setProperty(protocolHandler, keyAlias, + ssf.getKeyAlias()); } else { IntrospectionUtils.setProperty(protocolHandler, secure, + secure); @@ -1537,6 +1539,35 @@ ServerSocketFactory factory = getFactory(); if (factory instanceof CoyoteServerSocketFactory) { ((CoyoteServerSocketFactory)factory).setCiphers(ciphers); +} +} + +/** + * Gets the alias name of the keypair and supporting certificate chain + * used by this Connector to authenticate itself to SSL clients. + * + * @return The alias name of the keypair and supporting certificate chain + */ +public String getKeyAlias() { +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +return ((CoyoteServerSocketFactory)factory).getKeyAlias(); +} +return null; +} + +/** + * Sets the alias name of the keypair and supporting certificate chain + * used by this Connector to authenticate itself to SSL clients. + * + * @param alias The alias name of the keypair and supporting certificate + * chain + */ +public void setKeyAlias(String alias) { +setProperty(keyAlias, alias); +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +((CoyoteServerSocketFactory)factory).setKeyAlias(alias); } } 1.3 +22 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java Index: CoyoteServerSocketFactory.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CoyoteServerSocketFactory.java11 Jul 2003 01:04:43 - 1.2 +++ CoyoteServerSocketFactory.java11 Aug 2003 18:06:11 - 1.3 @@ -115,6 +115,7 @@ private String protocol = TLS; private String sslImplementation = null; private String cipherSuites; +private String keyAlias; // - Properties @@ -294,6 +295,27 @@ */ public void setSSLImplementation(String sslImplementation) { this.sslImplementation = sslImplementation; +} + +/** + * Gets the alias name of the keypair and supporting certificate chain + * used by the server to authenticate itself to SSL clients. + * + * @return The alias name of the keypair and supporting certificate chain + */ +public String getKeyAlias() { +return this.keyAlias; +} + +/** + * Sets the alias name of the keypair and supporting certificate chain + * used by the server to authenticate itself to SSL clients. + * + * @param alias The alias name of the keypair and supporting certificate + * chain + */ +public void setKeyAlias(String alias) { +this.keyAlias = alias; } /** 1.4 +4 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Sunday, August 03, 2003 1:16 AM Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java [EMAIL PROTECTED] wrote: billbarker2003/08/02 20:19:08 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Temporary fix for running SSL without a SocketFactory. This patch doesn't play well with JMX, but I'm intending to do a general JMX cleanup of the Connector next week, and will remove the method then. This is only so that I can commit server.xml and have it run. I assume you're talking about the bean for the connector itelf, right ? I'm very happy with the registration for all the lower level components (protocol handler, thread pool, processors). Yes, the Connector itself. Basically, so that it reports the values of defaulted attributes correctly. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
billbarker2003/08/02 20:19:08 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: Temporary fix for running SSL without a SocketFactory. This patch doesn't play well with JMX, but I'm intending to do a general JMX cleanup of the Connector next week, and will remove the method then. This is only so that I can commit server.xml and have it run. Revision ChangesPath 1.19 +25 -8 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- CoyoteConnector.java 31 Jul 2003 00:19:42 - 1.18 +++ CoyoteConnector.java 3 Aug 2003 03:19:08 - 1.19 @@ -690,11 +690,6 @@ */ public ServerSocketFactory getFactory() { -if (this.factory == null) { -synchronized (this) { -this.factory = new DefaultServerSocketFactory(); -} -} return (this.factory); } @@ -1314,7 +1309,7 @@ ssf.getCiphers()); } else { IntrospectionUtils.setProperty(protocolHandler, secure, -+ false); ++ secure); } /* Set the configured properties. This only sets the ones that were @@ -1325,7 +1320,8 @@ while( keys.hasNext() ) { String name = (String)keys.next(); String value = properties.get(name).toString(); -IntrospectionUtils.setProperty(protocolHandler, name, value); + String trnName = translateAttributeName(name); +IntrospectionUtils.setProperty(protocolHandler, trnName, value); } @@ -1336,6 +1332,27 @@ (sm.getString (coyoteConnector.protocolHandlerInitializationFailed, e)); } +} + +/** + * Translate the attribute name from the legacy Factory names to their + * internal protocol names. + */ +private String translateAttributeName(String name) { + if(clientAuth.equals(name)) { + return clientauth; + } else if(keystoreFile.equals(name)) { + return keystore; + } else if(randomFile.equals(name)) { + return randomfile; + } else if(rootFile.equals(name)) { + return rootfile; + } else if(keystorePass.equals(name)) { + return keypass; + } else if(keystoreType.equals(name)) { + return keytype; + } + return name; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Thursday, July 31, 2003 1:41 AM Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml [EMAIL PROTECTED] wrote: luehe 2003/07/30 17:19:42 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: Added new sslProtocol property + minor javadoc edits The protocol property is a little confusing, as it means different things in different classes: - In CoyoteConnector, it refers to the Coyote protocol name (i.e., HTTP/1.1 or AJP/1.3). - In Http11Processor and CoyoteServerSocketFactory, it refers to the SSL protocol variant. We may want to fix this. Well, protocol for HTTP and AJP is the accurate name. Protocol for the secure layer is also the right name (note that this parameter is remarkably useless, as everything supports TLS now, and the old SSL2 is supposedly insecure). Yeah, well everything that you've said is true. However, in the interest of deprecating the Factory (which is even more useless than the parameter ;-), I'm +1 on Jan's patch. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
Sorry for using gmane, but the original is on my machine at work, and I really didn't have time to follow tomcat-dev today. Reply below. Remy Maucherat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Bill Barker wrote: [EMAIL PROTECTED] wrote: luehe 2003/07/30 17:19:42 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: Added new sslProtocol property + minor javadoc edits The protocol property is a little confusing, as it means different things in different classes: - In CoyoteConnector, it refers to the Coyote protocol name (i.e., HTTP/1.1 or AJP/1.3). - In Http11Processor and CoyoteServerSocketFactory, it refers to the SSL protocol variant. We may want to fix this. Well, protocol for HTTP and AJP is the accurate name. Protocol for the secure layer is also the right name (note that this parameter is remarkably useless, as everything supports TLS now, and the old SSL2 is supposedly insecure). Yeah, well everything that you've said is true. However, in the interest of deprecating the Factory (which is even more useless than the parameter ;-), I'm +1 on Jan's patch. I have nothing against Jan's patch this time. I added passing arbitrary parameters on the connector element, so it should be actually possible to avoid using the fake socket factory. I don't have much time to tweak stuff, but the server.xml should IMO be updated, removing the factory for the SSL example. Can you do it ? Sure, no problem. I probably won't be able to do it until the weekend, but you won't be back before then anyway ;-). (and then the SSL Howto and connector docs will need to be updated) I'm notoriously bad at doc-writing (I've yet to submit a doc patch that hasn't been substantially re-written ;-). However, since TC 5 is still in alpha, I'll post changes to the docs as well. There is still time for someone with writing skills to improve on it ;-). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml
luehe 2003/07/30 17:19:42 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java mbeans-descriptors.xml Log: Added new sslProtocol property + minor javadoc edits The protocol property is a little confusing, as it means different things in different classes: - In CoyoteConnector, it refers to the Coyote protocol name (i.e., HTTP/1.1 or AJP/1.3). - In Http11Processor and CoyoteServerSocketFactory, it refers to the SSL protocol variant. We may want to fix this. Revision ChangesPath 1.18 +32 -6 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- CoyoteConnector.java 29 Jul 2003 16:29:57 - 1.17 +++ CoyoteConnector.java 31 Jul 2003 00:19:42 - 1.18 @@ -819,10 +819,9 @@ /** - * Set the Coyote protocol which will be used - * by the connector. + * Set the Coyote protocol which will be used by the connector. * - * @param protocolHandlerClassName The new class name + * @param protocol The Coyote protocol name */ public void setProtocol(String protocol) { @@ -1317,9 +1316,11 @@ IntrospectionUtils.setProperty(protocolHandler, secure, + false); } + /* Set the configured properties. This only sets the ones that were - explicitly configured. Default values are the responsibility of - the protocolHandler. */ + * explicitly configured. Default values are the responsibility of + * the protocolHandler. + */ Iterator keys = properties.keySet().iterator(); while( keys.hasNext() ) { String name = (String)keys.next(); @@ -1519,6 +1520,31 @@ ServerSocketFactory factory = getFactory(); if (factory instanceof CoyoteServerSocketFactory) { ((CoyoteServerSocketFactory)factory).setCiphers(ciphers); +} +} + +/** + * Gets the SSL protocol variant to be used. + * + * @return SSL protocol variant + */ +public String getSslProtocol() { +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +return ((CoyoteServerSocketFactory)factory).getProtocol(); +} +return null; +} + +/** + * Sets the SSL protocol variant to be used. + * + * @param sslProtocol SSL protocol variant + */ +public void setSslProtocol(String sslProtocol) { +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +((CoyoteServerSocketFactory)factory).setProtocol(sslProtocol); } } 1.3 +4 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml Index: mbeans-descriptors.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mbeans-descriptors.xml11 Jul 2003 01:04:43 - 1.2 +++ mbeans-descriptors.xml31 Jul 2003 00:19:42 - 1.3 @@ -32,6 +32,10 @@ description=Comma-separated list of SSL cipher suites to be enabled type=java.lang.String/ +attribute name=sslProtocol + description=SSL protocol variant to be used + type=java.lang.String/ + attribute name=connectionTimeout description=Timeout value on the incoming connection type=int/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/07/29 09:29:57 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Remove some apparently unneeded fields. Revision ChangesPath 1.17 +1 -23 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- CoyoteConnector.java 28 Jul 2003 11:19:11 - 1.16 +++ CoyoteConnector.java 29 Jul 2003 16:29:57 - 1.17 @@ -159,18 +159,6 @@ /** - * The set of processors that have ever been created. - */ -private Vector created = new Vector(); - - -/** - * The current number of processors that have been created. - */ -private int curProcessors = 0; - - -/** * The debugging detail level for this component. */ private int debug = 0; @@ -648,16 +636,6 @@ public void setContainer(Container container) { this.container = container; - -} - - -/** - * Return the current number of processors that have been created. - */ -public int getCurProcessors() { - -return (curProcessors); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/07/28 04:19:11 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - Add a new protocol attribute, which can be used rather than using the protocol handler classname (I am trying to beautify a bit the default configuration). Revision ChangesPath 1.16 +40 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- CoyoteConnector.java 27 Jul 2003 17:50:35 - 1.15 +++ CoyoteConnector.java 28 Jul 2003 11:19:11 - 1.16 @@ -824,6 +824,44 @@ /** + * Return the Coyote protocol handler in use. + */ +public String getProtocol() { + +if (org.apache.coyote.http11.Http11Protocol.equals +(getProtocolHandlerClassName())) { +return HTTP/1.1; +} else if (org.apache.jk.server.JkCoyoteHandler.equals + (getProtocolHandlerClassName())) { +return AJP/1.3; +} +return null; + +} + + +/** + * Set the Coyote protocol which will be used + * by the connector. + * + * @param protocolHandlerClassName The new class name + */ +public void setProtocol(String protocol) { + +if (protocol.equals(HTTP/1.1)) { +setProtocolHandlerClassName +(org.apache.coyote.http11.Http11Protocol); +} else if (protocol.equals(AJP/1.3)) { +setProtocolHandlerClassName +(org.apache.jk.server.JkCoyoteHandler); +} else { +setProtocolHandlerClassName(null); +} + +} + + +/** * Return the class name of the Coyote protocol handler in use. */ public String getProtocolHandlerClassName() { @@ -1257,7 +1295,6 @@ Class clazz = Class.forName(protocolHandlerClassName); protocolHandler = (ProtocolHandler) clazz.newInstance(); } catch (Exception e) { -e.printStackTrace(); throw new LifecycleException (sm.getString (coyoteConnector.protocolHandlerInstantiationFailed, e)); @@ -1308,7 +1345,7 @@ Iterator keys = properties.keySet().iterator(); while( keys.hasNext() ) { String name = (String)keys.next(); -String value = properties.get(name).toString(); +String value = properties.get(name).toString(); IntrospectionUtils.setProperty(protocolHandler, name, value); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
remm2003/07/27 10:50:35 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: - The maxThreads attribute is used by the thread pool (not maxProcessors). Revision ChangesPath 1.15 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- CoyoteConnector.java 23 Jul 2003 04:32:33 - 1.14 +++ CoyoteConnector.java 27 Jul 2003 17:50:35 - 1.15 @@ -795,7 +795,7 @@ public void setMaxProcessors(int maxProcessors) { this.maxProcessors = maxProcessors; -setProperty(maxProcessors, String.valueOf(maxProcessors)); +setProperty(maxThreads, String.valueOf(maxProcessors)); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java
billbarker2003/07/22 21:32:33 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java Log: The current draft of the 2.4 Servlet-Spec (pfd3 Section 9.10) mandates that processWelcomeResources=true and redirectDirectories=true. Simplifying the mappings, by removing the options. It is easy enough to add them back in if the spec people change their minds about this, but for the moment we have to follow the spec. Revision ChangesPath 1.14 +1 -31 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- CoyoteConnector.java 22 Jul 2003 21:02:07 - 1.13 +++ CoyoteConnector.java 23 Jul 2003 04:32:33 - 1.14 @@ -983,36 +983,6 @@ setProperty(maxKeepAliveRequests, String.valueOf(mkar)); } - /** - * Set the flag to see if we do internal redirects to welcome-files. - */ - public void setProcessWelcomeResources(boolean pwr) { - mapper.setProcessWelcomeResources(pwr); - } - - /** - * Return the flag to see if we do internal redirects to welcome-files. - */ - public boolean getProcessWelcomeResources() { - return mapper.getProcessWelcomeResources(); - } - -/** - * Set the flag to see if we do a redirect to directories that don't end - * in a '/'. - */ -public void setRedirectDirectories(boolean rd) { -mapper.setRedirectDirectories(rd); -} - -/** - * Return the flag to see if we do a redirect to directories that don't - * end in a '/'. - */ -public boolean getRedirectDirectories() { -return mapper.getRedirectDirectories(); -} - /** * Return the scheme that will be assigned to requests received * through this connector. Default value is http. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java
luehe 2003/07/10 08:51:40 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteRequest.java Log: Consider CoyoteConnector's bufferSize property when creating CoyoteRequest objects Revision ChangesPath 1.10 +3 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CoyoteConnector.java 22 May 2003 03:43:37 - 1.9 +++ CoyoteConnector.java 10 Jul 2003 15:51:39 - 1.10 @@ -143,7 +143,7 @@ /** * The input buffer size we should create on input streams. */ -private int bufferSize = 2048; +private int bufferSize = InputBuffer.DEFAULT_BUFFER_SIZE; /** @@ -1122,7 +1122,7 @@ */ public Request createRequest() { -CoyoteRequest request = new CoyoteRequest(); +CoyoteRequest request = new CoyoteRequest(getBufferSize()); request.setConnector(this); return (request); 1.10 +13 -5 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java Index: CoyoteRequest.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CoyoteRequest.java6 Jun 2003 19:04:50 - 1.9 +++ CoyoteRequest.java10 Jul 2003 15:51:39 - 1.10 @@ -252,7 +252,7 @@ /** * The associated input buffer. */ -protected InputBuffer inputBuffer = new InputBuffer(); +protected InputBuffer inputBuffer; /** @@ -394,6 +394,14 @@ // - Public Methods +/** + * Constructor + * + * @param inBufSize The input buffer size + */ +public CoyoteRequest(int inBufSize) { + inputBuffer = new InputBuffer(inBufSize); +} /** * Release all object references, and initialize instance variables, in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml
luehe 2003/07/10 18:04:43 Modified:catalina/src/share/org/apache/coyote/tomcat5 CoyoteConnector.java CoyoteServerSocketFactory.java mbeans-descriptors.xml Log: Added support for enabling subset of supported SSL cipher suites (based on earlier proposal) Revision ChangesPath 1.12 +34 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- CoyoteConnector.java 10 Jul 2003 23:30:49 - 1.11 +++ CoyoteConnector.java 11 Jul 2003 01:04:43 - 1.12 @@ -1294,6 +1294,8 @@ IntrospectionUtils.setProperty(protocolHandler, sSLImplementation, ssf.getSSLImplementation()); +IntrospectionUtils.setProperty(protocolHandler, ciphers, + ssf.getCiphers()); } else { IntrospectionUtils.setProperty(protocolHandler, secure, + false); @@ -1461,7 +1463,6 @@ return null; } - /** * Set keystorePass */ @@ -1472,6 +1473,38 @@ ((CoyoteServerSocketFactory)factory).setKeystorePass(keystorePass); } } + +/** + * Gets the list of SSL cipher suites that are to be enabled + * + * @return Comma-separated list of SSL cipher suites, or null if all + * cipher suites supported by the underlying SSL implementation are being + * enabled + */ +public String getCiphers() { +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +return ((CoyoteServerSocketFactory)factory).getCiphers(); +} +return null; +} + +/** + * Sets the SSL cipher suites that are to be enabled. + * + * Only those SSL cipher suites that are actually supported by + * the underlying SSL implementation will be enabled. + * + * @param ciphers Comma-separated list of SSL cipher suites + */ +public void setCiphers(String ciphers) { +setProperty(ciphers, ciphers); +ServerSocketFactory factory = getFactory(); +if (factory instanceof CoyoteServerSocketFactory) { +((CoyoteServerSocketFactory)factory).setCiphers(ciphers); +} +} + // JMX registration protected String domain; 1.2 +108 -36 jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java Index: CoyoteServerSocketFactory.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteServerSocketFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CoyoteServerSocketFactory.java19 Apr 2003 18:49:10 - 1.1 +++ CoyoteServerSocketFactory.java11 Jul 2003 01:04:43 - 1.2 @@ -102,48 +102,73 @@ public class CoyoteServerSocketFactory implements org.apache.catalina.net.ServerSocketFactory { +private String algorithm = null; +private boolean clientAuth = false; +private String keystoreFile = +System.getProperty(user.home) + File.separator + .keystore; +private String randomFile = +System.getProperty(user.home) + File.separator + random.pem; +private String rootFile = +System.getProperty(user.home) + File.separator + root.pem; +private String keystorePass = changeit; +private String keystoreType = JKS; +private String protocol = TLS; +private String sslImplementation = null; +private String cipherSuites; // - Properties - /** - * Certificate encoding algorithm to be used. + * Gets the certificate encoding algorithm to be used. + * + * @return Certificate encoding algorithm */ -private String algorithm = null; - public String getAlgorithm() { return (this.algorithm); } +/** + * Sets the certificate encoding algorithm to be used. + * + * @param algorithm Certificate encoding algorithm + */ public void setAlgorithm(String algorithm) { this.algorithm = algorithm; } - /** - * Should we require client