You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Kent Gibson <ke...@yahoo.com> on 2005/10/24 12:56:58 UTC

No Timeout, No Exception, Runs Forever

I spent a good deal of yesterday trying to read this
url:

http://www.bush-music.com/discover.php

Clearly this script is misbehaving, but httpclient
just runs for over, no exception, no timeout, nada.

I have mostly been using get methods, with
getResponseBodyAsStream and getResponeBody.

I am stumped, does anyone have any ideas?

I have tried with rc candidate 3 and 4

thanks,

kent


		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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


Re: disable the connection persistence

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2005-11-07 at 17:53 +0000, kunal ashar wrote:
> Hi
>  
> To disable the connection persistence can I override the releaseConnection() method and close the connection immediately?
>  

This is exactly what you should be doing

> For example
>  
>  public class MyHTTPConnectionManager extends SimpleHttpConnectionManager{
>  
>  public MyHTTPConnectionManager() {
>     super();
>      }
>   
>   public void releaseConnection(HttpConnection conn) {
>     super.releaseConnection(conn);
>     conn.close();
>   }
>  }
>  
> If I am not wrong, in case of SimpleHttpConnectionManager  we are not using any connection pool, if that is the case why persistence connection is used in case of SimpleHttpConnectionManager ? 
>  

Because connection persistence results in a noticeable performance
improvement and there are enough applications out there that are
intended to communicate with just one host or one host at a time. 

Oleg

> Thanks
> Ashar
> 
> 
> 		
> ---------------------------------
> Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 


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


disable the connection persistence

Posted by kunal ashar <ka...@yahoo.co.uk>.
Hi
 
To disable the connection persistence can I override the releaseConnection() method and close the connection immediately?
 
For example
 
 public class MyHTTPConnectionManager extends SimpleHttpConnectionManager{
 
 public MyHTTPConnectionManager() {
    super();
     }
  
  public void releaseConnection(HttpConnection conn) {
    super.releaseConnection(conn);
    conn.close();
  }
 }
 
If I am not wrong, in case of SimpleHttpConnectionManager  we are not using any connection pool, if that is the case why persistence connection is used in case of SimpleHttpConnectionManager ? 
 
Thanks
Ashar


		
---------------------------------
Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 

Re: No Timeout, No Exception, Runs Forever

Posted by Kent Gibson <ke...@yahoo.com>.
thanks! good idea, of course now it seems obvious.

--- Oleg Kalnichevski <ol...@apache.org> wrote:

> On Mon, 2005-10-24 at 03:56 -0700, Kent Gibson
> wrote:
> > I spent a good deal of yesterday trying to read
> this
> > url:
> > 
> > http://www.bush-music.com/discover.php
> > 
> > Clearly this script is misbehaving, but httpclient
> > just runs for over, no exception, no timeout,
> nada.
> > 
> > I have mostly been using get methods, with
> > getResponseBodyAsStream and getResponeBody.
> > 
> > I am stumped, does anyone have any ideas?
> >
> > I have tried with rc candidate 3 and 4
> > 
> > thanks,
> > 
> > kent
> > 
> 
> Kent,
> 
> The CGI script is simply hopelessly broken. It keeps
> on sending
> "fgets(): supplied argument is not a valid stream"
> warning.
> 
> [DEBUG] header - >> "GET /discover.php
> HTTP/1.1[\r][\n]"
> [DEBUG] header - >> "User-Agent: Jakarta
> Commons-HttpClient/3.0-rc4[\r][\n]"
> [DEBUG] header - >> "Host:
> www.bush-music.com[\r][\n]"
> [DEBUG] header - >> "[\r][\n]"
> [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
> [DEBUG] header - << "Date: Mon, 24 Oct 2005 17:43:06
> GMT[\r][\n]"
> [DEBUG] header - << "Server: Apache/1.3.33 (Unix)
> PHP/4.3.11[\r][\n]"
> [DEBUG] header - << "P3P: PHY ONL UNI PUR FIN COM
> NAV INT DEM CNT STA
> PRE CURa ADMa DEVa TAIo PSAo PSDo IVAa IVDa CONo
> TELo OTPi OUR UNRo PUBi
> OTRo IND DSP CAO COR[\r][\n]"
> [DEBUG] header - << "X-Powered-By:
> PHP/4.3.11[\r][\n]"
> [DEBUG] header - << "Transfer-Encoding:
> chunked[\r][\n]"
> [DEBUG] header - << "Content-Type:
> text/html[\r][\n]"
> ...
> [DEBUG] content - << "<br />[\n]"
> [DEBUG] content - << "<b>Warning</b>:  fgets():
> supplied argument is not
> a valid stream resource in
> <b>/content/www/bush-music.com"
> 
> Consider using HttpMethod#abort() to force terminate
> methods that fail
> to complete normally within a given time or content
> length threshold
> 
> Oleg
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> httpclient-dev-help@jakarta.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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


Re: No Timeout, No Exception, Runs Forever

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2005-10-24 at 03:56 -0700, Kent Gibson wrote:
> I spent a good deal of yesterday trying to read this
> url:
> 
> http://www.bush-music.com/discover.php
> 
> Clearly this script is misbehaving, but httpclient
> just runs for over, no exception, no timeout, nada.
> 
> I have mostly been using get methods, with
> getResponseBodyAsStream and getResponeBody.
> 
> I am stumped, does anyone have any ideas?
>
> I have tried with rc candidate 3 and 4
> 
> thanks,
> 
> kent
> 

Kent,

The CGI script is simply hopelessly broken. It keeps on sending
"fgets(): supplied argument is not a valid stream" warning.

[DEBUG] header - >> "GET /discover.php HTTP/1.1[\r][\n]"
[DEBUG] header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc4[\r][\n]"
[DEBUG] header - >> "Host: www.bush-music.com[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "Date: Mon, 24 Oct 2005 17:43:06 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache/1.3.33 (Unix) PHP/4.3.11[\r][\n]"
[DEBUG] header - << "P3P: PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA
PRE CURa ADMa DEVa TAIo PSAo PSDo IVAa IVDa CONo TELo OTPi OUR UNRo PUBi
OTRo IND DSP CAO COR[\r][\n]"
[DEBUG] header - << "X-Powered-By: PHP/4.3.11[\r][\n]"
[DEBUG] header - << "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] header - << "Content-Type: text/html[\r][\n]"
...
[DEBUG] content - << "<br />[\n]"
[DEBUG] content - << "<b>Warning</b>:  fgets(): supplied argument is not
a valid stream resource in <b>/content/www/bush-music.com"

Consider using HttpMethod#abort() to force terminate methods that fail
to complete normally within a given time or content length threshold

Oleg



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