1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 22:19:38 +00:00

update: do not write controlfile on error

HttpUtils: default noshutdown is changed  1 (due to squid) / shutdown option added


git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5569 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-04-19 16:51:44 +00:00
parent 16767508f4
commit 9bcd5dbb27
2 changed files with 5 additions and 2 deletions

View File

@ -451,6 +451,7 @@ update_DoUpdate(@)
my $getUpdates; my $getUpdates;
($fail,$getUpdates) = update_GetRemoteFiles($BRANCH,$url,$updateFiles_ref,$cl); ($fail,$getUpdates) = update_GetRemoteFiles($BRANCH,$url,$updateFiles_ref,$cl);
$ret .= $getUpdates if($getUpdates); $ret .= $getUpdates if($getUpdates);
return $ret if($fail);
foreach my $pack (@packages) { foreach my $pack (@packages) {
# write local controlfile # write local controlfile

View File

@ -200,7 +200,8 @@ HttpUtils_Connect2($)
$hdr .= "\r\n"; $hdr .= "\r\n";
syswrite $hash->{conn}, $hdr; syswrite $hash->{conn}, $hdr;
syswrite $hash->{conn}, $data if(defined($data)); syswrite $hash->{conn}, $data if(defined($data));
shutdown $hash->{conn}, 1 if(!$hash->{noshutdown} && $hash->{protocol} ne "https"); shutdown $hash->{conn}, 1 if($hash->{shutdown} ||
(defined($hash->{noshutdown}) && $hash->{noshutdown} == 0));
if($hash->{callback}) { # Nonblocking read if($hash->{callback}) { # Nonblocking read
$hash->{FD} = $hash->{conn}->fileno(); $hash->{FD} = $hash->{conn}->fileno();
@ -299,7 +300,8 @@ HttpUtils_ParseAnswer($$)
# mandatory: # mandatory:
# url, callback # url, callback
# optional(default): # optional(default):
# hideurl(0),timeout(4),data(""),noshutdown(0),loglevel(4),header(""), # hideurl(0),timeout(4),data(""),loglevel(4),header(""),
# noshutdown(1),shutdown(0),
# method($data ? "POST" : "GET") # method($data ? "POST" : "GET")
# Example: # Example:
# HttpUtils_NonblockingGet({ # HttpUtils_NonblockingGet({