CC: | gbarr [...] pobox.com |
Subject: | Graceful Net::FTP error handling |
Date: | Wed, 20 Dec 2006 21:33:27 +0100 |
To: | bug-libnet [...] rt.cpan.org |
From: | Juergen Weigert <jw [...] suse.de> |
Hi Graham and friends!
This patch avoids several silly warnings, and fills $res->status_line with something useful
in case your FTP server babbles some text message without a leading response code.
Seen from ftp.opensuse.org:
connect(3, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("195.135.221.134")}, 16) = 0
read(3, "This server is busy, please try again later or any of my mirrors: http://download.opensuse.org\n\n", 1024) = 96
Note the missing "500 " before "This".
Command line ftp clients like wget or lftp handle this gracefully, so should we.
See attached patch for perl-5.8.8 tar ball (identical for libnet-1.19)
thanks,
Jw.
--
o \ Juergen Weigert paint it green! __/ _=======.=======_
<V> | jw@suse.de wide open suse_/ _---|____________\/
\ | 0911 74053-508 (tm)__/ (____/ /\
(/) | __________________________/ _/ \_ vim:set sw=2 wm=8
Message body is not shown because sender requested not to inline it.