]> git.refcnt.org Git - distdns.git/commitdiff
Optimize retrieving session identifier
authorSteven Schubiger <stsc@refcnt.org>
Tue, 19 Nov 2013 20:45:57 +0000 (21:45 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Tue, 19 Nov 2013 20:45:57 +0000 (21:45 +0100)
client.pl
server.cgi

index 729663f51a3c9a0b37148fddb617b9aa26960326..cbf9b58bc3d62caa185f20a46f0f6410902cf1df 100755 (executable)
--- a/client.pl
+++ b/client.pl
@@ -94,8 +94,7 @@ my $save_session = sub
 my $get_session = sub
 {
     open(my $fh, '<', $session_file) or _die "Cannot open $session_file for reading: $!\nPerhaps try running --init\n";
-    my $session = do { local $/; <$fh> };
-    chomp $session;
+    chomp(my $session = <$fh>);
     close($fh);
 
     return $session;
index c2df36ba3ab20da78e1d84e211cfa265ea70199f..1adcf0933b6ee9d71425fcd7cf503292e7a7de2a 100755 (executable)
@@ -88,8 +88,7 @@ if ($params{init}) {
 }
 else {
     open(my $fh, '<', $session_file) or die "Cannot open $session_file for reading: $!\nPerhaps try running --init\n";
-    my $session = do { local $/; <$fh> };
-    chomp $session;
+    chomp(my $session = <$fh>);
     close($fh);
 
     die "Session ID mismatch\n" unless $params{session} eq $session;