So, Shall I dispense with the UserAgent Request and run it through lower level code? >:-{ (Defeating the purpose of UserAgent) (Not a satisfactory solution)I have a LinkSys router at home--I think that's the same model. I'll check tonight to see if I get the same error.OR
Use the filename method and use a 'length of file (= length of response)' test before assuming that UserAgent error response is valid (i.e. rebuild the response->content from the collected file copy if response is not 'too short'? (A workable patch - maybe)
OR
Get LinkSys to check their disconnect logic? (Not likely)
Start debugging lower layers? (Well, that's the same as the first idea (Not a satisfactory solution - and no guarantee of success.
Guess I'll put in a response (in file) length test to validate UserAgent error - bleearghr ;)
Unless someone can help me with the lower level stuff.
Here are some things you could try:
Very much untested!!!!$ua = LWP::UserAgent->new(use_eval => 0); ... eval { $response = $ua->request($request); }; if ($@) { if ($@ =~ /Connection refused/) { # ignore error } else { # just like, ya know, die or something } } # I think $response will still be intact here.
In reply to Re: LWP::UserAgent destroys $response->content >:{
by Thelonius
in thread LWP::UserAgent destroys $response->content >:{
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |