jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1839891 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
Date Sun, 02 Sep 2018 19:49:05 GMT
Author: pmouawad
Date: Sun Sep  2 19:49:05 2018
New Revision: 1839891

URL: http://svn.apache.org/viewvc?rev=1839891&view=rev
Log:
Avoid too much warn messages when a 3rd party cookie is sent by server.

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java?rev=1839891&r1=1839890&r2=1839891&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
Sun Sep  2 19:49:05 2018
@@ -132,7 +132,12 @@ public class HC4CookieHandler implements
             for (org.apache.http.cookie.Cookie cookie : cookies) {
                 try {
                     if (checkCookies) {
-                        cookieSpec.validate(cookie, cookieOrigin);
+                        try {
+                            cookieSpec.validate(cookie, cookieOrigin);
+                        } catch (MalformedCookieException e) { // This means the cookie was
wrong for the URL
+                            log.info("Not storing invalid cookie: <{}> for URL {} ({})",
+                                cookieHeader, url, e.getLocalizedMessage());
+                        }
                     }
                     Date expiryDate = cookie.getExpiryDate();
                     long exp = 0;
@@ -156,12 +161,9 @@ public class HC4CookieHandler implements
                     } else {
                         cookieManager.removeMatchingCookies(newCookie);
                         if (debugEnabled){
-                            log.info("Dropping expired Cookie: {}", newCookie.toString());
+                            log.info("Dropping expired Cookie: {}", newCookie);
                         }
                     }
-                } catch (MalformedCookieException e) { // This means the cookie was wrong
for the URL
-                log.warn("Not storing invalid cookie: <{}> for URL {} ({})",
-                        cookieHeader, url, e.getLocalizedMessage());
                 } catch (IllegalArgumentException e) {
                     log.warn(cookieHeader+e.getLocalizedMessage());
                 }
@@ -176,7 +178,7 @@ public class HC4CookieHandler implements
         
         boolean debugEnabled = log.isDebugEnabled();
         if (debugEnabled){
-            log.debug("Found {} cookies for {}", c.size(), url.toExternalForm());
+            log.debug("Found {} cookies for {}", c.size(), url);
         }
         if (c.isEmpty()) {
             return null;



Mime
View raw message