jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ham1 <...@git.apache.org>
Subject [GitHub] jmeter pull request #320: HTTPClient 4.5. migration to last APIs / Bugzilla ...
Date Tue, 14 Nov 2017 17:42:20 GMT
Github user ham1 commented on a diff in the pull request:

    https://github.com/apache/jmeter/pull/320#discussion_r150905177
  
    --- Diff: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java ---
    @@ -215,22 +269,128 @@ public long getKeepAliveDuration(HttpResponse response, HttpContext
context) {
             
         };
     
    -    /**
    -     * Special interceptor made to keep metrics when connection is released for some
method like HEAD
    -     * Otherwise calling directly ((HttpConnection) localContext.getAttribute(HttpCoreContext.HTTP_CONNECTION)).getMetrics();
    -     * would throw org.apache.http.impl.conn.ConnectionShutdownException
    -     * See <a href="https://bz.apache.org/jira/browse/HTTPCLIENT-1081">HTTPCLIENT-1081</a>
    -     */
    -    private static final HttpResponseInterceptor METRICS_SAVER = (HttpResponse response,
HttpContext context) -> {
    -        HttpConnectionMetrics metrics = ((HttpConnection) context.getAttribute(HttpCoreContext.HTTP_CONNECTION)).getMetrics();
    -        context.setAttribute(CONTEXT_METRICS, metrics);
    -    };
    -    private static final HttpRequestInterceptor METRICS_RESETTER = (HttpRequest request,
HttpContext context) -> {
    -        HttpConnectionMetrics metrics = ((HttpConnection) context.getAttribute(HttpCoreContext.HTTP_CONNECTION)).getMetrics();
    -        metrics.reset();
    +    private static final String DIGEST_PARAMETERS = DigestParameters.VARIABLE_NAME;
    +
    +    
    +    private static final HttpRequestInterceptor PREEMPTIVE_AUTH_INTERCEPTOR = new HttpRequestInterceptor()
{
    --- End diff --
    
    This is almost 100 lines and with lots of nesting becomes very hard to read and review,
could it be split into smaller methods?


---

Mime
View raw message