You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2006/05/29 13:44:49 UTC

svn commit: r410078 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java

Author: antonio
Date: Mon May 29 04:44:49 2006
New Revision: 410078

URL: http://svn.apache.org/viewvc?rev=410078&view=rev
Log:
Fix COCOON-1625 redundant copying between container and form encoding. Thanks to Aleksander Bandelj (aleksander.bandelj@academa.si).

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java?rev=410078&r1=410077&r2=410078&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java Mon May 29 04:44:49 2006
@@ -390,7 +390,11 @@
 
     public String getParameter(String name) {
         String value = this.req.getParameter(name);
-        if (this.form_encoding == null || value == null) {
+        if (this.form_encoding == null || this.form_encoding == null || value == null) {
+            return value;
+        }
+        // Form and container encoding are equal, skip expensive value decoding
+        if (this.container_encoding.equals(this.form_encoding)) {
             return value;
         }
         return decode(value);



Re: svn commit: r410078 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java

Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler escribió:
> antonio@apache.org wrote
>   
>> Author: antonio
>> Date: Mon May 29 04:44:49 2006
>> New Revision: 410078
>>
>>     
>
>   
>> +        if (this.form_encoding == null || this.form_encoding == null || value == null) {
>>     
> I think you have to check "this.form_encoding" only once for null.
>   
Hi Carsten,

Thanks for pointing out the error. I already committed the fix.

Best Regards,

Antonio Gallardo


Re: svn commit: r410078 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java

Posted by Carsten Ziegeler <cz...@apache.org>.
antonio@apache.org wrote
> Author: antonio
> Date: Mon May 29 04:44:49 2006
> New Revision: 410078
> 

> +        if (this.form_encoding == null || this.form_encoding == null || value == null) {
I think you have to check "this.form_encoding" only once for null.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/