[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    DO NOT REPLY [Bug 51932] New: Crash with multiple cache-control
From:       bugzilla () apache ! org
Date:       2011-09-30 21:02:22
Message-ID: bug-51932-55412 () https ! issues ! apache ! org/bugzilla/
[Download RAW message or body]

https://issues.apache.org/bugzilla/show_bug.cgi?id=51932

             Bug #: 51932
           Summary: Crash with multiple cache-control
           Product: JMeter
           Version: Nightly (Please specify date)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
        AssignedTo: notifications@jakarta.apache.org
        ReportedBy: ronald.chen@elasticpath.com
    Classification: Unclassified


When JMeter makes an http request and the reponse has a cache-control header,
it will crash when there are multiple directives.

For example JMeter will crash when trying to parse the header:
cache-control: public, max-age=86400, no-transform

The exception thrown with JMeter 2.5:
java.lang.NumberFormatException: For input string: "86400, no-transform"
    at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Long.parseLong(Long.java:419)
    at java.lang.Long.parseLong(Long.java:468)
    at
org.apache.jmeter.protocol.http.control.CacheManager.setCache(CacheManager.java:161)
    at
org.apache.jmeter.protocol.http.control.CacheManager.saveDetails(CacheManager.java:113)
    at
org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:589)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:1155)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1394)
    at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:244)
    at
org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:592)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1308)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1379)
    at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:244)
    at
org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:592)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:999)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:985)
    at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:381)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:274)
    at java.lang.Thread.run(Thread.java:662)

I checked trunk and code didn't change for the parsing of cache-control.

It is still in there as of svn rev 1166165
/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java

The code does not split on commas at all.  The existing code will work if
max-age happens to be the last cache directive, but as you can see in the repo
case it is not.

Multiple cache directives are part of the HTTP spec:
http://stackoverflow.com/questions/4762377/cache-control-headers-repeated-valid-or-not-nginx

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic