]> git.refcnt.org Git - distdns.git/commitdiff
Reorder check for missing params
authorSteven Schubiger <stsc@refcnt.org>
Sun, 15 Sep 2013 17:28:48 +0000 (19:28 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Sun, 15 Sep 2013 17:28:48 +0000 (19:28 +0200)
client.pl
server.cgi

index e573f9dadfe271826fb5d91844cd090ac4034cce..c83694c3381068668600e0250afb9828625cd3c2 100755 (executable)
--- a/client.pl
+++ b/client.pl
@@ -32,7 +32,7 @@ use LWP::UserAgent;
 use Sys::Hostname qw(hostname);
 use Tie::File;
 
 use Sys::Hostname qw(hostname);
 use Tie::File;
 
-my $VERSION = '0.05';
+my $VERSION = '0.06';
 
 my $conf_file = catfile($Bin, 'client.conf');
 
 
 my $conf_file = catfile($Bin, 'client.conf');
 
index 77e979b66a6253c3a0fb6297155ab2703059a03b..e581a8732ad922acffaa6bffd40725abef5858f6 100755 (executable)
@@ -28,7 +28,7 @@ use File::Spec::Functions qw(catfile rel2abs);
 use FindBin qw($Bin);
 use JSON qw(decode_json encode_json);
 
 use FindBin qw($Bin);
 use JSON qw(decode_json encode_json);
 
-my $VERSION = '0.05';
+my $VERSION = '0.06';
 
 my $conf_file = catfile($Bin, 'server.conf');
 
 
 my $conf_file = catfile($Bin, 'server.conf');
 
@@ -51,6 +51,12 @@ if ($params{debug}) {
     };
 }
 
     };
 }
 
+my @missing_params = grep { not defined $params{$_} && length $params{$_} } @params;
+if (@missing_params) {
+    my $missing_params = join ', ', map "'$_'", @missing_params;
+    die "Incomplete query: param(s) $missing_params missing or not defined\n";
+}
+
 my $config = Config::Tiny->new;
    $config = Config::Tiny->read($conf_file);
 
 my $config = Config::Tiny->new;
    $config = Config::Tiny->read($conf_file);
 
@@ -85,12 +91,6 @@ else {
     die "Session ID mismatch\n" unless $params{session} eq $session;
 }
 
     die "Session ID mismatch\n" unless $params{session} eq $session;
 }
 
-my @missing_params = grep { not defined $params{$_} && length $params{$_} } @params;
-if (@missing_params) {
-    my $missing_params = join ', ', map "'$_'", @missing_params;
-    die "Incomplete query: param(s) $missing_params missing or not defined\n";
-}
-
 my %access;
 my $access_file = "$params{netz}.conf";
 
 my %access;
 my $access_file = "$params{netz}.conf";