On Wed, 2008-01-16 at 10:55 +0100, Robert Svoboda wrote:
> * Oleg Kalnichevski <[EMAIL PROTECTED]> [2008-01-15 22:25]:
> >
> > On Tue, 2008-01-15 at 14:48 +0100, Robert Svoboda wrote:
> 
> [...]
> 
> > Robert, could you please try to reproduce the problem with a small
> > (preferably self-contained) test case and run it with the context/wire
> > logging on?
> 
> Log file here: http://onyon.net/tmp/r080/log.tar.bz2 [40+kb]
> 
> I didn't write self-contained test but if this log is not
> enough I'll do it.
> 
> Robert
> 

Robert,

I am unable to reproduce the problem locally. The code snippet below
seems to work just fine. I still do not quite understand why the
connection object is in the CLOSED state at the invocation of the
#releaseConnection() method. It should not be.

Anyways, I checked in the patch causing the
HttpConnection#isResponseAvailable(int) to return false if the
connection is closed instead of throwing java.lang.IllegalStateException

Hope this helps

Oleg

==============

HttpClient client = new HttpClient();
client.getParams().setParameter(HttpClientParams.USER_AGENT, 
        "Mozilla/5.0 (X11; compatible; newstin.com; HTTPClient 3.1)");
client.getParams().setBooleanParameter(
        HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true);

GetMethod httpget = 
 new GetMethod("http://www.azcentral.com/rsslinks/458818";);

try {
    client.executeMethod(httpget);
    String s = httpget.getResponseBodyAsString();
    System.out.println("content len: " + s.length());
} finally {
    httpget.releaseConnection();
}


==============
[DEBUG] header - >> "GET /rsslinks/458818 HTTP/1.1[\r][\n]"
[DEBUG] header - >> "User-Agent: Mozilla/5.0 (X11; compatible;
newstin.com; HTTPClient 3.1)[\r][\n]"
[DEBUG] header - >> "Host: www.azcentral.com[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 302 Found[\r][\n]"
[DEBUG] header - << "HTTP/1.1 302 Found[\r][\n]"
[DEBUG] header - << "Date: Wed, 16 Jan 2008 11:27:01 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache[\r][\n]"
[DEBUG] header - << "X-Powered-By: PHP/5.2.3[\r][\n]"
[DEBUG] header - << "Location:
http://www.azcentral.com/sports/cheapseats/articles/0116p2main0116.html[\r][\n]";
[DEBUG] header - << "Vary: Accept-Encoding,User-Agent[\r][\n]"
[DEBUG] header - << "P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND
DEM", policyref="/w3c/p3p.xml"[\r][\n]"
[DEBUG] header - << "Content-Length: 0[\r][\n]"
[DEBUG] header - << "Content-Type: text/html;
charset=iso-8859-1[\r][\n]"
[DEBUG] header - << "[\r][\n]"
[DEBUG] header - >> "GET /sports/cheapseats/articles/0116p2main0116.html
HTTP/1.1[\r][\n]"
[DEBUG] header - >> "User-Agent: Mozilla/5.0 (X11; compatible;
newstin.com; HTTPClient 3.1)[\r][\n]"
[DEBUG] header - >> "Host: www.azcentral.com[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 302 Found[\r][\n]"
[DEBUG] header - << "HTTP/1.1 302 Found[\r][\n]"
[DEBUG] header - << "Date: Wed, 16 Jan 2008 11:27:01 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache[\r][\n]"
[DEBUG] header - << "Vary: Accept-Encoding,User-Agent[\r][\n]"
[DEBUG] header - << "X-Powered-By: PHP/5.2.3[\r][\n]"
[DEBUG] header - <<
"Location: /sports/cheapseats/articles/0116p2main0116.html?&wired[\r][\n]"
[DEBUG] header - << "P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND
DEM", policyref="/w3c/p3p.xml"[\r][\n]"
[DEBUG] header - << "Content-Length: 0[\r][\n]"
[DEBUG] header - << "Content-Type: text/html;
charset=iso-8859-1[\r][\n]"
[DEBUG] header - << "[\r][\n]"
[DEBUG] header - >>
"GET /sports/cheapseats/articles/0116p2main0116.html?&wired
HTTP/1.1[\r][\n]"
[DEBUG] header - >> "User-Agent: Mozilla/5.0 (X11; compatible;
newstin.com; HTTPClient 3.1)[\r][\n]"
[DEBUG] header - >> "Host: www.azcentral.com[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "Date: Wed, 16 Jan 2008 11:27:02 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache[\r][\n]"
[DEBUG] header - << "Accept-Ranges: bytes[\r][\n]"
[DEBUG] header - << "Vary: Accept-Encoding,User-Agent[\r][\n]"
[DEBUG] header - << "P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND
DEM", policyref="/w3c/p3p.xml"[\r][\n]"
[DEBUG] header - << "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] header - << "Content-Type: text/html;
charset=iso-8859-1[\r][\n]"
[DEBUG] header - << "[\r][\n]"
[WARN] HttpMethodBase - Going to buffer response body of large or
unknown size. Using getResponseBodyAsStream instead is recommended.
[DEBUG] header - << "[\r][\n]"
content len: 53588
==============



> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to