Re: mod_webapp and apache 2.0
On Wed, Dec 05, 2001 at 07:29:58PM -0800, Charles Yates wrote: On Wed, Dec 05, 2001 at 09:34:55AM -0800, Charles Yates wrote: After getting errors from apachectl configtest relating to invalid port I added a Port directive to httpd.conf and got an error that Port directive had been replaced by Listen. I then removed my Port directive, hacked on webapp.c and wa_config.c to hard code server Port references and . . . . Yay, it works! I think the webapp code in the j-t-c CVS repository is updated. If not, then please post what you did and we can try and sort out the right fix. -- justin Hmm. Greg just brought this issue on dev@httpd, so this seems to be something that we are mangling pretty bad. When we get a resolution, I'll try to make sure that any patches are sent to j-t-c (you may need not any if we fix it in httpd). Until then, sit tight and run with that patch. =) -- justin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
ErrorReportValve
Hi! I've being looking at the code for TC 4.0.1 and I think it's impossible to disable the ErrorReportValve. I'm not really into Tomcat internals, but could it be possible to add an option to the server configuration file to disable this valve? I'd like just to send the HTTP status code to the client, and that's it. Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ErrorReportValve
Em Quinta, 6 de Dezembro de 2001 10:54, Pedro Morais escreveu: Hi! I've being looking at the code for TC 4.0.1 and I think it's impossible to disable the ErrorReportValve. Ok, replying to my own email. I've found out that I can set the errorReportValve value on an Host element; there problem is, I havent been able to find a valid way to set it to null. Do you think this patch is valid? It ignore the class name if it's the empty string. Thansk. --- catalina/src/share/org/apache/catalina/core/StandardHost.java 2001/10/25 00:23:02 1.22 +++ catalina/src/share/org/apache/catalina/core/StandardHost.java 2001/12/06 10:41:24 @@ -627,7 +627,8 @@ public synchronized void start() throws LifecycleException { // Set error report valve -if (errorReportValveClass != null) { +if (errorReportValveClass != null + !.equals(errorReportValveClass)) { try { Valve valve = (Valve) Class.forName(errorReportValveClass) .newInstance(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 4542] - jsp:include inside a custom tag can throw an exception.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542 jsp:include inside a custom tag can throw an exception. [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 03:21 --- I have tested this and the test case I supplied does work as I expected it too. Unfortunately I think that my expectations were wrong. If an error occurs in the included page my test case expected the error page in the included page to be used but I think that the test page in the included page should be ignored and the exception should be passed up to the top level page which should handle it. The Servlet 2.3 specification states in SRV.9.9.2 error pages The error page mechanism described does not intervene when errors occur in servlets invoked using the RequestDispatcher. In this way, a servlet using the RequestDispatcher to call another servlet has the opportunity to handle errors generated in the servlet it calls. The JSP specification does not cover this situation though so it is probably open to interpretation although the reasoning behind the statement in the servlet specification. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 4542] - jsp:include inside a custom tag can throw an exception.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542 jsp:include inside a custom tag can throw an exception. --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 03:40 --- continued from above... seems quite reasonable. The including page knows that it is including another page and so can make sure that the error page can cope with an error from the included page but the included page does not know whether or not it is included inside another page or not so its error page might not provide enough information. I am not sure if this is related or is a new bug but the default error page processing does not seem to be working. A JSP page which throws an exception but does not have an error page specified results in a Document contained no data. message from Netscape. If this is a new bug and not related to this one then could you let me know whether there is a bug open on this already and if so what its number is and if not I will open a new one. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5148] - mod_webapp chokes on binary data (file upload)
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5148. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5148 mod_webapp chokes on binary data (file upload) [EMAIL PROTECTED] changed: What|Removed |Added Priority|Other |High -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ErrorReportValve
Em Quinta, 6 de Dezembro de 2001 10:54, Pedro Morais escreveu: Hi! I've being looking at the code for TC 4.0.1 and I think it's impossible to disable the ErrorReportValve. Ok, replying to my own email. I've found out that I can set the errorReportValve value on an Host element; there problem is, I havent been able to find a valid way to set it to null. Do you think this patch is valid? It ignore the class name if it's the empty string. If you give it a non-existing class, that would also get the job done (although it will print out a nasty stack trace; I'll remove that too). Remy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ErrorReportValve
Em Quinta, 6 de Dezembro de 2001 16:07, escreveste: Em Quinta, 6 de Dezembro de 2001 10:54, Pedro Morais escreveu: Hi! I've being looking at the code for TC 4.0.1 and I think it's impossible to disable the ErrorReportValve. Ok, replying to my own email. I've found out that I can set the errorReportValve value on an Host element; there problem is, I havent been able to find a valid way to set it to null. Do you think this patch is valid? It ignore the class name if it's the empty string. If you give it a non-existing class, that would also get the job done (although it will print out a nasty stack trace; I'll remove that too). Yes, I know, that my current development workaround, but I guess it would scare the hell out of the production support team :-) Remy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5308] New: - jsp:include ignores flush attribute
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5308. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5308 jsp:include ignores flush attribute Summary: jsp:include ignores flush attribute Product: Tomcat 4 Version: 4.0 Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Jasper AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] JSP 1.2 specification section 4.4 describes a flush attribute on the jsp:include standard action. The Jasper implementation appears to ignore this attribute - changing it has no impact on the generated code. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5285] - JSP File Not Found
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5285. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5285 JSP File Not Found --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 10:29 --- Here is the additional information: The context entry in server.xml is as follows: Context path=/yourelate docBase=d:/projects/yc45/website reloadable=true /Context The jsp files are located in this folder d:/projects/yc45/website/webtop/jsp There is a jsp called ep_list.jsp which includes a jsp called list_header.jsp. %@ include file=list_header.jsp % The list_header jsp includes page_number_header.jsp %@ include file=page_number_header.jsp % I am getting similar exception (but with another jsp) in a different area of the application. I can provide additional information if needed. Monica -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5308] - jsp:include ignores flush attribute
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5308. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5308 jsp:include ignores flush attribute --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 10:49 --- I think that this bug is in need of a compelling use case - here's what brought this to my attention. I want to use jsp:include inside of a custom action which is derived from BodyTagSupport. The current implementation of generateInclude will flush the output stream (which is actually a BodyContent object) which will result in an exception since BodyContent doesn't support flush. I thought I could avoid this problem by using jsp:includ flush=false, but as explained before, that doesn't work. Actually according to section 4.4. of the jsp specification the default should be to NOT flush the output stream before an include and it appears that the current implementation always does the opposite. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 4542] - jsp:include inside a custom tag can throw an exception.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4542 jsp:include inside a custom tag can throw an exception. --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 10:53 --- Let me use a specific example to make sure I understand what you are talking about. A.jsp includes B.jsp, and the errorPage for A.jsp is A.err.jsp, and that for B.jsp is B.err.jsp. An exception is thrown in B.jsp, and you expect the exception to be handled by A.err.jsp (not B.err.jsp). I do not agree. It is certainly not the way Java exceptions work, where exceptions handlers are searched in the called method first, and then in calling methods; but once a handler is found in the called method, the exception is considered handled, and the handlers in the calling mehtod are not considered. The current Jasper is structured in such a way, and I suspect it would be hard to do it the other way. I have seen the Document contains no data in other context before, but thought was fixed. Go ahead and file a bug if it happens again. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 4138] - HttpProcessor threads have inconsistent ClassLoader state
Dear TOMCAT developers, :-) I forward the following email to you :-) Bo Dec.06, 2001 * If you really want the developers to take a look at this, you should probably post it to the tomcat-dev list. It's iffy whether or not they will see it here. Thanks, --jeff - Original Message - From: java programmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 10:44 PM Subject: Double check idiom broken - Tomcat uses it ? Hi all: We all know that the lazy-double-check idiom doesn't apply to Java because of the Java Memory Model (JMM). That is to say, look at code such as: Example a) // Set by any other thread other than #1 volatile boolean stop = false; // Thread #1 runs this as long as // stop is false. Only T1 will call this // method, so not synchronized. hence // broken due to staleness of 'stop'. // synch for _visbility_ ALSO. void foo() { while (!stop ) { //... } } Example b): The lazy double check idiom public static Foo haha = null; public static getFoo() { if (foo == null ) { sychronized (Foo.class) { if (foo == null ) foo = new Foo(); } } return foo; } Both examples are *guaranteed* to be incorrect. Note, this is the case, *even* though I am using 'volatile' for the stop variable. For more on the JMM, consult Item #48 in Effective Java (Josh Bloch), look at Bill Pughs' page at: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html or check out Doug Lea's stuff. Well, here is the thing: Quite idly, and randomly, I was looking at: org.apache.jasper.servlet.JspServlet and I found: snip outDated = compiler.isOutDated(); if(!jsw.isInstantiated() || outDated ) { synchronized(jsw){ outDated = compiler.compile(); if(!jsw.isInstantiated() || outDated) { if( null ==ctxt.getServletClassName() ) { snip This is a complex use of double check type code and is really hard to analyse because references themselves and what they point to can have different levels of staleness (according to the JMM). So it's a turbo double idiom type usage, possibly incorrect. I just wanted to bring this to the attention of the development team and make sure that *someone* has really analysed this according to the JMM. (and any other code, similar to this). Best regards, [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: getPathInfo problem
Craig, I see the whole picture now. As regards to the question I did look into the Specs and for JSPs this must return null and for URL mapped Servlet it must return the path that the servlet is called with. Thanks all for your help finding this out. Anand -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 10:18 PM To: Anand Bashyam Narasimham Subject: RE: getPathInfo problem You still haven't said what you think the *right* answer is, or what *wrong* answer you think this page returns. PLEASE be complete. When I try this on your server, it returns the source code of the JSP page itself (which means your server is not set up to handle JSP pages correctly). On my server running Tomcat 4.0.1, this returns null for both getPathInfo() and getPathTranslated(). Note that this is the correct answer! Because JSP pages are mapped using a *.jsp mapping, there will never be a non-null value for getPathInfo(), since the extension match has to happen on the last element of the request URI only. If you want the context relative path of the page itself (if your context path is /thriftytest, this would be /anand/pathtest/test.jsp), you should call request.getServletPath() instead. If you want the physical disk pathname of this file (assuming you are running out of a directory, not a WAR file), you should call: String path = getServletContext().getRealPath(request.getServletPath()); Craig On Wed, 5 Dec 2001, Anand Bashyam Narasimham wrote: Date: Wed, 5 Dec 2001 14:13:39 -0800 From: Anand Bashyam Narasimham [EMAIL PROTECTED] To: 'Craig R. McClanahan' [EMAIL PROTECTED] Subject: RE: getPathInfo problem Ok, Here's a URL that you can try:- http://www.learningcircle.net/thriftytest/anand/pathtest/test.jsp The code in this JSP is as follows:- ---Code Starts here--- html bThe Path Info is %=request.getPathInfo()%::Path Translated =%=request.getPathTranslated()%/bbr Request URI is --%=request.getRequestURI()% /html ---Code Ends here- I did see another reply that says that these calls will not return correct values from a JSP. Is this true if yes then would the same calls work from a Servlet. Thanks Anand -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 12:01 PM To: Tomcat Developers List Cc: Anand Bashyam Narasimham Subject: Re: getPathInfo problem On Wed, 5 Dec 2001, Anand Bashyam Narasimham wrote: Date: Wed, 5 Dec 2001 11:32:08 -0800 From: Anand Bashyam Narasimham [EMAIL PROTECTED] Reply-To: Tomcat Developers List [EMAIL PROTECTED] To: Tomcat Dev Mailing List (E-mail) [EMAIL PROTECTED] Subject: getPathInfo problem Hi, I know there's been a lot of discussion around this and the bug filed says it's a WORKSFORME but somehow if I just install TOmcat3.3 and run the Snoop JSP in the example I get a null on getPathInfo as well as getPathTranslated(). Is there something that needs to be set on the servlet mapping etc. If some on can give a concrete answer as to why this is so much a problem it would be of great help. I tried a JSP with calls to getPathInfo() and getPathTranslated() on WebLogic 5.1 and the getPathTranslated works fine but returns null in Tomcat. Anand As I asked for (twice!) in the bug report dialog, can you please provide a test case that shows exactly what you think is wrong? The original statement in the bug report was not correct, and you have not provided the detail of exactly what behavior you are seeing, and what you are expecting. Without that, there's nothing anyone here can do. Craig McClanahan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Classloader
Hi folks, I am writing an application, in which I need to support Hot deployment. I looked into org.apache.tomcat.util.DependClassLoader and org.apache.tomcat.util.DependClassLoader12 for this purpose. Can anybody tell me how to use them with my application? and which jars should I use from tomcat, for this purpose? Regards, Ali.
cvs commit: jakarta-tomcat-4.0/webapps/admin admin.css
patrickl01/12/06 13:46:09 Modified:webapps/admin admin.css Log: Added font-family for buttons Revision ChangesPath 1.2 +1 -0 jakarta-tomcat-4.0/webapps/admin/admin.css Index: admin.css === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/admin.css,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- admin.css 2001/12/06 05:52:21 1.1 +++ admin.css 2001/12/06 21:46:09 1.2 @@ -74,6 +74,7 @@ .button { background-color: #FF; + font-family: Verdana, Arial, Helvetica, Sans-Serif; } a.button-link-text:visited, a.button-link-text:link, a.button-link-text:active { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JK2: Configuration(1)
Please reply - this is an important change ! I would like to add another configuration mechanism for jk2. If people agree, this should be the default. Assumptions: - All webapplication that will be served must be deployed on the machine running the web server ( otherwise the server can't find the static files ) - It is possible you run a load-balanced server and you may ( or not ) have tomcats on the server machine. - Minimal user configuration for 'simple' case. Advanced users will still have full power to override. Details: Via workers.properties ( or httpd.conf ) we'llspecify the path to webapps/ directory ( one or many ) and the 'style' ( flat or vhost ). mod_jk will use the same logic as tomcat to find all subdirs, and automatically add the contexts. ( using 'global' mappings ) In addition, for each webapplication jk will check [appbase]/WEB-INF/jkmappings.properties If the file exists, it'll contain per/webapp mappings ( without the context prefix ) == an easy to parse form of what's in web.xml. In addition, [appbase]/WEB-INF/jk.workers will include the list with all tomcat instances where the webapp is running. If none is found, the default worker will be used. Note: 1. if WEB-INF/jk.workers contains a single worker, we'll have the current effect of JkMount 2. If it has multiple workers, it'll be load balanced, as if a lb worker would have been defined and the app would be mapped to that worker. Benefits: - Simple things are simple. After the initial configuration of apache ( consisting of a LoadModule and pointing to the path to tomcat -- which can be fixed for RPMs or installed case ), the user will not have to do anything else but soft-restart the web server. - Keep application config separated. - The use can still override whatever he wants ( using explicit configs ) or place apps in different directories. - no need to have tomcat running ( or running on the server machine ) ( this will be used in addition to ajp14 autoconf ) Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[PATCH] jakarta-tomcat-4.0/webapps/admin/
Enhanced the admin tool by adding a new server screen and its related backend functionality. Please add these files to the HEAD branch. ( *.java under jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ server.jsp under jakarta-tomcat-4.0/webapps/admin/ PaperTexture.gif under jakarta-tomcat-4.0/webapps/admin/images/) Thanks! /* * $Header: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v 1.1 2001/11/06 20:40:13 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2001/11/06 20:40:13 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.webapp.admin; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.QueryExp; import javax.management.Query; import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.JMException; import javax.management.MBeanAttributeInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanInfo; import javax.management.modelmbean.ModelMBean; import javax.management.modelmbean.ModelMBeanInfo; /** * Test codeAction/code that handles events from the tree control test * page. * * @author Jazmin Jonson * @version $Revision: 1.1 $ $Date: 2001/11/06 20:40:13 $ */ public class SetUpServerAction extends Action { private static MBeanServer mBServer = null; public final static String PORT_PROP_NAME = port; public final static String SHUTDOWN_PROP_NAME = shutdown; public final static String DEBUG_PROP_NAME = debug; private ArrayList debugLvlList = null; private ArrayList actionList = null; // - Public Methods /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another
[PATCH] jakarta-tomcat-4.0/webapps/admin/
Please commit my patch in the HEAD branch. Made changes to struts-config, internationalization ApplicationResources.properties files, and tree builder for the new server screen. Index: ./WEB-INF/struts-config.xml === RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v retrieving revision 1.8 diff -u -r1.8 struts-config.xml --- WEB-INF/struts-config.xml 2001/11/21 01:10:09 1.8 +++ WEB-INF/struts-config.xml 2001/12/06 21:10:42 @@ -19,6 +19,10 @@ form-bean name=sampleForm type=org.apache.webapp.admin.SampleForm/ +!-- Server form bean -- +form-bean name=serverForm +type=org.apache.webapp.admin.ServerForm/ + !-- Set Locale form bean -- form-bean name=setLocaleForm type=org.apache.webapp.admin.SetLocaleForm/ @@ -46,6 +50,10 @@ path=/tree-control-test.jsp redirect=false/ +forwardname=Server +path=/server.jsp +redirect=false/ + forwardname=Save Successful path=/saved.jsp redirect=false/ @@ -73,6 +81,16 @@ redirect=true/ /action +!-- Set up Tree datastructure -- +actionpath=/setUpServer + type=org.apache.webapp.admin.SetUpServerAction + name=serverForm + scope=session + forwardname=SetUpServer + path=/server.jsp + redirect=true/ +/action + !-- Log out of the application -- actionpath=/logOut type=org.apache.webapp.admin.LogOutAction @@ -87,6 +105,14 @@ name=sampleForm scope=session input=/sample.jsp +/action + +!-- Process a user server change -- +actionpath=/server + type=org.apache.webapp.admin.ServerAction + name=serverForm + scope=session + input=/server.jsp /action !-- Process a set-locale action -- Index: ./WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties === RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties,v retrieving revision 1.4 diff -u -r1.4 ApplicationResources_en.properties --- WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties 2001/11/18 17:17:08 1.4 +++ WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties +2001/12/06 21:10:42 @@ -8,6 +8,7 @@ button.reset=Reset button.save=Save button.change=Change +button.cancel=Cancel login.enter=Enter a username and password to start a new session login.changeLanguage=Change the language index.success=Login successful! @@ -21,3 +22,7 @@ sample.someText.required=liSome Text cannot be empty/li sample.moreText.required=liMore Text cannot be empty/li save.success=Save sucessful! +server.heading=Tomcat Server +server.portnumber=Port Number +server.debuglevel=Debug Level +server.shutdown=Shutdown Index: ./WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties === RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties,v retrieving revision 1.4 diff -u -r1.4 ApplicationResources_es.properties --- WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties 2001/11/18 17:17:08 1.4 +++ WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties +2001/12/06 21:10:42 @@ -8,6 +8,7 @@ button.reset=Reiniciar button.save=Guardar button.change=Cambiar +button.cancel=Cancelan login.enter=Introduzca un nombre de usuario y una contrase\u00f1a que empezar una sesi\u00f3n nueva login.changeLanguage=Cambie el idioma index.success=\u00a1Autenticaci\u00f3n tiene \u00e9xito! @@ -21,3 +22,7 @@ sample.someText.required=li\u00abAlg\u00fan Texto\u00bb no puede ser vac\u00edo/li sample.moreText.required=li\u00abM\u00e1s Texto\u00bb no puede ser vac\u00edo/li save.success=\u00a1Guardar tiene \u00e9xito! +server.heading=Tomcat Servidor +server.portnumber=Número de acceso +server.debuglevel=Ponga a punto Llano +server.shutdown=Parada normal Index: ./WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java === RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v retrieving revision 1.1 diff -u -r1.1 TomcatTreeBuilder.java --- WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java 2001/11/27 02:46:28 1.1 +++
cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_objCache.h
costin 01/12/06 14:40:41 Added: jk/native2/include jk_objCache.h Log: Code extracted from jk_ajp_worker. Right now lb_worker, jni_worker are not recycling. This is general-purpose code and should be used agressivly, so I moved it at top level. Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/include/jk_objCache.h Index: jk_objCache.h === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Jk, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * * = */
cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_webapp.h
costin 01/12/06 14:43:29 Added: jk/native2/include jk_webapp.h Log: One more thing extracted from Henri's discovery, plus things merged from jk_uriEnv ( merged from various places like apache private structs ). jk_webapp coresponds to Context, it should have all per/context settings. Note that now the granularity for setting the worker is bigger - you can set the jk worker per context only. ( we can't make it per uri, but I'm not sure it makes sense, and it's easier this way ). Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/include/jk_webapp.h Index: jk_webapp.h === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Jk, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information *
cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_channel.h jk_endpoint.h jk_env.h jk_handler.h jk_logger.h jk_map.h jk_pool.h jk_service.h jk_uriEnv.h jk_uriMap.h jk_worker.h jk_workerEnv.h
costin 01/12/06 14:48:50 Modified:jk/native2/include jk_channel.h jk_endpoint.h jk_env.h jk_handler.h jk_logger.h jk_map.h jk_pool.h jk_service.h jk_uriEnv.h jk_uriMap.h jk_worker.h jk_workerEnv.h Log: - Added pools wherever they're needed. Factory now takes a pool - that allows us to get rid of 1/2 of mallocs and be sure the data will be cleaned. - Pass pool to methods that could be called at run time and may need to create temp data ( we don't want to allocate temp data in the object's pool, but in the caller pool or a temp pool - which is short-lived ) - Get rid of all buf[]s. Now all pools are created using the pool hierarchy - i.e. from apr_pools or malloc. Since we recycle, there's no need to play all the stack-allocation tricks. - moved the jk_pool-specific private data to the impl. The common implementation will be used only if APR ( or other server-specific native pools ) are not available. - removed the per/context fileds from the per/uri structure Revision ChangesPath 1.2 +1 -4 jakarta-tomcat-connectors/jk/native2/include/jk_channel.h Index: jk_channel.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_channel.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_channel.h 2001/12/01 22:30:57 1.1 +++ jk_channel.h 2001/12/06 22:48:49 1.2 @@ -105,11 +105,8 @@ */ char **supportedProperties; -struct jk_worker *worker; /* XXX Do we need it ? */ -jk_logger_t *logger; +struct jk_worker *worker; jk_map_t *properties; -jk_pool_t *pool; /* XXX Do we need it ? */ - /** Prepare the channel, check the properties. This * will resolve the host and do all the validations. 1.3 +4 -3 jakarta-tomcat-connectors/jk/native2/include/jk_endpoint.h Index: jk_endpoint.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_endpoint.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_endpoint.h 2001/12/05 20:45:13 1.2 +++ jk_endpoint.h 2001/12/06 22:48:49 1.3 @@ -61,7 +61,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * Author: Dan Milstein [EMAIL PROTECTED] * Author: Henri Gomez [EMAIL PROTECTED] - * Version: $Revision: 1.2 $ + * Version: $Revision: 1.3 $ ***/ #ifndef JK_ENDPOINT_H @@ -127,8 +127,9 @@ struct jk_worker *worker; -jk_pool_t pool; -jk_pool_atom_t buf[BIG_POOL_SIZE]; +/** Each thread has it's own endpoint instance and is recycled. +This pool can be unsynchronized */ +jk_pool_t *pool; int proto; /* PROTOCOL USED AJP13/AJP14 */ 1.2 +5 -3 jakarta-tomcat-connectors/jk/native2/include/jk_env.h Index: jk_env.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_env.h 2001/12/01 22:30:57 1.1 +++ jk_env.h 2001/12/06 22:48:49 1.2 @@ -80,6 +80,7 @@ * @author Costin Manolache * */ +struct jk_pool; struct jk_env; typedef struct jk_env jk_env_t; @@ -101,6 +102,7 @@ * jk_worker_list.h). */ typedef int (JK_METHOD *jk_env_objectFactory_t)(jk_env_t *env, +jk_pool_t *pool, void **result, const char *type, const char *name); @@ -108,7 +110,7 @@ /** Get a pointer to the jk_env. We could support multiple * env 'instances' in future - for now it's a singleton. */ -jk_env_t* JK_METHOD jk_env_getEnv( char *id ); +jk_env_t* JK_METHOD jk_env_getEnv( char *id, struct jk_pool *pool ); /** @@ -120,7 +122,7 @@ */ struct jk_env { jk_logger_t *logger; -/*jk_pool_t global_pool; */ +jk_pool_t *globalPool; /** Global properties ( similar with System properties in java) */ @@ -136,7 +138,7 @@ call it. This is a very frequent operation. */ void * -(JK_METHOD *getInstance)( jk_env_t *env, const char *type, +(JK_METHOD *getInstance)( jk_env_t *env, jk_pool_t *pool,
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c
costin 01/12/06 14:50:25 Modified:jk/native2/server/apache2 jk_logger_apache2.c jk_pool_apr.c mod_jk.c Log: Update for the interface changes. Various fixes Update the code the initialize jk. Revision ChangesPath 1.4 +3 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c Index: jk_logger_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_logger_apache2.c 2001/12/05 20:49:48 1.3 +++ jk_logger_apache2.c 2001/12/06 22:50:25 1.4 @@ -85,7 +85,8 @@ #define HUGE_BUFFER_SIZE (8*1024) -int JK_METHOD jk_logger_apache2_factory(jk_env_t *env, void **result, +int JK_METHOD jk_logger_apache2_factory(jk_env_t *env, jk_pool_t *pool, +void **result, char *type, char *name); @@ -162,6 +163,7 @@ int jk_logger_apache2_factory(jk_env_t *env, + jk_pool_t *pool, void **result, char *type, char *name) 1.3 +37 -28 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c Index: jk_pool_apr.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_pool_apr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_pool_apr.c 2001/12/05 20:49:48 1.2 +++ jk_pool_apr.c 2001/12/06 22:50:25 1.3 @@ -66,26 +66,27 @@ #include apr_pools.h #include apr_strings.h -int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent ); +int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent, apr_pool_t *aprPool ); -int JK_METHOD jk_pool_apr_factory(jk_env_t *env, void **result, +int JK_METHOD jk_pool_apr_factory(jk_env_t *env, + jk_pool_t *pool, + void **result, char *type, char *name); -void jk_pool_apr_open(jk_pool_t *_this, apr_pool_t *realPool ); - - -/** Nothing - apache will take care +/** Nothing - apache will take care ?? */ -static void jk_close_pool(jk_pool_t *p) +static void jk_pool_apr_close(jk_pool_t *p) { + } /** Nothing - apache will take care. XXX with jk pools we can implement 'recycling', not sure what's the equivalent for apache */ -static void jk_reset_pool(jk_pool_t *p) +static void jk_pool_apr_reset(jk_pool_t *p) { +apr_pool_clear(p-_private); } static void *jk_pool_apr_calloc(jk_pool_t *p, @@ -96,7 +97,7 @@ } static void *jk_pool_apr_alloc(jk_pool_t *p, - size_t size) + size_t size) { return apr_palloc( (apr_pool_t *)p-_private, (apr_size_t)size); } @@ -128,41 +129,49 @@ -/* Not implemented yet */ -int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent ) { +static jk_pool_t *jk_pool_apr_createChild( jk_pool_t *_this, int sizeHint ) { +apr_pool_t *parentAprPool=_this-_private; +apr_pool_t *childAprPool; +jk_pool_t *newPool; -return JK_TRUE; +apr_pool_create( childAprPool, parentAprPool ); + +jk_pool_apr_create( newPool, _this, childAprPool ); + +return newPool; } + + +int jk_pool_apr_create( jk_pool_t **newPool, jk_pool_t *parent, apr_pool_t *aprPool) +{ +jk_pool_t *_this=(jk_pool_t *)apr_palloc(aprPool, sizeof( jk_pool_t )); + +_this-_private=aprPool; + +*newPool = _this; -static void init_methods(jk_pool_t *_this ) { -_this-open=jk_open_pool; -_this-close=jk_close_pool; -_this-reset=jk_reset_pool; +/* methods */ +_this-create=jk_pool_apr_createChild; +_this-close=jk_pool_apr_close; +_this-reset=jk_pool_apr_reset; _this-alloc=jk_pool_apr_alloc; _this-calloc=jk_pool_apr_calloc; _this-pstrdup=jk_pool_apr_strdup; _this-realloc=jk_pool_apr_realloc; + +return JK_TRUE; } /* Not used yet */ -int JK_METHOD jk_pool_apr_factory(jk_env_t *env, void **result, - char *type, char *name) +int JK_METHOD jk_pool_apr_factory(jk_env_t *env, jk_pool_t *pool, + void **result, + char *type, char *name) { jk_pool_t *_this=(jk_pool_t *)calloc( 1, sizeof(jk_pool_t)); -init_methods(_this ); - *result=_this; return JK_TRUE; -} - -/*
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_objCache.c
costin 01/12/06 14:51:23 Added: jk/native2/common jk_objCache.c Log: Cutpaste from jk_ajp14_worker. Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/common/jk_objCache.c Index: jk_objCache.c === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Jk, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * * = */ /* See jk_objCache.h for docs */ #include jk_global.h #include jk_pool.h #include jk_channel.h #include jk_msg_buff.h #include
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_ajp14_worker.c jk_jni_worker.c jk_channel_socket.c jk_endpoint.c jk_env.c jk_handler_logon.c jk_handler_response.c jk_lb_worker.c
costin 01/12/06 14:54:44 Modified:jk/native2/common jk_ajp14_worker.c jk_jni_worker.c jk_channel_socket.c jk_endpoint.c jk_env.c jk_handler_logon.c jk_handler_response.c jk_lb_worker.c Log: Updates for the interface changes. Use pools instead of malloc. Pools are now consistent ( i.e. jk_pool_t *pool ), no more on-stack pools. Revision ChangesPath 1.5 +25 -22jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c Index: jk_ajp14_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_ajp14_worker.c 2001/12/05 20:48:20 1.4 +++ jk_ajp14_worker.c 2001/12/06 22:54:44 1.5 @@ -72,8 +72,8 @@ #include jk_service.h #include jk_env.h -int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, void **result, - char *type, char *name); +int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, jk_pool_t *pool, void **result, + const char *type, const char *name); static int JK_METHOD jk_worker_ajp14_service(jk_endpoint_t *e, jk_ws_service_t *s, @@ -102,19 +102,19 @@ /* Impl */ -int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, void **result, - char *type, char *name) +int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, jk_pool_t *pool, void **result, + const char *type, const char *name) { jk_logger_t *l=env-logger; -jk_worker_t *w=(jk_worker_t *)malloc(sizeof(jk_worker_t)); - +jk_worker_t *w=(jk_worker_t *)pool-calloc(pool, sizeof(jk_worker_t)); + l-jkLog(l, JK_LOG_DEBUG, Into ajp14_worker_factory\n); if (name == NULL || w == NULL) { l-jkLog(l, JK_LOG_ERROR, In ajp14_worker_factory, NULL parameters\n); return JK_FALSE; } - +w-pool = pool; w-name = strdup(name); w-proto= AJP14_PROTO; @@ -176,15 +176,15 @@ return JK_FALSE; } -e-request = jk_b_new((e-pool)); +e-request = jk_b_new(e-pool); jk_b_set_buffer_size(e-request, DEF_BUFFER_SZ); jk_b_reset(e-request); -e-reply = jk_b_new((e-pool)); +e-reply = jk_b_new(e-pool); jk_b_set_buffer_size(e-reply, DEF_BUFFER_SZ); jk_b_reset(e-reply); -e-post = jk_b_new((e-pool)); +e-post = jk_b_new(e-pool); jk_b_set_buffer_size(e-post, DEF_BUFFER_SZ); jk_b_reset(e-post); @@ -311,14 +311,11 @@ /* Create a default channel */ jk_env_t *env= we-env; - jk_env_objectFactory_t fac = - (jk_env_objectFactory_t)env-getFactory(env, channel, socket ); - l-jkLog( l, JK_LOG_DEBUG, Got socket channel factory \n); - - err=fac( env, (void **)pThis-channel, channel, socket ); - if( err != JK_TRUE ) { - l-jkLog(l, JK_LOG_ERROR, Error creating socket factory\n); - return err; + pThis-channel=env-getInstance(env, pThis-pool,channel, socket ); + + if( pThis-channel == NULL ) { + l-jkLog(l, JK_LOG_ERROR, Error creating socket channel\n); + return JK_FALSE; } l-jkLog(l, JK_LOG_ERROR, Got channel %lx %lx\n, pThis, pThis-channel); } @@ -385,7 +382,8 @@ jk_logger_t*l) { jk_endpoint_t *ae = NULL; - +jk_pool_t *endpointPool; + if( _this-login-secret_key ==NULL ) { } @@ -413,14 +411,19 @@ } } -ae = (jk_endpoint_t *)malloc(sizeof(jk_endpoint_t)); -if (!ae) { +endpointPool = _this-pool-create( _this-pool, HUGE_POOL_SIZE ); + +ae = (jk_endpoint_t *)endpointPool-alloc(endpointPool, + sizeof(jk_endpoint_t)); +if (ae==NULL) { l-jkLog(l, JK_LOG_ERROR, ajp14.get_endpoint OutOfMemoryException\n); return JK_FALSE; } ae-reuse = JK_FALSE; -jk_open_pool(ae-pool, ae-buf, sizeof(ae-buf)); + +ae-pool = endpointPool; + ae-worker = _this; ae-proto = _this-proto; ae-channelData = NULL; 1.7 +24 -26jakarta-tomcat-connectors/jk/native2/common/jk_jni_worker.c Index: jk_jni_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_jni_worker.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_jni_worker.c 2001/12/05 20:48:20 1.6 +++ jk_jni_worker.c 2001/12/06 22:54:44 1.7 @@
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin SetUpServerAction.java LabelValueBean.java ServerAction.java ServerForm.java
patrickl01/12/06 14:55:58 Added: webapps/admin/WEB-INF/classes/org/apache/webapp/admin SetUpServerAction.java LabelValueBean.java ServerAction.java ServerForm.java Log: Submitted by: Manveen Kaur Revision ChangesPath 1.1 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java Index: SetUpServerAction.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v 1.1 2001/12/06 22:55:57 patrickl Exp $ * $Revision: 1.1 $ * $Date: 2001/12/06 22:55:57 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.webapp.admin; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.QueryExp; import javax.management.Query; import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.JMException; import javax.management.MBeanAttributeInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanInfo; import javax.management.modelmbean.ModelMBean; import javax.management.modelmbean.ModelMBeanInfo; /** * Test codeAction/code that handles events from the tree control test * page. * * @author Jazmin Jonson * @version $Revision: 1.1 $ $Date: 2001/12/06 22:55:57 $ */ public class SetUpServerAction extends Action { private static MBeanServer mBServer = null; public final static String PORT_PROP_NAME = port; public final static String
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_handler_discovery.c
costin 01/12/06 14:57:14 Modified:jk/native2/common jk_handler_discovery.c Log: Some massive changes. This is now probably broken ( but it's an optional piece ). The idea is that status notifications and messages about new apps could be sent by tomcat at any time - not only at startup time. The original code did a RPC-style request for discovery - that didn't worked if tomcat was started after apache, and doesn't allow for dynamic updates. The way ( I think ) it should operate is to accept messages at any time using the common loop and dispatch on message type. Revision ChangesPath 1.6 +120 -612 jakarta-tomcat-connectors/jk/native2/common/jk_handler_discovery.c Index: jk_handler_discovery.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_handler_discovery.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_handler_discovery.c2001/12/05 20:48:20 1.5 +++ jk_handler_discovery.c2001/12/06 22:57:13 1.6 @@ -58,7 +58,7 @@ /** * Description: AJP14 Discovery handler * Author: Henri Gomez [EMAIL PROTECTED] - * Version: $Revision: 1.5 $ + * Version: $Revision: 1.6 $ */ #include jk_global.h @@ -68,105 +68,30 @@ #include jk_logger.h #include jk_service.h #include jk_handler.h +#include jk_webapp.h +#include jk_workerEnv.h -#define CBASE_INC_SIZE (8)/* Allocate memory by step of 8 URIs : ie 8 URI by context */ -#define URI_INC_SIZE (8)/* Allocate memory by step of 8 CONTEXTs : ie 8 contexts by worker */ +int JK_METHOD jk_handler_discovery_factory( jk_env_t *env, jk_pool_t *pool, void **result, +const char *type, const char *name); -/** XXX XXX MERGE into jk_uriMap / jk_uriEnv */ - -typedef struct { -char * cbase; -int status; -int size; -int capacity; -char ** uris; -} jk_context_item_t; - - -typedef struct { - -/* - * Memory Pool - */ - -jk_pool_t p; -jk_pool_atom_t buf[SMALL_POOL_SIZE]; - - /* - * Virtual Server (if use) - */ - - char * virtual; - -/* - * Num of context handled (ie: examples, admin...) - */ - -int size; - -/* - * Capacity - */ - -int capacity; - -/* - * Context list, context / URIs - */ - -jk_context_item_t **contexts; -} -jk_context_t; - - -/* - * functions defined here - */ - -int context_set_virtual(jk_context_t *c, char *virtual); - -int context_open(jk_context_t *c, char *virtual); - -int context_free(jk_context_t **c); - -jk_context_item_t *context_find_base(jk_context_t *c, char *cbase); - -char *context_item_find_uri(jk_context_item_t *ci, char *uri); - -void context_dump_uris(jk_context_t *c, char *cbase, FILE *f); - -jk_context_item_t *context_add_base(jk_context_t *c, char *cbase); - -int context_add_uri(jk_context_t *c, char *cbase, char *uri); - -static int jk_handler_discovery_init( jk_worker_t *w ); - -static int jk_handler_discovery_discovery(jk_endpoint_t *ae,jk_workerEnv_t *we, - jk_logger_t *l); - -static int ajp14_marshal_context_query_into_msgb(jk_msg_buf_t *msg, - char *virtual, - jk_logger_t *l); - -static int ajp14_unmarshal_context_info(jk_msg_buf_t *msg, -jk_context_t *c, -jk_logger_t *l); - -static int ajp14_marshal_context_state_into_msgb(jk_msg_buf_t *msg, - jk_context_t *c, - char *cname, - jk_logger_t *l); - -static int ajp14_unmarshal_context_state_reply(jk_msg_buf_t *msg, - jk_context_t *c, - jk_logger_t *l); - -static int ajp14_unmarshal_context_update_cmd(jk_msg_buf_t *msg, - jk_context_t *c, +int jk_handler_discovery_sendDiscovery(jk_endpoint_t *ae, + jk_workerEnv_t *we, + jk_logger_t*l); + +int jk_handler_discovery_handleContextList(jk_endpoint_t *ae, + jk_workerEnv_t *we, +
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_en.properties ApplicationResources_es.properties TomcatTreeBuilder.java
patrickl01/12/06 14:57:54 Modified:webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_en.properties ApplicationResources_es.properties TomcatTreeBuilder.java Log: Implementation of support for the Tomcat Server node in the admin webapp Submitted by: Manveen Kaur Revision ChangesPath 1.5 +5 -0 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties Index: ApplicationResources_en.properties === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ApplicationResources_en.properties2001/11/18 17:17:08 1.4 +++ ApplicationResources_en.properties2001/12/06 22:57:54 1.5 @@ -8,6 +8,7 @@ button.reset=Reset button.save=Save button.change=Change +button.cancel=Cancel login.enter=Enter a username and password to start a new session login.changeLanguage=Change the language index.success=Login successful! @@ -21,3 +22,7 @@ sample.someText.required=liSome Text cannot be empty/li sample.moreText.required=liMore Text cannot be empty/li save.success=Save sucessful! +server.heading=Tomcat Server +server.portnumber=Port Number +server.debuglevel=Debug Level +server.shutdown=Shutdown 1.5 +5 -0 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties Index: ApplicationResources_es.properties === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ApplicationResources_es.properties2001/11/18 17:17:08 1.4 +++ ApplicationResources_es.properties2001/12/06 22:57:54 1.5 @@ -8,6 +8,7 @@ button.reset=Reiniciar button.save=Guardar button.change=Cambiar +button.cancel=Cancelan login.enter=Introduzca un nombre de usuario y una contrase\u00f1a que empezar una sesi\u00f3n nueva login.changeLanguage=Cambie el idioma index.success=\u00a1Autenticaci\u00f3n tiene \u00e9xito! @@ -21,3 +22,7 @@ sample.someText.required=li\u00abAlg\u00fan Texto\u00bb no puede ser vac\u00edo/li sample.moreText.required=li\u00abM\u00e1s Texto\u00bb no puede ser vac\u00edo/li save.success=\u00a1Guardar tiene \u00e9xito! +server.heading=Tomcat Servidor +server.portnumber=Número de acceso +server.debuglevel=Ponga a punto Llano +server.shutdown=Parada normal 1.2 +14 -12 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java Index: TomcatTreeBuilder.java === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TomcatTreeBuilder.java2001/11/27 02:46:28 1.1 +++ TomcatTreeBuilder.java2001/12/06 22:57:54 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v 1.1 2001/11/27 02:46:28 patrickl Exp $ - * $Revision: 1.1 $ - * $Date: 2001/11/27 02:46:28 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v 1.2 2001/12/06 22:57:54 patrickl Exp $ + * $Revision: 1.2 $ + * $Date: 2001/12/06 22:57:54 $ * * * @@ -100,11 +100,11 @@ // This SERVER_LABEL needs to be localized private final static String SERVER_LABEL = Tomcat Server; -private final static String SERVER_TYPE = Catalina:type=Server; +public final static String SERVER_TYPE = Catalina:type=Server; private final static String SERVICE_TYPE = Catalina:type=Service; private final static String ENGINE_TYPE = Engine; private final static String CONNECTOR_TYPE = Catalina:type=Connector; -private final static String WILDCARD = ,*; +public final static String WILDCARD = ,*; private static MBeanServer mBServer = null; @@ -135,15 +135,15 @@ // HACK to take into account special characters like = and // in the node name, could remove this code if encode URL // and later request.getParameter() could deal with = and -// character in parameter values. Must decode name in users action. -// TreeControlTest.java in
[j-t-c] problem in ajp_process_callback (in jk_ajp_common.c)
in ajp_process_callback, here is the block of code that handles sending the next chunk of data from the webserver to tomcat: --- snip --- case JK_AJP13_GET_BODY_CHUNK: { unsigned len = (unsigned)jk_b_get_int(msg); jk_log(l, JK_LOG_DEBUG, received JK_AJP13_GET_BODY_CHUNK, len=%d\n, len); if(len AJP13_MAX_SEND_BODY_SZ) { len = AJP13_MAX_SEND_BODY_SZ; } if(len ae-left_bytes_to_send) { jk_log(l, JK_LOG_DEBUG, len ae-left_bytes_to_send (%d %d)\n, len, ae-left_bytes_to_send); len = ae-left_bytes_to_send; } if(len 0) { len = 0; } /* the right place to add file storage for upload */ if ((len = ajp_read_into_msg_buff(ae, r, msg, len, l)) = 0) { r-content_read += len; return JK_AJP13_HAS_RESPONSE; } jk_log(l, JK_LOG_ERROR, Error ajp_process_callback - ajp_read_into_msg_buff failed\n); return JK_INTERNAL_ERROR; } break; --- end snip --- in this line: if ((len = ajp_read_into_msg_buff(ae, r, msg, len, l)) = 0) { shouldn't pmsg (the post message) be read into, not msg? i think you only run into this situation when the posted data doesn't fit into the first message to tomcat, or a handling servlet doesn't make use of content-length and tries to read more bytes than are available. i'm not sure though... the code is a little hard to follow :) anyway, i was running into a problem with an infinite loop in the ajp layer. when i made this change, the problem went away. can someone who knows this code better than i take a look? thanks in advance. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF struts-config.xml
patrickl01/12/06 14:58:33 Modified:webapps/admin/WEB-INF struts-config.xml Log: Implementation of support for the Tomcat Server node in the admin webapp Submitted by: Manveen Kaur Revision ChangesPath 1.9 +26 -0 jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml Index: struts-config.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- struts-config.xml 2001/11/21 01:10:09 1.8 +++ struts-config.xml 2001/12/06 22:58:33 1.9 @@ -19,6 +19,10 @@ form-bean name=sampleForm type=org.apache.webapp.admin.SampleForm/ +!-- Server form bean -- +form-bean name=serverForm +type=org.apache.webapp.admin.ServerForm/ + !-- Set Locale form bean -- form-bean name=setLocaleForm type=org.apache.webapp.admin.SetLocaleForm/ @@ -46,6 +50,10 @@ path=/tree-control-test.jsp redirect=false/ +forwardname=Server +path=/server.jsp +redirect=false/ + forwardname=Save Successful path=/saved.jsp redirect=false/ @@ -73,6 +81,16 @@ redirect=true/ /action +!-- Set up Tree datastructure -- +actionpath=/setUpServer + type=org.apache.webapp.admin.SetUpServerAction + name=serverForm + scope=session + forwardname=SetUpServer + path=/server.jsp + redirect=true/ +/action + !-- Log out of the application -- actionpath=/logOut type=org.apache.webapp.admin.LogOutAction @@ -87,6 +105,14 @@ name=sampleForm scope=session input=/sample.jsp +/action + +!-- Process a user server change -- +actionpath=/server + type=org.apache.webapp.admin.ServerAction + name=serverForm + scope=session + input=/server.jsp /action !-- Process a set-locale action -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_pool.c
costin 01/12/06 14:59:03 Modified:jk/native2/common jk_pool.c Log: Moved the private data inside. It compiles and seems to work fine - but for now it's not enabled, I want to test APR pools. When I start porting the other server adapters ( hopefully next week I'll be done with most refactoring ) I'll go back to test the 'common' pool. Revision ChangesPath 1.4 +159 -103 jakarta-tomcat-connectors/jk/native2/common/jk_pool.c Index: jk_pool.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_pool.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_pool.c 2001/12/05 20:48:20 1.3 +++ jk_pool.c 2001/12/06 22:59:03 1.4 @@ -58,56 +58,144 @@ /*** * Description: Simple memory pool * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ #include jk_pool.h #include jk_env.h #define DEFAULT_DYNAMIC 10 +#define JK_DEBUG_POOL 1 +/* Private data for jk pools + */ +struct jk_pool_private { +jk_pool_t *parent; +int size; +int pos; +int dyn_size; +int dyn_pos; +void **dynamic; +char *buf; +}; + +typedef struct jk_pool_private jk_pool_private_t; + +int jk_pool_create( jk_pool_t **newPool, jk_pool_t *parent, int size ); + int JK_METHOD jk_pool_factory( jk_env_t *env, void **result, char *type, char *name); +static jk_pool_t *jk_pool_createChild( jk_pool_t *parent, int size ); + static void *jk_pool_dyn_alloc(jk_pool_t *p, size_t size); -static void jk_reset_pool(jk_pool_t *p); +static void jk_pool_reset(jk_pool_t *p); -static void jk_close_pool(jk_pool_t *p); +static void jk_pool_close(jk_pool_t *p); -static void *jk_pool_alloc(jk_pool_t *p, - size_t size); +static void *jk_pool_alloc(jk_pool_t *p, size_t size); + +static void *jk_pool_calloc(jk_pool_t *p, size_t size); + +static void *jk_pool_strdup(jk_pool_t *p, const char *s); + +static void *jk_pool_realloc(jk_pool_t *p, size_t sz,const void *old, + size_t old_sz); + + +int jk_pool_create( jk_pool_t **newPool, jk_pool_t *parent, int size ) { +jk_pool_private_t *pp; + +jk_pool_t *_this=(jk_pool_t *)malloc( sizeof( jk_pool_t )); +/* jk_pool_t *_this=(jk_pool_t *)malloc( sizeof( jk_pool_t ) + */ +/* sizeof( jk_pool_private_t ) +*/ +/* size ); */ +pp=(jk_pool_private_t *)malloc( sizeof( jk_pool_private_t )); + +_this-_private=pp; + +/* XXX strange, but I assume the size is in bytes, not atom_t */ +pp-buf=(char *)malloc( size ); + +pp-pos = 0; +pp-size = size; + +pp-dyn_pos = 0; +pp-dynamic = NULL; +pp-dyn_size = 0; +pp-parent=parent; + +/* methods */ +_this-create=jk_pool_createChild; +_this-close=jk_pool_close; +_this-reset=jk_pool_reset; + +_this-alloc=jk_pool_alloc; +_this-calloc=jk_pool_calloc; +_this-pstrdup=jk_pool_strdup; +_this-realloc=jk_pool_realloc; + +*newPool = _this; + +return JK_TRUE; +} -static void jk_close_pool(jk_pool_t *p) +static jk_pool_t *jk_pool_createChild( jk_pool_t *parent, int size ) { +jk_pool_t *newPool; + +jk_pool_create( newPool, parent, size ); +return newPool; +} + +static void jk_pool_close(jk_pool_t *p) { -if(p) { -jk_reset_pool(p); -if(p-dynamic) { -free(p-dynamic); -} +jk_pool_private_t *pp; + +if(p==NULL || p-_private==NULL) +return; + +pp=(jk_pool_private_t *)p-_private; + +jk_pool_reset(p); +if(pp-dynamic) { +free(pp-dynamic); } +if( pp-buf ) +free( pp-buf ); +free( pp ); +free( p ); } -static void jk_reset_pool(jk_pool_t *p) +static void jk_pool_reset(jk_pool_t *p) { -if(p p-dyn_pos p-dynamic) { -unsigned i; -for(i = 0 ; i p-dyn_pos ; i++) { -if(p-dynamic[i]) { -free(p-dynamic[i]); +jk_pool_private_t *pp; + +if(p==NULL || p-_private ==NULL ) +return; + +pp=(jk_pool_private_t *)p-_private; + +if( pp-dyn_pos
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_logger_file.c jk_map.c
costin 01/12/06 14:59:52 Modified:jk/native2/common jk_logger_file.c jk_map.c Log: Updates, use pools, etc. Revision ChangesPath 1.5 +7 -6 jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c Index: jk_logger_file.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_logger_file.c 2001/12/04 19:11:56 1.4 +++ jk_logger_file.c 2001/12/06 22:59:52 1.5 @@ -59,7 +59,7 @@ * Description: Utility functions (mainly configuration) * * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***/ #include jk_env.h @@ -72,8 +72,8 @@ #define HUGE_BUFFER_SIZE (8*1024) #define LOG_LINE_SIZE(1024) -int JK_METHOD jk_logger_file_factory(jk_env_t *env, void **result, - char *type, char *name); +int JK_METHOD jk_logger_file_factory(jk_env_t *env, jk_pool_t *pool, void **result, + const char *type, const char *name); /* @@ -260,11 +260,12 @@ int jk_logger_file_factory(jk_env_t *env, + jk_pool_t *pool, void **result, - char *type, - char *name) + const char *type, + const char *name) { -jk_logger_t *l = (jk_logger_t *)malloc(sizeof(jk_logger_t)); +jk_logger_t *l = (jk_logger_t *)pool-alloc(pool, sizeof(jk_logger_t)); if(l==NULL ) { return JK_FALSE; 1.5 +121 -110 jakarta-tomcat-connectors/jk/native2/common/jk_map.c Index: jk_map.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_map.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_map.c 2001/12/05 20:48:20 1.4 +++ jk_map.c 2001/12/06 22:59:52 1.5 @@ -58,7 +58,7 @@ /*** * Description: General purpose map object * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***/ #include jk_global.h @@ -70,8 +70,7 @@ #define LENGTH_OF_LINE(1024) struct jk_map { -jk_pool_t p; -jk_pool_atom_t buf[SMALL_POOL_SIZE]; +jk_pool_t *pool; const char **names; const void **values; @@ -84,53 +83,39 @@ static int trim(char *s); static int map_realloc(jk_map_t *m); -int map_alloc(jk_map_t **m) +int map_alloc(jk_map_t **m, jk_pool_t *pool ) { -if(m) { -return map_open(*m = (jk_map_t *)malloc(sizeof(jk_map_t))); -} - -return JK_FALSE; -} - -int map_free(jk_map_t **m) -{ -int rc = JK_FALSE; +jk_map_t *_this; -if(m *m) { -map_close(*m); -free(*m); -*m = NULL; -} +if( m== NULL ) +return JK_FALSE; -return rc; -} - -int map_open(jk_map_t *m) -{ -int rc = JK_FALSE; +_this=(jk_map_t *)pool-alloc(pool, sizeof(jk_map_t)); +*m=_this; -if(m) { -jk_open_pool(m-p, m-buf, sizeof(jk_pool_atom_t) * SMALL_POOL_SIZE); -m-capacity = 0; -m-size = 0; -m-names= NULL; -m-values = NULL; -rc = JK_TRUE; -} +if( _this == NULL ) +return JK_FALSE; -return rc; +_this-pool = pool; + +_this-capacity = 0; +_this-size = 0; +_this-names= NULL; +_this-values = NULL; + +return JK_TRUE; } -int map_close(jk_map_t *m) +int map_free(jk_map_t **m) { int rc = JK_FALSE; -if(m) { -m-p.close(m-p); +if(m *m) { +(*m)-pool-close((*m)-pool); rc = JK_TRUE; +/* free(*m); */ +*m = NULL; } - return rc; } @@ -204,49 +189,53 @@ } char **map_get_string_list(jk_map_t *m, + jk_pool_t *pool, const char *name,
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_workerEnv.c
costin 01/12/06 15:00:44 Modified:jk/native2/common jk_workerEnv.c Log: Added the createWebapp method. Updates, pools, small fixes. Revision ChangesPath 1.5 +62 -12jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c Index: jk_workerEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_workerEnv.c2001/12/05 20:48:20 1.4 +++ jk_workerEnv.c2001/12/06 23:00:44 1.5 @@ -59,7 +59,7 @@ * Description: Workers controller * * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***/ #include jk_workerEnv.h @@ -68,7 +68,7 @@ #define DEFAULT_WORKER (ajp13) -int JK_METHOD jk_workerEnv_factory( jk_env_t *env, void **result, +int JK_METHOD jk_workerEnv_factory( jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); static void jk_workerEnv_close(jk_workerEnv_t *_this); @@ -88,11 +88,12 @@ /* _this-init_data=init_data; */ -worker_list = map_get_string_list(init_data, +worker_list = map_get_string_list(init_data, + NULL, worker.list, _this-num_of_workers, DEFAULT_WORKER ); -if(worker_list==NULL || _this-num_of_workers= 0 ) { + if(worker_list==NULL || _this-num_of_workers= 0 ) { /* assert() - we pass default worker, we should get something back */ return JK_FALSE; } @@ -175,6 +176,42 @@ return rc; } + +static jk_webapp_t *jk_workerEnv_createWebapp(jk_workerEnv_t *_this, + const char *vhost, + const char *name, + jk_map_t *init_data) +{ +jk_pool_t *webappPool; +jk_webapp_t *webapp; + +webappPool=(jk_pool_t *)_this-pool-create( _this-pool, + HUGE_POOL_SIZE); + +webapp=(jk_webapp_t *)webappPool-calloc(webappPool, + sizeof( jk_webapp_t )); + +webapp-pool=webappPool; + +webapp-context=_this-pool-pstrdup( _this-pool, name); +webapp-virtual=_this-pool-pstrdup( _this-pool, vhost); + +if( name==NULL ) { +webapp-ctxt_len=0; +} else { +webapp-ctxt_len = strlen(name); +} + + +/* XXX Find it if it's already allocated */ + +/* Add vhost:name to the map */ + +return webapp; + +} + + static jk_worker_t *jk_workerEnv_createWorker(jk_workerEnv_t *_this, const char *name, jk_map_t *init_data) @@ -184,10 +221,16 @@ jk_env_objectFactory_t fac; jk_logger_t *l=_this-l; jk_worker_t *w = NULL; +jk_pool_t *workerPool; +workerPool=_this-pool-create(_this-pool, HUGE_POOL_SIZE); + type=map_getStrProp( init_data,worker,name,type,NULL ); + +/* Each worker has it's own pool */ + -w=(jk_worker_t *)_this-env-getInstance(_this-env, worker, type ); +w=(jk_worker_t *)_this-env-getInstance(_this-env, workerPool, worker, type ); if( w == NULL ) { l-jkLog(l, JK_LOG_ERROR, @@ -196,11 +239,10 @@ return NULL; } +w-pool=workerPool; w-name=(char *)name; w-workerEnv=_this; -jk_pool_create( w-pool, NULL, 1024 ); - err=w-validate(w, init_data, _this, l); if( err!=JK_TRUE ) { @@ -226,20 +268,23 @@ return w; } -int JK_METHOD jk_workerEnv_factory( jk_env_t *env, void **result, +int JK_METHOD jk_workerEnv_factory( jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name) { jk_logger_t *l=env-logger; jk_workerEnv_t *_this; int err; +jk_pool_t *uriMapPool; l-jkLog(l, JK_LOG_DEBUG, Creating workerEnv \n); -_this=(jk_workerEnv_t *)calloc( 1, sizeof( jk_workerEnv_t )); +_this=(jk_workerEnv_t *)pool-calloc( pool, sizeof( jk_workerEnv_t )); +_this-pool=pool; *result=_this;
Re: [PATCH] jakarta-tomcat-4.0/webapps/admin/
Manveen, I committed all of your new files except for the PaperTexture.gif. I didn't commit the .gif file as it is not clear to me if that is copyrighted by someone other than Apache. Patrick Enhanced the admin tool by adding a new server screen and its related backend functionality. Please add these files to the HEAD branch. ( *.java under jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ server.jsp under jakarta-tomcat-4.0/webapps/admin/ PaperTexture.gif under jakarta-tomcat-4.0/webapps/admin/images/) Thanks! --- Name: SetUpServerAction.java SetUpServerAction.javaType: Plain Text (text/plain) Encoding: 7bit Name: LabelValueBean.java LabelValueBean.javaType: Plain Text (text/plain) Encoding: 7bit Name: ServerAction.java ServerAction.javaType: Plain Text (text/plain) Encoding: 7bit Name: ServerForm.java ServerForm.javaType: Plain Text (text/plain) Encoding: 7bit Name: PaperTexture.gif PaperTexture.gifType: GIF Image (image/gif) Encoding: base64 Part 1.7Type: Plain Text (text/plain) -- _ Patrick Luby Email: [EMAIL PROTECTED] Sun Microsystems Phone: 408-276-7471 901 San Antonio Road, USCA14-303 Palo Alto, CA 94303-4900 _ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriMap.c
costin 01/12/06 15:04:33 Modified:jk/native2/common jk_uriMap.c Log: Updates, start updating to use jk_webapp. Note that jk_webapp should drasticaly improve the scalability - on a site with many webapps the performance of a global uriMap becomes problematic. jk_webapp will allow a simple partitioning ( of course, using 'native' directives will allways be faster ) Added a (maybe hacky ) fix to the thread-safety problem ( I don't think too many people will be able to see it - it happens only if you use a lot of url rewriting ). The fix should work fine as long as the uri is not processed by multiple threads at the same time ( in which case almost anything can fail ) Revision ChangesPath 1.7 +88 -69jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c Index: jk_uriMap.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_uriMap.c 2001/12/05 20:48:20 1.6 +++ jk_uriMap.c 2001/12/06 23:04:33 1.7 @@ -67,14 +67,14 @@ * servlet container. * * Author: Gal Shachor [EMAIL PROTECTED] - * Version: $Revision: 1.6 $ + * Version: $Revision: 1.7 $ */ #include jk_pool.h #include jk_env.h #include jk_uriMap.h -int JK_METHOD jk_uriMap_factory( jk_env_t *env, void **result, +int JK_METHOD jk_uriMap_factory( jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); static int jk_uriMap_init(jk_uriMap_t *_this, @@ -128,8 +128,8 @@ if((('.' == *after_suffix) || ('/' == *after_suffix) || (' ' == *after_suffix)) - (0 == strncmp(_this-maps[i]-context, uri, - _this-maps[i]-ctxt_len))) { + (0 == strncmp(_this-maps[i]-prefix, uri, + _this-maps[i]-prefix_len))) { /* * Security violation !!! * this is a fraud. @@ -153,11 +153,11 @@ static int uriMap_realloc(jk_uriMap_t *_this) { if (_this-size == _this-capacity) { -jk_uriEnv_t **uwr; +jk_uriEnv_t **uwr=NULL; int capacity = _this-capacity + UW_INC_SIZE; uwr = (jk_uriEnv_t **) -_this-p.alloc(_this-p, sizeof(jk_uriEnv_t *) * capacity); +_this-pool-alloc(_this-pool, sizeof(jk_uriEnv_t *) * capacity); if (! uwr) return JK_FALSE; @@ -173,12 +173,15 @@ return JK_TRUE; } -static jk_uriEnv_t *jk_uriMap_createUriEnv(jk_uriMap_t *_this ) { -jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)_this-p.alloc(_this-p, - sizeof(jk_uriEnv_t)); -memset(uriEnv, 0, sizeof(jk_uriEnv_t)); - +static jk_uriEnv_t *jk_uriMap_createUriEnv(jk_uriMap_t *_this, + const char *vhost, const char *uri ) +{ +jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)_this-pool-calloc(_this-pool, + sizeof(jk_uriEnv_t)); uriEnv-workerEnv=_this-workerEnv; +/* XXX search the real webapp + */ +uriEnv-webapp=_this-workerEnv-rootWebapp; return uriEnv; } @@ -202,11 +205,13 @@ return NULL; } -uwr = jk_uriMap_createUriEnv(_this); +uwr = jk_uriMap_createUriEnv(_this,vhost,puri); + +uri = _this-pool-pstrdup(_this-pool, puri); +uwr-uri = _this-pool-pstrdup(_this-pool, uri); -uri = _this-p.pstrdup(_this-p, puri); -worker = _this-p.pstrdup(_this-p, pworker); -uwr-workerName = worker; +worker = _this-pool-pstrdup(_this-pool, pworker); +uwr-webapp-workerName = worker; if (uri==NULL || worker==NULL || @@ -238,8 +243,8 @@ // set the mapping type if (!asterisk) { /* Something like: JkMount /login/j_security_check ajp13 */ -uwr-uri = uri; -uwr-context = uri; +uwr-prefix = uri; +uwr-prefix_len =strlen( uwr-prefix ); uwr-suffix = NULL; uwr-match_type = MATCH_TYPE_EXACT; l-jkLog(l, JK_LOG_DEBUG, @@ -248,8 +253,6 @@ return uwr; } -uwr-uri = _this-p.pstrdup(_this-p, uri); - if (!uwr-uri) { l-jkLog(l, JK_LOG_ERROR,Allocation error\n);
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_registry.c
costin 01/12/06 15:04:47 Modified:jk/native2/common jk_registry.c Log: Updates. Revision ChangesPath 1.4 +10 -9 jakarta-tomcat-connectors/jk/native2/common/jk_registry.c Index: jk_registry.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_registry.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_registry.c 2001/12/05 20:48:20 1.3 +++ jk_registry.c 2001/12/06 23:04:46 1.4 @@ -62,7 +62,7 @@ /*** * Description: Worker list* - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ /** Static declarations for all 'hardcoded' modules. This is a hack, @@ -84,33 +84,34 @@ * */ -int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, void **result, +int JK_METHOD jk_worker_ajp14_factory( jk_env_t *env, jk_pool_t *pool, + void **result, const char *type, const char *name); -int JK_METHOD jk_worker_lb_factory(jk_env_t *env, void **result, +int JK_METHOD jk_worker_lb_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -int JK_METHOD jk_worker_jni_factory(jk_env_t *env, void **result, +int JK_METHOD jk_worker_jni_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -int JK_METHOD jk_worker_ajp12_factory(jk_env_t *env, void **result, +int JK_METHOD jk_worker_ajp12_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); /* Factories for 'new' types. We use the new factory interface, * workers will be updated later */ -int JK_METHOD jk_channel_socket_factory(jk_env_t *env, void **result, +int JK_METHOD jk_channel_socket_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -int JK_METHOD jk_workerEnv_factory(jk_env_t *env, void **result, +int JK_METHOD jk_workerEnv_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -int JK_METHOD jk_uriMap_factory(jk_env_t *env, void **result, +int JK_METHOD jk_uriMap_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -int JK_METHOD jk_logger_file_factory(jk_env_t *env, void **result, +int JK_METHOD jk_logger_file_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[PATCH] jakarta-tomcat-4.0/webapps/admin/
Please add this file to the HEAD branch. (I'd forgotten to attach it in my last mail.) New Server screen added to admin tool. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_es.properties
patrickl01/12/06 15:19:17 Modified:webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_es.properties Log: Correct some of the Spanish stuff Revision ChangesPath 1.6 +2 -2 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties Index: ApplicationResources_es.properties === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ApplicationResources_es.properties2001/12/06 22:57:54 1.5 +++ ApplicationResources_es.properties2001/12/06 23:19:17 1.6 @@ -8,7 +8,7 @@ button.reset=Reiniciar button.save=Guardar button.change=Cambiar -button.cancel=Cancelan +button.cancel=Cancelar login.enter=Introduzca un nombre de usuario y una contrase\u00f1a que empezar una sesi\u00f3n nueva login.changeLanguage=Cambie el idioma index.success=\u00a1Autenticaci\u00f3n tiene \u00e9xito! @@ -24,5 +24,5 @@ save.success=\u00a1Guardar tiene \u00e9xito! server.heading=Tomcat Servidor server.portnumber=Número de acceso -server.debuglevel=Ponga a punto Llano +server.debuglevel=Ponga a punto llano server.shutdown=Parada normal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Resend: [PATCH] jakarta-tomcat-4.0/webapps/admin/
Resending... On Thu, 6 Dec 2001, Manveen Kaur wrote: Please add this file to the HEAD branch. (I'd forgotten to attach it in my last mail.) New Server screen added to admin tool. !-- Standard Struts Entries -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true %@ include file=header.jsp % !-- Body -- body bgcolor=white !--Form -- html:errors/ html:form method=POST action=/server focus=portNumberText table width=100% border=0 cellspacing=0 cellpadding=0 tr class=page-title-row td align=left nowrap div class=page-title-textbean:message key=server.heading//div /td td align=right nowrap div class=page-title-text html:select property=action html:options collection=actionVals property=value labelProperty=label/ /html:select /div /td /tr tr tdnbsp;/td /tr tr td colspan=2 align=right nowrap html:submit styleClass=button bean:message key=button.save/ /html:submit nbsp; html:reset styleClass=button bean:message key=button.cancel/ /html:reset /td /tr tr tdnbsp;/td /tr /table table class=back-table border=0 cellspacing=0 cellpadding=1 width=100% tr td table class=front-table border=0 cellspacing=0 cellpadding=0 width=100% tr class=header-row td width=27% div class=table-header-text align=leftProperties/div /td td width=73% div class=table-header-text align=leftnbsp;/div /td /tr tr td div class=table-label-textbean:message key=server.portnumber/:/div /td td div class=table-normal-text html:text property=portNumberText size=24 maxlength=24/ /div /td /tr tr td class=line-row colspan=2img src= alt= width=1 height=1 border=0/td /tr tr td div class=table-label-textbean:message key=server.debuglevel/:/div /td td div class=table-normal-text html:select property=debugLvl html:options collection=debugLvlVals property=value labelProperty=label/ /html:select /div /td /tr tr td class=line-row colspan=2img src= alt= width=1 height=1 border=0/td /tr tr td div class=table-label-textbean:message key=server.shutdown/:/div /td td div class=table-normal-text html:text property=shutdownText size=24 maxlength=24/ /div /td /tr /table /td /tr /table table width=100% border=0 cellspacing=0 cellpadding=0 tr tdnbsp;/td /tr tr td colspan=2 align=right nowrap html:submit styleClass=button bean:message key=button.save/ /html:submit nbsp; html:reset styleClass=button bean:message key=button.cancel/ /html:reset /td /tr /table /html:form !-- Standard Footer -- %@ include file=footer.jsp % /body /html:html -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin SampleAction.java SampleForm.java
patrickl01/12/06 15:49:19 Modified:webapps/admin index.jsp webapps/admin/WEB-INF struts-config.xml Added: webapps/admin blank.jsp Removed: webapps/admin sample.jsp webapps/admin/WEB-INF/classes/org/apache/webapp/admin SampleAction.java SampleForm.java Log: Remove sample.jsp and its supporting classes since they are no longer needed Revision ChangesPath 1.7 +1 -1 jakarta-tomcat-4.0/webapps/admin/index.jsp Index: index.jsp === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/index.jsp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- index.jsp 2001/11/21 01:12:08 1.6 +++ index.jsp 2001/12/06 23:49:19 1.7 @@ -17,7 +17,7 @@ frame name=banner src='%= response.encodeURL(banner.jsp) %' scrolling=no frameset cols=300,* border=1 frame name=tree src='%= response.encodeURL(setUpTree.do) %' scrolling=auto -frame name=content src='%= response.encodeURL(sample.jsp) %' scrolling=auto +frame name=content src='%= response.encodeURL(blank.jsp) %' scrolling=auto /frameset /frameset 1.1 jakarta-tomcat-4.0/webapps/admin/blank.jsp Index: blank.jsp === !-- Standard Struts Entries -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true !-- Standard Content -- %@ include file=header.jsp % !-- Body -- body bgcolor=white /body !-- Standard Footer -- %@ include file=footer.jsp % /html:html 1.10 +0 -12 jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml Index: struts-config.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- struts-config.xml 2001/12/06 22:58:33 1.9 +++ struts-config.xml 2001/12/06 23:49:19 1.10 @@ -15,10 +15,6 @@ form-beans -!-- Sample form bean -- -form-bean name=sampleForm -type=org.apache.webapp.admin.SampleForm/ - !-- Server form bean -- form-bean name=serverForm type=org.apache.webapp.admin.ServerForm/ @@ -97,14 +93,6 @@ forwardname=Main Menu path=/index.jsp redirect=true/ -/action - -!-- Process a user sample change -- -actionpath=/sample - type=org.apache.webapp.admin.SampleAction - name=sampleForm - scope=session - input=/sample.jsp /action !-- Process a user server change -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Configuration(1)
I'm too over-committed to projects right now to give more than +0, but it is a very enthusiastic one :). I have cases where I want some contexts to have different mapping options from others, and it is a nightmare to maintain. I'm guessing that the context name is one of the entries in jkworkers.properties? Otherwise, you can't tell mod_alias about it. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 2:17 PM Subject: JK2: Configuration(1) Please reply - this is an important change ! I would like to add another configuration mechanism for jk2. If people agree, this should be the default. Assumptions: - All webapplication that will be served must be deployed on the machine running the web server ( otherwise the server can't find the static files ) - It is possible you run a load-balanced server and you may ( or not ) have tomcats on the server machine. - Minimal user configuration for 'simple' case. Advanced users will still have full power to override. Details: Via workers.properties ( or httpd.conf ) we'llspecify the path to webapps/ directory ( one or many ) and the 'style' ( flat or vhost ). mod_jk will use the same logic as tomcat to find all subdirs, and automatically add the contexts. ( using 'global' mappings ) In addition, for each webapplication jk will check [appbase]/WEB-INF/jkmappings.properties If the file exists, it'll contain per/webapp mappings ( without the context prefix ) == an easy to parse form of what's in web.xml. In addition, [appbase]/WEB-INF/jk.workers will include the list with all tomcat instances where the webapp is running. If none is found, the default worker will be used. Note: 1. if WEB-INF/jk.workers contains a single worker, we'll have the current effect of JkMount 2. If it has multiple workers, it'll be load balanced, as if a lb worker would have been defined and the app would be mapped to that worker. Benefits: - Simple things are simple. After the initial configuration of apache ( consisting of a LoadModule and pointing to the path to tomcat -- which can be fixed for RPMs or installed case ), the user will not have to do anything else but soft-restart the web server. - Keep application config separated. - The use can still override whatever he wants ( using explicit configs ) or place apps in different directories. - no need to have tomcat running ( or running on the server machine ) ( this will be used in addition to ajp14 autoconf ) Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_uri_worker_map.c
larryi 01/12/06 16:57:16 Modified:jk/native/common jk_uri_worker_map.c Log: Restore patch supplied by Michael Jennings, Revision ChangesPath 1.13 +57 -15jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c Index: jk_uri_worker_map.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_uri_worker_map.c 2001/12/04 19:44:23 1.12 +++ jk_uri_worker_map.c 2001/12/07 00:57:16 1.13 @@ -67,7 +67,7 @@ * servlet container. * * * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.12 $ * + * Version: $Revision: 1.13 $ * ***/ #include jk_pool.h @@ -77,6 +77,7 @@ #define MATCH_TYPE_EXACT(0) #define MATCH_TYPE_CONTEXT (1) #define MATCH_TYPE_SUFFIX (2) +#define MATCH_TYPE_GENERAL_SUFFIX (3) /* match all URIs of the form *ext */ struct uri_worker_record { /* Original uri for logging */ @@ -283,18 +284,31 @@ uwr-suffix = asterisk + 3; uwr-match_type = MATCH_TYPE_SUFFIX; jk_log(l, JK_LOG_DEBUG, - Into jk_uri_worker_map_t::uri_worker_map_open, suffix rule %s.%s=%s was added\n, -uri, asterisk + 3, worker); -} else { -/* context based */ -asterisk[1] = '\0'; -uwr-worker_name = worker; -uwr-context = uri; -uwr-suffix = NULL; -uwr-match_type = MATCH_TYPE_CONTEXT; -jk_log(l, JK_LOG_DEBUG, - Into jk_uri_worker_map_t::uri_worker_map_open, match rule %s=%s was added\n, - uri, worker); + Into jk_uri_worker_map_t::uri_worker_map_open, +suffix rule %s.%s=%s was added\n, +uri, asterisk + 3, worker); + } else if ('\0' != asterisk[2]) { + /* general suffix rule */ + asterisk[1] = '\0'; + uwr-worker_name = worker; + uwr-context = uri; + uwr-suffix = asterisk + 2; + uwr-match_type = MATCH_TYPE_GENERAL_SUFFIX; + jk_log(l, JK_LOG_DEBUG, +Into jk_uri_worker_map_t::uri_worker_map_open, +general suffix rule %s*%s=%s was added\n, +uri, asterisk + 2, worker); + } else { + /* context based */ + asterisk[1] = '\0'; + uwr-worker_name = worker; + uwr-context = uri; + uwr-suffix = NULL; + uwr-match_type = MATCH_TYPE_CONTEXT; + jk_log(l, JK_LOG_DEBUG, +Into jk_uri_worker_map_t::uri_worker_map_open, +match rule %s=%s was added\n, +uri, worker); } } else { /* Something like : JkMount /servlets/exampl* ajp13 */ @@ -396,6 +410,18 @@ return rc; } +/* returns the index of the last occurrence of the 'ch' character + if ch=='\0' returns the length of the string str */ +int last_index_of(const char *str,char ch) +{ +const char *str_minus_one=str-1; +const char *s=str+strlen(str); +while(s!=str_minus_one ch!=*s) { + --s; +} +return (s-str); +} + int uri_worker_map_close(jk_uri_worker_map_t *uw_map, jk_logger_t *l) { @@ -450,7 +476,8 @@ if(strlen(uri) == uwr-ctxt_len) { jk_log(l, JK_LOG_DEBUG, -jk_uri_worker_map_t::map_uri_to_worker, Found an exact match %s - %s\n, +jk_uri_worker_map_t::map_uri_to_worker, +Found an exact match %s - %s\n, uwr-worker_name, uwr-context ); jk_reset_pool(uw_map-tp); @@ -460,11 +487,26 @@ if(uwr-ctxt_len longest_match) { jk_log(l, JK_LOG_DEBUG, -
RE: JK2: Configuration(1)
After a quick glance, I'm +1. This seems like a good approach to automate the process in a way that is still configurable. Larry -Original Message- From: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent: Thu 12/6/2001 5:17 PM To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Cc: Subject: JK2: Configuration(1) Please reply - this is an important change ! I would like to add another configuration mechanism for jk2. If people agree, this should be the default. Assumptions: - All webapplication that will be served must be deployed on the machine running the web server ( otherwise the server can't find the static files ) - It is possible you run a load-balanced server and you may ( or not ) have tomcats on the server machine. - Minimal user configuration for 'simple' case. Advanced users will still have full power to override. Details: Via workers.properties ( or httpd.conf ) we'llspecify the path to webapps/ directory ( one or many ) and the 'style' ( flat or vhost ). mod_jk will use the same logic as tomcat to find all subdirs, and automatically add the contexts. ( using 'global' mappings ) In addition, for each webapplication jk will check [appbase]/WEB-INF/jkmappings.properties If the file exists, it'll contain per/webapp mappings ( without the context prefix ) == an easy to parse form of what's in web.xml. In addition, [appbase]/WEB-INF/jk.workers will include the list with all tomcat instances where the webapp is running. If none is found, the default worker will be used. Note: 1. if WEB-INF/jk.workers contains a single worker, we'll have the current effect of JkMount 2. If it has multiple workers, it'll be load balanced, as if a lb worker would have been defined and the app would be mapped to that worker. Benefits: - Simple things are simple. After the initial configuration of apache ( consisting of a LoadModule and pointing to the path to tomcat -- which can be fixed for RPMs or installed case ), the user will not have to do anything else but soft-restart the web server. - Keep application config separated. - The use can still override whatever he wants ( using explicit configs ) or place apps in different directories. - no need to have tomcat running ( or running on the server machine ) ( this will be used in addition to ajp14 autoconf ) Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] msg18742/bin0.bin Description: application/ms-tnef -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5259] - request.getSession()
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5259. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5259 request.getSession() [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||WORKSFORME --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 18:49 --- Of course the requested session Id isn't valid. You invalidate the session. The requested session Id is the value of the JSESSIONID cookie, which doesn't correspond to a valid session once you've invalidated the previous session. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 4223] - AJP13 connectors InputStream newer returns -1
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4223. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4223 AJP13 connectors InputStream newer returns -1 --- Additional Comments From [EMAIL PROTECTED] 2001-12-06 18:54 --- it think this bug might actually be a bug in the jk layer... in ajp_process_callback, here is the block of code that handles sending the next chunk of data from the webserver to tomcat: --- snip --- case JK_AJP13_GET_BODY_CHUNK: { unsigned len = (unsigned)jk_b_get_int(msg); jk_log(l, JK_LOG_DEBUG, received JK_AJP13_GET_BODY_CHUNK, len=%d\n, len); if(len AJP13_MAX_SEND_BODY_SZ) { len = AJP13_MAX_SEND_BODY_SZ; } if(len ae-left_bytes_to_send) { jk_log(l, JK_LOG_DEBUG, len ae-left_bytes_to_send (%d %d)\n, len, ae-left_bytes_to_send); len = ae-left_bytes_to_send; } if(len 0) { len = 0; } /* the right place to add file storage for upload */ if ((len = ajp_read_into_msg_buff(ae, r, msg, len, l)) = 0) { r-content_read += len; return JK_AJP13_HAS_RESPONSE; } jk_log(l, JK_LOG_ERROR, Error ajp_process_callback - ajp_read_into_msg_buff failed\n); return JK_INTERNAL_ERROR; } break; --- end snip --- in this line: if ((len = ajp_read_into_msg_buff(ae, r, msg, len, l)) = 0){ shouldn't pmsg (the post message) be read into, not msg? i don't know the code well enough to be sure anyway, i was running into a problem with an infinite loop in the ajp layer. when i made this change, the problem went away. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Http10Interceptor.java PoolTcpConnector.java
billbarker01/12/06 20:38:26 Modified:src/share/org/apache/tomcat/modules/server Http10Interceptor.java PoolTcpConnector.java Log: PureTLS support changes. Submitted by: Eric Rescorla [EMAIL PROTECTED] Revision ChangesPath 1.28 +45 -7 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java Index: Http10Interceptor.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Http10Interceptor.java2001/11/02 03:14:03 1.27 +++ Http10Interceptor.java2001/12/07 04:38:26 1.28 @@ -156,6 +156,10 @@ reqA.readNextRequest(resA); if( secure ) { reqA.scheme().setString( https ); + + // Load up the SSLSupport class + if(sslImplementation != null) + reqA.setSSLSupport(sslImplementation.getSSLSupport(socket)); } cm.service( reqA, resA ); @@ -199,13 +203,47 @@ catch (IOException e) { /* ignore */ } } } + + /** + getInfo calls for SSL data + + @return the requested data + */ + public Object getInfo( Context ctx, Request request, +int id, String key ) { + // The following code explicitly assumes that the only + // attributes hand;ed here are HTTP. If you change that + // you MUST change the test for sslSupport==null --EKR + + HttpRequest httpReq; + + + try { + httpReq=(HttpRequest)request; + } catch (ClassCastException e){ + return null; + } + + if(key!=null httpReq!=null httpReq.sslSupport!=null){ + try { + if(key.equals(javax.servlet.request.cipher_suite)) + return httpReq.sslSupport.getCipherSuite(); + if(key.equals(javax.servlet.request.X509Certificate)) + return httpReq.sslSupport.getPeerCertificateChain(); + } catch (Exception e){ + log(Exception getting SSL attribute + key,e,Log.WARNING); + return null; + } + } + return super.getInfo(ctx,request,id,key); + } } class HttpRequest extends Request { Http10 http=new Http10(); private boolean moreRequests = false; Socket socket; -static CertCompat certcompat = CertCompat.getCertCompat(); +SSLSupport sslSupport=null; public HttpRequest() { super(); @@ -214,12 +252,6 @@ remoteAddrMB.recycle(); remoteHostMB.recycle(); } -public Object getAttribute(String name) { -if (name.equals(javax.servlet.request.X509Certificate)) { -return(certcompat.getX509Certificates(socket)); - } -return(super.getAttribute(name)); -} public void recycle() { super.recycle(); @@ -227,6 +259,7 @@ // recycle these to remove the defaults remoteAddrMB.recycle(); remoteHostMB.recycle(); + sslSupport=null; } public void setSocket(Socket socket) throws IOException { @@ -352,6 +385,11 @@ // log(No server name, defaulting to localhost); serverNameMB.setString( getLocalHost() ); } + +void setSSLSupport(SSLSupport s){ +sslSupport=s; +} + } 1.13 +29 -27 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/PoolTcpConnector.java Index: PoolTcpConnector.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/PoolTcpConnector.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- PoolTcpConnector.java 2001/11/07 03:36:47 1.12 +++ PoolTcpConnector.java 2001/12/07 04:38:26 1.13 @@ -88,9 +88,11 @@ { protected PoolTcpEndpoint ep; protected ServerSocketFactory socketFactory; +protected SSLImplementation sslImplementation; // socket factory attriubtes ( XXX replace with normal setters ) protected Hashtable attributes = new Hashtable(); protected String socketFactoryName=null; +protected String sslImplementationName=null; protected boolean secure=false; public PoolTcpConnector() { @@ -187,33 +189,39 @@ */ private void checkSocketFactory() throws TomcatException { if(secure) { - if(socketFactoryName == null) - socketFactoryName = SSL_FACT; - /* backwards compatibility */ - if(SSL_FACT.equals(socketFactoryName)) { - try { - Class
cvs commit: jakarta-tomcat build.xml
billbarker01/12/06 20:42:23 Modified:.build.xml Log: Changes to reflect new PureTLS support. Submitted by: Eric Rescorla [EMAIL PROTECTED] Revision ChangesPath 1.161 +13 -13jakarta-tomcat/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat/build.xml,v retrieving revision 1.160 retrieving revision 1.161 diff -u -r1.160 -r1.161 --- build.xml 2001/10/10 18:45:32 1.160 +++ build.xml 2001/12/07 04:42:23 1.161 @@ -65,6 +65,8 @@ classname=javax.net.ssl.SSLServerSocket/ available property=jsse.present file=${jsse.lib}/jsse.jar/ +available property=puretls.present +classname=COM.claymoresystems.ptls.SSLContext/ available property=commons-dbcp.present file=${jakarta-commons}/dbcp/dist/commons-dbcp.jar / available property=jdk12.present @@ -86,12 +88,15 @@ target name=msg.jsse if=jsse.present echo message=Detected JSSE/ /target + target name=msg.puretls if=puretls.present +echo message=Detected PureTLS/ + /target target name=msg.commons-dbcp if=commons-dbcp.present echo message=Detected commons-DBCP/ /target - target name=init depends=detect,msg.jdk12,msg.jsse,msg.commons-dbcp + target name=init depends=detect,msg.jdk12,msg.jsse,msg.puretls,msg.commons-dbcp /target target name=prepare.jaxp101 depends=detect if=jaxp10-present @@ -210,14 +215,12 @@ pathelement location=${jsse.lib}/jcert.jar/ /classpath include name=org/apache/tomcat/util/**/ - exclude name=**/util/net/SSLSocketFactory.java - unless=jsse.present/ - exclude name=**/util/net/SSLSocketFactory.java - unless=jdk12.present/ - exclude name=**/util/compat/JSSECertCompat.java - unless=jsse.present/ - exclude name=**/util/compat/JSSECertCompat.java - unless=jdk12.present/ + exclude name=**/util/net/JSSE* unless=jsse.present/ + exclude name=**/util/net/JSSE* unless=jdk12.present/ + exclude name=**/util/net/PureTLS* unless=puretls.present/ + exclude name=**/util/net/PureTLS* unless=jdk12.present/ + exclude name=**/util/compat/JSSECertCompat.java / + exclude name=**/util/compat/Jdk12Support.java unless=jdk12.present/ exclude name=**/util/depend/DependClassLoader12.java @@ -268,10 +271,7 @@ unless=jdk12.present/ exclude name=**/util/compat/Jdk12Support.java unless=jdk12.present/ - exclude name=**/util/compat/JSSECertCompat.java - unless=jsse.present/ - exclude name=**/util/compat/JSSECertCompat.java - unless=jdk12.present/ + exclude name=**/util/compat/JSSECertCompat.java / include name=org/apache/tomcat/util/IntrospectionUtils.java/ /javac jar jarfile=${tomcat.build}/lib/tomcat.jar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat/src/doc tomcat-ssl-howto.html
billbarker01/12/06 21:10:44 Modified:src/doc tomcat-ssl-howto.html Log: Update documentation for PureTLS support. Submitted by: Eric Rescorla [EMAIL PROTECTED] Revision ChangesPath 1.8 +138 -24 jakarta-tomcat/src/doc/tomcat-ssl-howto.html Index: tomcat-ssl-howto.html === RCS file: /home/cvs/jakarta-tomcat/src/doc/tomcat-ssl-howto.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- tomcat-ssl-howto.html 2001/10/02 16:35:52 1.7 +++ tomcat-ssl-howto.html 2001/12/07 05:10:44 1.8 @@ -56,6 +56,10 @@ tdChristopher Cainnbsp;nbsp;/td tdttlt;a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/agt;/tt/td /tr +tr + tdEric Rescorla/td + tdttlt;a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/agt;/tt/td +/tr /table br @@ -156,7 +160,7 @@ company a site is associated with, along with some basic contact information about the site's owner and/or administrator. p -This driver's license is cryptographically signed by its owner, and is +This driver's license is cryptographically signed by its issuer, and is therefore extremely difficult for anyone else to forge. For sites involved in e-commerce, or any other business transaction in which authentication of identity is important, a certificate is typically purchased from a well-known @@ -169,13 +173,31 @@ In many cases, however, authentication is not really a concern. An administrator may simply want to ensure that the data being transmitted and received by the server is private and cannot be snooped by anyone who may be -eavesdropping on the connection. Fortunately, Java provides a relatively -simple command-line tool, called codekeytool/code, which can easily create -a self-signed certificate. Self-signed certificates are simply user-generated -certificates which have not been officially registered with any well-known CA -and are therefore not really guaranteed to be authentic at all. The owner of -the certificate is essentially vouching for himself/herself. Again, this may -or may not even be important, depending on your needs. +eavesdropping on the connection. In such cases one is often tempted to +use a self-signed certificate--one which has been signed only by the +owner. Such a certificate obviously doesn't provide any guarantee of +who the certificate owner is; there's nothing stopping me from making myself a certificate claiming to be George W. Bush. +p +What's less obvious is that using such certificates weakens the +secrecy of your data as well. The attack works like this: when the +client attempts to connect to the server the attacker hijacks the +connection. He sends the client his own self-signed certificate which +has the same Bname/B as that in the server's self-signed certificate. +The attacker then connects to the real server himself. When the client +sends data to the server the attacker reads it and then sends it along +to the real server. This is called a Bman-in-the-middle/B attack. +p +The take-home message is that if you're worried about attackers who +can write data to the network (this is called an active attack) then +self-signed certificates won't protect you. If you're worried about +attackers who can only read data off the network (this is called +a passive attack) then self-signed certificates work fine. In general, +you EMshould/EM worry about active attack and so self-signed +certificates aren't that good. +p +Nevertheless, self-signed certificates are fantastically useful for testing +and they are easily created with Java's codekeytool/code program or +using OpenSSL. br hr h2 @@ -186,19 +208,21 @@ parsers (xerces amp; jaxp). Tomcat required a recent XML parser, such as Apache Group's A HREF=http://xml.apache.org/xerces-j/index.html;Xerces/A or Sun's A HREF=http://java.sun.com/xml/jaxp.html;JAXP/A. - -pAt build time (via Ant), Tomcat will check for some libs and will then -included more or less options. This is the case with SSL support. If you have -the JSSE jars in your CODECLASSPATH/CODE, Tomcat will be built with SSL -(SSLSocketFactory). Tomcat will use the JSSE jars (CODEjcert.jar/CODE, -CODEjsse.jar/CODE, CODEjnet.jar/CODE). This software EMcannot/EM -be included in Tomcat, due in large part to certain legal restrictions on the -distribution of cryptographic software. You'll have to go to the -a href=http://java.sun.com/products/jsse/;JSSE home page/a and download -from there the domestic (US/Canada) or global archive. You should then make -these jars available to Tomcat during the build process by following the -relevant build instructions for your version of Tomcat (see the build -instructions in your top-level Tomcat directory for details). +p +You now have two options for building
cvs commit: jakarta-tomcat/src/examples/WEB-INF/classes RequestInfoExample.java
billbarker01/12/06 21:15:10 Modified:src/examples/WEB-INF/classes RequestInfoExample.java Log: Update to include SSL Information Submitted by: Eric Rescorla [EMAIL PROTECTED] Revision ChangesPath 1.2 +14 -2 jakarta-tomcat/src/examples/WEB-INF/classes/RequestInfoExample.java Index: RequestInfoExample.java === RCS file: /home/cvs/jakarta-tomcat/src/examples/WEB-INF/classes/RequestInfoExample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RequestInfoExample.java 1999/10/09 00:19:59 1.1 +++ RequestInfoExample.java 2001/12/07 05:15:10 1.2 @@ -1,4 +1,4 @@ -/* $Id: RequestInfoExample.java,v 1.1 1999/10/09 00:19:59 duncan Exp $ +/* $Id: RequestInfoExample.java,v 1.2 2001/12/07 05:15:10 billbarker Exp $ * */ @@ -69,9 +69,21 @@ out.println(request.getPathInfo()); out.println(/td/trtrtd); out.println(rb.getString(requestinfo.label.remoteaddr)); +out.println(/tdtd); + out.println(request.getRemoteAddr()); + + String cipherSuite= + (String)request.getAttribute(javax.servlet.request.cipher_suite); + + if(cipherSuite!=null){ + out.println(/td/trtrtd); + out.println(SSLCipherSuite info); + out.println(/tdtd); + out.println(request.getAttribute(javax.servlet.request.cipher_suite)); + } out.println(/tdtd); out.println(request.getRemoteAddr()); -out.println(/table); +out.println(/td/tr/table); } public void doPost(HttpServletRequest request, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Submission: Portable SSL Support
Since no one else responded, I've gone ahead and checked in Eric's changes. I haven't actually tried to build against PureTLS, but I assume that Eric has. If I've missed anything in this commit, please let me know and I'll try and include it asap. - Original Message - From: Eric Rescorla [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Saturday, December 01, 2001 7:20 AM Subject: Re: Submission: Portable SSL Support [EMAIL PROTECTED] writes: What remains to be done is getting jk to reuse the same abstractions for ssl support - that would make the code cleaner. But it can wait a while, there are bigger changes going on there. That's what I figured. I took a look at that and it doesn't look very difficult so if someone just pings me when it's ready to be adapted :) -Ekr -- [Eric Rescorla [EMAIL PROTECTED]] http://www.rtfm.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Submission: Portable SSL Support
Bill Barker [EMAIL PROTECTED] writes: Since no one else responded, I've gone ahead and checked in Eric's changes. I haven't actually tried to build against PureTLS, but I assume that Eric has. I did, but I'll check it out myself and make sure that it works. You did check that it works in the absence of PureTLS, right? If I've missed anything in this commit, please let me know and I'll try and include it asap. I'll take a look. Big CVS imports like this are always hairy since it's so easy to miss a file :( -Ekr -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Submission: Portable SSL Support
It compiles with or without JSSE, and runs fine without an SSL connector. However, I haven't actually gotten around to doing the whole keystore thing here, so the (big) one thing I haven't tried (yet) is to run it with an JSSE-SSL connection. The other thing that would be nice is to be able to access the SessionId, (via request.getAttribute(javax.servlet.request.ssl_session)). There is already optional support to validate HttpSession access against this for SSL sessions in 3.3.x. Currently it is only supported if you are connecting via Apache, but stand-alone (at least for PureTLS) would also be a nice feature. - Original Message - From: Eric Rescorla [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 9:52 PM Subject: Re: Submission: Portable SSL Support Bill Barker [EMAIL PROTECTED] writes: Since no one else responded, I've gone ahead and checked in Eric's changes. I haven't actually tried to build against PureTLS, but I assume that Eric has. I did, but I'll check it out myself and make sure that it works. You did check that it works in the absence of PureTLS, right? If I've missed anything in this commit, please let me know and I'll try and include it asap. I'll take a look. Big CVS imports like this are always hairy since it's so easy to miss a file :( -Ekr -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Double check idiom broken - Tomcat uses it ?
I'm cross-posting since this started on the user list. In Tomcat 3.3, JspServlet is largely deprecated (even if not yet @deprecated). It is only still included in case some 3.2.x user really needs it for something. It is much more likely to be removed in a future release than fixed. That being said, we always welcome patches :). - Original Message - From: Bo Xu [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:50 AM Subject: Re: DO NOT REPLY [Bug 4138] - HttpProcessor threads have inconsistent ClassLoader state Dear TOMCAT developers, :-) I forward the following email to you :-) Bo Dec.06, 2001 * If you really want the developers to take a look at this, you should probably post it to the tomcat-dev list. It's iffy whether or not they will see it here. Thanks, --jeff - Original Message - From: java programmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 10:44 PM Subject: Double check idiom broken - Tomcat uses it ? Hi all: We all know that the lazy-double-check idiom doesn't apply to Java because of the Java Memory Model (JMM). That is to say, look at code such as: Example a) // Set by any other thread other than #1 volatile boolean stop = false; // Thread #1 runs this as long as // stop is false. Only T1 will call this // method, so not synchronized. hence // broken due to staleness of 'stop'. // synch for _visbility_ ALSO. void foo() { while (!stop ) { //... } } Example b): The lazy double check idiom public static Foo haha = null; public static getFoo() { if (foo == null ) { sychronized (Foo.class) { if (foo == null ) foo = new Foo(); } } return foo; } Both examples are *guaranteed* to be incorrect. Note, this is the case, *even* though I am using 'volatile' for the stop variable. For more on the JMM, consult Item #48 in Effective Java (Josh Bloch), look at Bill Pughs' page at: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html or check out Doug Lea's stuff. Well, here is the thing: Quite idly, and randomly, I was looking at: org.apache.jasper.servlet.JspServlet and I found: snip outDated = compiler.isOutDated(); if(!jsw.isInstantiated() || outDated ) { synchronized(jsw){ outDated = compiler.compile(); if(!jsw.isInstantiated() || outDated) { if( null ==ctxt.getServletClassName() ) { snip This is a complex use of double check type code and is really hard to analyse because references themselves and what they point to can have different levels of staleness (according to the JMM). So it's a turbo double idiom type usage, possibly incorrect. I just wanted to bring this to the attention of the development team and make sure that *someone* has really analysed this according to the JMM. (and any other code, similar to this). Best regards, [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]