Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LWP::UserAgent 500 read timeout

Status
Not open for further replies.

tanderso

IS-IT--Management
Aug 9, 2000
981
US
I'm having a strange problem with LWP::UserAgent wherein one particular URL continually gives me a 500 read timeout error.

Client: -- MS IIS/5.0 on Win2k
Server: -- MS IIS/5.0 on Win2k

Link to script:

My LWP timeout is currently set to 10 seconds, but it gives me the same thing no matter how long I set it. LWP always times out without receiving a single bit from this URL.

The URL ( works just fine in my web browser, but LWP consistently times out. Furthermore, LWP
works perfectly in this script for all other URLs I've tested, and it used to work for this domain as well but stopped working for some reason at some unknown time for some unknown reason.

Other URLs where it works:
- --
Other URLs where it doesn't work: the entire 208.31.25.3 domain. Go to and pull down the "news/sports" menu to link to them.

Any insights you can give would be greatly appreciated.

Thanks in advance.

Tom
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Hmm...that's a real mess. LWP::UserAgent is really picky it seems. LWP::Simple is not, however. If I'm seeing this right, you really don't even need UserAgent. Just as a test, I'd do a small script something like this:


Code:
use LWP::Simple;

$page_content=get('[URL unfurl="true"]http://208.31.25.3/default.asp?c=wutb&page=nfl/teams/065.htm');[/URL]

If that actually works, great. I have no explanation for why simple does and useragent does not. I'm running into a similar dillema with one of my scripts trying to use cookies. I'd be interested to hear your results though.

Numbski
 
Yes, LWP::Simple does work for this URL. However, I need to be able to capture the response type, headers, and error messages, so I need LWP::UserAgent to work. I still don't know why it doesn't.

Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
I've made slight progress... I've determined that it is timing out because of the headers that are being sent. If I suppress the headers, the page works fine. I will try removing one item at a time from the headers using regexps to see what is causing it.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
It seems that that particular host times out given anything in $request->headers. Other hosts handle it just fine.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top