diff options
author | Steven Schubiger <stsc@refcnt.org> | 2013-11-19 21:45:57 +0100 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2013-11-19 21:45:57 +0100 |
commit | 2eeaf2830b8ec5df9a50488d58993275f9ef1387 (patch) | |
tree | 1340249bf9e5e25a0eecafbaca569d60b0a5e278 | |
parent | eb97e893a835f728f4bff344d937d0b1813f711e (diff) | |
download | distdns-2eeaf2830b8ec5df9a50488d58993275f9ef1387.tar.gz distdns-2eeaf2830b8ec5df9a50488d58993275f9ef1387.tar.bz2 |
Optimize retrieving session identifier
-rwxr-xr-x | client.pl | 3 | ||||
-rwxr-xr-x | server.cgi | 3 |
2 files changed, 2 insertions, 4 deletions
@@ -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; @@ -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; |