ASF Bugzilla – Attachment 20013 Details for
Bug 39808
Invalid redirect causes incorrect sample time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Suggested patch
patch_for_39808.patch (text/plain), 1.71 KB, created by
Alf Hogemark
on 2007-04-22 09:27:08 UTC
(
hide
)
Description:
Suggested patch
Filename:
MIME Type:
Creator:
Alf Hogemark
Created:
2007-04-22 09:27:08 UTC
Size:
1.71 KB
patch
obsolete
>Index: C:/Documents and Settings/alf/workspace/Jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java >=================================================================== >--- C:/Documents and Settings/alf/workspace/Jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (revision 531193) >+++ C:/Documents and Settings/alf/workspace/Jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (working copy) >@@ -1051,22 +1051,30 @@ > > int redirect; > for (redirect = 0; redirect < MAX_REDIRECTS; redirect++) { >- String location = encodeSpaces(lastRes.getRedirectLocation()); >+ boolean invalidRedirectUrl = false; > // Browsers seem to tolerate Location headers with spaces, > // replacing them automatically with %20. We want to emulate > // this behaviour. >+ String location = encodeSpaces(lastRes.getRedirectLocation()); > try { > lastRes = sample(new URL(lastRes.getURL(), location), GET, true, frameDepth); > } catch (MalformedURLException e) { > lastRes = errorResult(e, lastRes); >+ // The redirect URL we got was not a valid URL >+ invalidRedirectUrl = true; > } > if (lastRes.getSubResults() != null && lastRes.getSubResults().length > 0) { > SampleResult[] subs = lastRes.getSubResults(); > for (int i = 0; i < subs.length; i++) { > totalRes.addSubResult(subs[i]); > } >- } else >- totalRes.addSubResult(lastRes); >+ } else { >+ // Only add sample if it is a sample of valid url redirect, i.e. that >+ // we have actually sampled the URL >+ if(!invalidRedirectUrl) { >+ totalRes.addSubResult(lastRes); >+ } >+ } > > if (!lastRes.isRedirect()) { > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39808
:
18469
|
18470
|
18471
| 20013