diff options
author | 2007-12-24 18:29:14 +0000 | |
---|---|---|
committer | 2007-12-24 18:29:14 +0000 | |
commit | 6913310a84b72d913eead96e6e04dbbe1ff977f0 (patch) | |
tree | fb495c058eeb6315037b3810875c20da98e5fd32 | |
parent | musta been too drunk to not remember mkpath. (diff) | |
download | scire-6913310a84b72d913eead96e6e04dbbe1ff977f0.tar.gz scire-6913310a84b72d913eead96e6e04dbbe1ff977f0.tar.bz2 scire-6913310a84b72d913eead96e6e04dbbe1ff977f0.zip |
implement IDENTIFY command with random response in server
svn path=/branches/new-fu/; revision=262
-rwxr-xr-x | server/scireserver.pl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/server/scireserver.pl b/server/scireserver.pl index e328118..2c7a718 100755 --- a/server/scireserver.pl +++ b/server/scireserver.pl @@ -9,12 +9,19 @@ my $jobdir = "/tmp/scirejobs"; while(<>) { my $line = $_; chomp $line; - if($line =~ /^PING$/) { - print "PONG\n"; + if($line =~ /^IDENTIFY (.+)$/) { + my $rand_int = int(rand(3)); + if($rand_int == 0) { + print "OK\n"; + } elsif($rand_int == 1) { + print "ERROR Unrecognized client key. Please register\n"; + } elsif($rand_int == 2) { + print "ERROR This client has not yet been authorized\n"; + } } elsif($line =~ /^QUIT$/) { - print "Exiting!\n"; + print "OK\n"; exit; } else { - print "Unknown command\n"; + print "ERROR Unknown command\n"; } } |