You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2013/06/30 00:05:49 UTC

[Bug 55161] New: Wasted work in SoapSampler.setPostHeaders

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

            Bug ID: 55161
           Summary: Wasted work in SoapSampler.setPostHeaders
           Product: JMeter
           Version: 2.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: nistor1@illinois.edu

Created attachment 30501
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30501&action=edit
patch

The problem appears in version 2.9 and in revision 1498029.  I
attached a two-line patch (patch.diff) that fixes it.

In method "SoapSampler.setPostHeaders", the loop over the
"HeaderManager mngr" keeps overriding "length" with
"Integer.parseInt(hd.getValue())".  Therefore, only the last written
value is visible out of the loop and all the other writes and
iterations are not necessary.  The patch iterates from the end of
"HeaderManager mngr" and breaks the first time when "length" is set.

The above fix (in patch.diff) is certainly correct (it's easy to see
through code inspection), but I think we can have an even shorter
patch (one line, in patchShort.diff): just break as soon as "length"
is set, without reversion the loop order.  patchShort.diff is correct
only if there can be only one "hd.getName()" equal to
"HTTPConstants.HEADER_CONTENT_LENGTH" (which I think it's the case),
or if it doesn't matter which attribute value "length" gets, as long
as the condition
HTTPConstants.HEADER_CONTENT_LENGTH.equalsIgnoreCase(hd.getName()) is
satisfied.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 55161] Useless processing in SoapSampler.setPostHeaders

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55161

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
            Summary|Wasted work in              |Useless processing in
                   |SoapSampler.setPostHeaders  |SoapSampler.setPostHeaders

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 55161] Wasted work in SoapSampler.setPostHeaders

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55161

Adrian Nistor <ni...@illinois.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
                 CC|                            |nistor1@illinois.edu

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 55161] Useless processing in SoapSampler.setPostHeaders

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55161

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 55161] Wasted work in SoapSampler.setPostHeaders

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55161

--- Comment #1 from Adrian Nistor <ni...@illinois.edu> ---
Created attachment 30502
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30502&action=edit
patchShort

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 55161] Useless processing in SoapSampler.setPostHeaders

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55161

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
                 OS|Linux                       |All

--- Comment #2 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Thanks for patch, applied.

Date: Sun Jun 30 13:00:30 2013
New Revision: 1498110

URL: http://svn.apache.org/r1498110
Log:
Bug 55161 - Useless processing in SoapSampler.setPostHeaders
Bugzilla Id: 55161

Modified:
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.