aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-10-24 22:20:06 -0400
committerB. Watson <yalhcru@gmail.com>2015-10-24 22:20:06 -0400
commita7433275554adb3dd2311c07b5881157fd17457b (patch)
treea480c7fe5150dd56d1a47663c633776a4780b887
parent470d963f883266ceb3f28fbb674c6dd4950d381a (diff)
downloadsbostuff-a7433275554adb3dd2311c07b5881157fd17457b.tar.gz
add missing 'close $fh', don't print $httpstatusline if there isn't one
-rwxr-xr-xsbosrcarch5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbosrcarch b/sbosrcarch
index 777f2c3..c246673 100755
--- a/sbosrcarch
+++ b/sbosrcarch
@@ -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;