summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2013-09-15 19:28:48 +0200
committerGravatar Steven Schubiger <stsc@refcnt.org> 2013-09-15 19:28:48 +0200
commit61b4c8dcf0479a510b856370b6964a61d7b6cab4 (patch)
tree093b7b41a87a13f566e5f096bd473d16811dc314
parent64059155774e2b35bbff97442e409ec5f0203256 (diff)
downloaddistdns-61b4c8dcf0479a510b856370b6964a61d7b6cab4.tar.gz
distdns-61b4c8dcf0479a510b856370b6964a61d7b6cab4.tar.bz2
Reorder check for missing params
-rwxr-xr-xclient.pl2
-rwxr-xr-xserver.cgi14
2 files changed, 8 insertions, 8 deletions
diff --git a/client.pl b/client.pl
index e573f9d..c83694c 100755
--- a/client.pl
+++ b/client.pl
@@ -32,7 +32,7 @@ use LWP::UserAgent;
use Sys::Hostname qw(hostname);
use Tie::File;
-my $VERSION = '0.05';
+my $VERSION = '0.06';
my $conf_file = catfile($Bin, 'client.conf');
diff --git a/server.cgi b/server.cgi
index 77e979b..e581a87 100755
--- a/server.cgi
+++ b/server.cgi
@@ -28,7 +28,7 @@ use File::Spec::Functions qw(catfile rel2abs);
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');
@@ -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);
@@ -85,12 +91,6 @@ else {
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";