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

List:       httpclient-commons-dev
Subject:    [jira] Commented: (HTTPCLIENT-796) IOException when server closes
From:       "Ming Fai (JIRA)" <jira () apache ! org>
Date:       2008-09-27 7:35:44
Message-ID: 1455849799.1222500944289.JavaMail.jira () brutus
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/HTTPCLIENT-796?page=com.atlassian.jira.plu \
gin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635113#action_12635113 \
] 

Ming Fai commented on HTTPCLIENT-796:
-------------------------------------

I've encountered the same problem with core 4.0beta1. Looks like IIS sends out \
incorrect chunk header.

by 
 - disabling the TestChunkCoding.testCorruptChunkedInputStreamNoClosingChunk, and
 - at ChunkedInputStream, changing from
{code}
        if (i == -1) {
            throw new MalformedChunkCodingException(
                    "Chunked stream ended unexpectedly");
        }
{code}
to
{code}
        if (i < 0) {
            return 0;
        }
{code}

I'm able to get rid of the exception and able to download a malformed chunked \
response. I could provide a patch if you want. I suppose httpclient should handle \
malformed chunked response, but i'm not sure if it should be configurable like the \
original patch.

> IOException when server closes connection at end of chunk
> ---------------------------------------------------------
> 
> Key: HTTPCLIENT-796
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-796
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 3.1.1
> Reporter: Charles Honton
> Attachments: c.patch
> 
> 
> My program sending a POST to a server which responds with a chunked response.  \
> Instead of a final 0 length chunk, the server closes the connection.  The following \
> is a redacted log:
> > > POST /Activity/ActivityFile.aspx HTTP/1.1[\r][\n]"
> > > Referer: https://ranking.ase.com/Activity/ActivityForm.aspx?AI=127910002[\r][\n]
> > >                 
> > > User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)[\r][\n]
> > > Host: ranking.ase.com[\r][\n]
> > > Cookie: Session=EBFJLZR1D17M12RBX3V; auth-user-info=st75|204402|224243[\r][\n]
> > > Content-Length: 55[\r][\n]
> > > Content-Type: application/x-www-form-urlencoded[\r][\n]
> > > [\r][\n]
> > > __EVENTTARGET=&__EVENTARGUMENT=&UserAccount=27910002
> << HTTP/1.1 200 OK[\r][\n]
> << Date: Wed, 10 Sep 2008 16:44:09 GMT[\r][\n]
> << Server: Microsoft-IIS/6.0[\r][\n]
> << X-Powered-By: ASP.NET[\r][\n]
> << X-AspNet-Version: 2.0.50727[\r][\n]
> << content-disposition: inline; filename=JPMC.SFX[\r][\n]
> << Transfer-Encoding: chunked[\r][\n]
> << Cache-Control: private[\r][\n]
> << Content-Type: application/vnd.inu.SFX; charset=utf-8[\r][\n]
> << [\r][\n]
> << 1a[\r][\n]
> << [\r][\n]
> The response data[\r][\n]
> << [\r][\n]
> java.io.IOException: chunked stream ended unexpectedly
> org.apache.commons.httpclient.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:252)
>  org.apache.commons.httpclient.ChunkedInputStream.nextChunk(ChunkedInputStream.java:221)
>  org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:176)
> java.io.FilterInputStream.read(Unknown Source)
> org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
>  org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:740)
>  org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString(HttpMethodBase.java:838)
>  com.cc.wb.WebBrowser.redirectFetch(WebBrowser.java:184)
> com.cc.wb.WebBrowser.fetch(WebBrowser.java:235)
> com.cc.wb.WebBrowser.postURL(WebBrowser.java:290)
> com.cc.wb.Tester.main(Tester.java:41)
> The server's behavior is probably not consistent with RFC2616, but it would be nice \
> if http-client could handle this without an IOException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


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

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