304 |
|
|
305 |
|
print $sock "HEARTBEAT\n"; |
306 |
|
$response = <$sock>; |
307 |
< |
chop $response or return; |
307 |
> |
return if (!defined $response); |
308 |
> |
chop $response; |
309 |
|
if (!$response eq "OK") { |
310 |
|
close($sock); |
311 |
|
print "Server gave wrong response to HEARTBEAT: $response\n"; |
314 |
|
|
315 |
|
print $sock "CONFIG\n"; |
316 |
|
$response = <$sock>; |
317 |
< |
chop $response or return; |
317 |
> |
return if (!defined $response); |
318 |
> |
chop $response; |
319 |
|
if (!$response eq "OK") { |
320 |
|
close($sock); |
321 |
|
print "Server gave wrong response to CONFIG: $response\n"; |
324 |
|
|
325 |
|
print $sock "$file_list\n"; |
326 |
|
$response = <$sock>; |
327 |
< |
chop $response or return; |
327 |
> |
return if (!defined $response); |
328 |
> |
chop $response; |
329 |
|
if (!$response eq "OK") { |
330 |
|
close($sock); |
331 |
|
print "Server gave wrong response to file list: $response\n"; |
334 |
|
|
335 |
|
print $sock "$last_modified\n"; |
336 |
|
$response = <$sock>; |
337 |
< |
chop $response or return; |
337 |
> |
return if (!defined $response); |
338 |
> |
chop $response; |
339 |
|
if ($response eq "ERROR") { |
340 |
|
close($sock); |
341 |
|
&tcp_configure(); |
348 |
|
} |
349 |
|
|
350 |
|
print $sock "ENDHEARTBEAT\n"; |
351 |
< |
$response = <$sock> or return; |
351 |
> |
$response = <$sock>; |
352 |
> |
return if (!defined $response); |
353 |
|
chop $response; |
354 |
|
if (!$response eq "OK") { |
355 |
|
close($sock); |