hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wright (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1510) Expect/continue not working for HttpRequest objects that are implemented with an HttpRequestWrapper
Date Thu, 22 May 2014 15:11:02 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005993#comment-14005993
] 

Karl Wright commented on HTTPCLIENT-1510:
-----------------------------------------

Research shows the following odd behavior.  (It's somewhat confusing because multiple threads
are active, so bear with me here...)

(1) The HttpRequestWrapper is indeed only applied on GET requests.  This was interleaved with
POST requests in the log, which was misleading me.
(2) For POST requests, the problem is different: RequestExpectContinue.java checks config.isExpectContinue()
and finds it to be *false*.  It's not clear why that, since the RequestConfig builder definitely
specifies expect/continue to be on:

{code}
    RequestConfig.Builder requestBuilder = RequestConfig.custom()
      .setCircularRedirectsAllowed(true)
      .setSocketTimeout(socketTimeout)
      .setStaleConnectionCheckEnabled(true)
      .setExpectContinueEnabled(true)
      .setConnectTimeout(connectionTimeout)
      .setConnectionRequestTimeout(socketTimeout);
{code}

Something is clearly flipping this flag; trying to determine what that might be now.

I'll close this ticket, though, since the description is not germane.

> Expect/continue not working for HttpRequest objects that are implemented with an HttpRequestWrapper
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1510
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1510
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.3
>            Reporter: Karl Wright
>
> Certain sorts of requests (multipart post being one of them) use HttpRequestWrapper internally
to wrap the original request.  But the Expect/Continue processor has this check in it:
> {code}
>             if (request instanceof HttpEntityEnclosingRequest) {
> {code}
> That effectively disables expect/continue for all wrapped requests, since HttpRequestWrapper
is not derived from HttpEntityEnclosingRequest.
> Suggestion: A better way to structure this would be to have a method in HttpRequest that
the expect/continue processor would call, instead of doing an explicit instanceof class check.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message