diff options
author | B. Watson <yalhcru@gmail.com> | 2015-10-24 22:20:06 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2015-10-24 22:20:06 -0400 |
commit | a7433275554adb3dd2311c07b5881157fd17457b (patch) | |
tree | a480c7fe5150dd56d1a47663c633776a4780b887 | |
parent | 470d963f883266ceb3f28fbb674c6dd4950d381a (diff) | |
download | sbostuff-a7433275554adb3dd2311c07b5881157fd17457b.tar.gz |
add missing 'close $fh', don't print $httpstatusline if there isn't one
-rwxr-xr-x | sbosrcarch | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -612,6 +612,7 @@ sub curl_download_http { while(<$fh>) { print "! $_"; } + close $fh; return undef; # connection refused, DNS lookup failed, etc } @@ -650,6 +651,7 @@ sub curl_download_http { while(<$fh>) { print " ! $_"; } + close $fh; } open $fh, "<$outfile.hdr"; @@ -658,11 +660,12 @@ sub curl_download_http { next unless /^HTTP\/\S+\s+(\d+)/; $httpstatusline = $_, $httpstatus = $1; } + close $fh; unlink($outfile); unlink("$outfile.hdr"); - if($httpstatus ne "200") { + if(defined $httpstatus && ($httpstatus ne "200")) { print "! $httpstatusline\n"; unlink $filename; return undef; |