Peter Bryant created HTTPCLIENT-1711:
----------------------------------------

             Summary: defaulthttpresponseparser parseHead fails to return on 
live stream
                 Key: HTTPCLIENT-1711
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1711
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.5.1
            Reporter: Peter Bryant


Calling getResponseCode() on a non-HTTP 1.1 live stream response (e.g.  
http://54.216.181.141:80/episode_7192278) can result in the method not 
returning.  Instead it just reads the stream 

# telnet 54.216.181.141 80
GET /episode_7192278 HTTP/1.1

ICY 200 OK
Connection: Close
Content-Type: audio/mpeg
icy-notice1: Spreaker
icy-notice2: Create your own radio at www.spreaker.com
icy-genre: 
icy-pub: 1
icy-br: 128
Pragma: pipeline-result=0

?-Ş8)ሀA??b?;????????????\?r?? 
P3X>??????!XZ??@|????|x>???h=??????n7?]@?S/?2??(C7??
etc
etc
etc


Suggest that DefaultHttpResponseParser implement its reject method a little 
less leniently.  e.g. 

                    protected boolean reject(final CharArrayBuffer line, final 
int count) {
                        if(line.isEmpty() && count>0) {
                            return true;
                        }
                        if(count>100) {
                            return true;
                        }
                        return false;
                    }




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to