Re: [Patch] Coyote losing parameters across form login (was Re: Connectorissues)
Jeff Tulley wrote: Which? All of them? I had 3 attachments with the extension .patch (I could rename to .txt, though .patch has worked in the past I thought). And, 1 zip file that I renamed to test.zip.txt Please let me know which if any were visible, and the best way to send a zip file. The .zip is not valid, and the 3 other attachements are not there. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] Coyote losing parameters across form login (was Re: Connectorissues)
Jeff Tulley wrote: One more try, all files as .txt What is the best way to send a .zip file? Actually, I've attached the file that was in the zip as AddParametersTest.java It should go in j-t-c/util/test/org/apache/tomcat/util/http Nothing from /test down currently exists in the util dir. It looks like my previous submissions on this list also did not show up. I should have checked more carefully. I've also attached my patch for the minor type in SoTask.java Sorry for the mess. Ok, well, I get a chance to review the patch. I don't like it, as it forces some hacks needed for FORM auth (which, FYI, I've always considered to be a bad hack) down the path to the cleaner Coyote objects. I think the patch will need some rework to avoid polluting the API (ie, the dirty code needs to stay in the facade - aka, CoyoteRequest). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] Coyote losing parameters across form login (was Re: Connectorissues)
Jeff Tulley wrote: One more try, all files as .txt What is the best way to send a .zip file? Actually, I've attached the file that was in the zip as AddParametersTest.java It should go in j-t-c/util/test/org/apache/tomcat/util/http Nothing from /test down currently exists in the util dir. It looks like my previous submissions on this list also did not show up. I should have checked more carefully. I've also attached my patch for the minor type in SoTask.java Sorry for the mess. Upon more examination, it seems there's not much choice (unfortunately), and I'll have to agree on most of the patch. Index: Request.java === RCS file: /home/cvspublic/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v retrieving revision 1.15 diff -u -r1.15 Request.java --- Request.java 19 Sep 2002 06:39:43 - 1.15 +++ Request.java 3 Apr 2003 17:28:56 - @@ -385,6 +385,9 @@ public Parameters getParameters() { return parameters; } + public void addParameter(String name, String[] values) { + parameters.addParameterValues(name, values); + } // Other attributes This is not needed. getParamters().addParameterValues(name, values); will be used instead (there's no getParamter instead). Index: Parameters.java === RCS file: /home/cvspublic/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/Parameters.java,v retrieving revision 1.8 diff -u -r1.8 Parameters.java --- Parameters.java 29 Jun 2002 02:15:02 - 1.8 +++ Parameters.java 3 Apr 2003 17:30:39 - @@ -336,6 +336,26 @@ paramHashStringArray.put(key, values); } + public void addParameterValues( String key, String[] newValues) { + if( key==null ) return; + String values[]; + if (paramHashStringArray.containsKey(key)) { + String oldValues[] = (String[])paramHashStringArray. + get(key); + values = new String[oldValues.length + newValues.length]; + for (int i = 0; i oldValues.length; i++) { +values[i] = oldValues[i]; + } + for (int i = 0; i newValues.length; i++) { +values[i+ oldValues.length] = newValues[i]; + } + } else { + values = newValues; + } + + paramHashStringArray.put(key, values); + } + public void setURLDecoder( UDecoder u ) { urlDec=u; } Index: CoyoteRequest.java === RCS file: /home/cvspublic/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v retrieving revision 1.28 diff -u -r1.28 CoyoteRequest.java --- CoyoteRequest.java 24 Nov 2002 11:56:15 - 1.28 +++ CoyoteRequest.java 3 Apr 2003 17:28:09 - @@ -1262,7 +1262,7 @@ * @param values Corresponding values for this request parameter */ public void addParameter(String name, String values[]) { -// Not used +coyoteRequest.addParameter(name, values); } I'll apply the patch. Thanks. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] Coyote losing parameters across form login(was Re: Connectorissues)
I wondered about that. But, it seemed that CoyoteRequest used the same method throughout the code - for instance on getParameter(String name), it already does a call to coyoteRequest.getParameters().getParameter(name), so I figured I should do the same. the variable coyoteRequest here is a o.a.coyote.Request This same method is also used with getProtocol, get and set ServerName, ServerPort, and with getAttributes. How then do you propose changing this? Other methods in CoyoteRequest keep such things local, but that is difficult with the parameters, since they would presumably exist in the original passed-in Request object. Oh, I see your other email. Yeah, you are seeing the same thing as me. There was a bit of a code smell rewriting that private method in Parameters.java, but it appeared to be the only choice with the way the current code is written. Jeff Tulley ([EMAIL PROTECTED]) (801)861-5322 Novell, Inc., The Leading Provider of Net Business Solutions http://www.novell.com [EMAIL PROTECTED] 4/4/03 12:42:41 PM Jeff Tulley wrote: One more try, all files as .txt What is the best way to send a .zip file? Actually, I've attached the file that was in the zip as AddParametersTest.java It should go in j-t-c/util/test/org/apache/tomcat/util/http Nothing from /test down currently exists in the util dir. It looks like my previous submissions on this list also did not show up. I should have checked more carefully. I've also attached my patch for the minor type in SoTask.java Sorry for the mess. Ok, well, I get a chance to review the patch. I don't like it, as it forces some hacks needed for FORM auth (which, FYI, I've always considered to be a bad hack) down the path to the cleaner Coyote objects. I think the patch will need some rework to avoid polluting the API (ie, the dirty code needs to stay in the facade - aka, CoyoteRequest). Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]