From a519d213fa9af075d9d94dbec990ab85fc34d5cf Mon Sep 17 00:00:00 2001 From: Preston Cody Date: Sun, 17 Feb 2008 19:40:38 +0000 Subject: removing some comments. small other touchups. svn path=/branches/new-fu/; revision=357 --- server/scireserver.pl | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/server/scireserver.pl b/server/scireserver.pl index fa5de61..1af39ee 100755 --- a/server/scireserver.pl +++ b/server/scireserver.pl @@ -55,7 +55,7 @@ my $dbh = DBI->connect($connect_string, $conf{db_user}, $conf{db_passwd}, { Rai while(<>) { my ($command, @args) = parse_command($_); # chomp( my $line = $_); -# debug("DEBUG: line is: $line"); + debug("DEBUG: line is: $_"); # SEE http://agaffney.org/mediawiki/index.php/SSH-based_protocol for documentation on the protocol. if($command eq "QUIT") { @@ -97,7 +97,7 @@ while(<>) { my @filenames = ("$conf{job_dir}/$client_id/result/$jobid.stdout", "$conf{job_dir}/$client_id/result/$jobid.stderr"); print "OK " . join(" ", @filenames) . "\n"; } elsif ($command eq "JOBFILE_SENT") { - my @filenames = @args; + my @jobfiles = @args; process_jobfile($_) foreach(@jobfiles); print "OK\n" } else { @@ -144,9 +144,6 @@ sub register_client { eval { run_query('LOCK TABLES `gacl_axo_seq` WRITE'); -# debug("Query is $query"); - #execute it -# $dbh->do($query); $query = 'SELECT id FROM `gacl_axo_seq`'; $sth = run_query($query); $id = $sth->fetchrow_hashref->{'id'}; @@ -154,8 +151,6 @@ sub register_client { $query = 'UPDATE `gacl_axo_seq` SET id=?'; run_query($query,$id); run_query('UNLOCK TABLES'); -# debug("Query is $query"); -# $dbh->do($query); }; ($@) and print "ERROR during fetching of id sequence: $DBI::errstr\n"; @@ -165,7 +160,6 @@ sub register_client { #NOTE: not sure if this query is still valid. may be using id instead of hostname for one of those two now. $query = 'INSERT INTO clients (clientid,digest,hostname,mac,ip,status) VALUES (?,?,?,?,?,?)'; - #execute with $id, client_cert.digest("sha1"),crypto.dump_certificate(crypto.FILETYPE_PEM,client_cert),$hostname,$mac,$ip,$status_id)) run_query($query,$id,$digest,$hostname,$mac,$ip,$status_id); }; ($@) and print "ERROR Could not insert client with $query: $DBI::errstr\n"; @@ -183,14 +177,11 @@ sub identify_client { my $query = 'SELECT client_status.statusname, clients.clientid FROM clients JOIN client_status on (clients.status = client_status.statusid) WHERE clients.digest=?'; my $sth = run_query($query,$digest); - #debug("Query is $query"); - #my $sth = $dbh->prepare($query); - #$sth->execute($digest); my $hashref = $sth->fetchrow_hashref(); debug(Dumper($hashref)); my $status_name = $hashref->{'statusname'}; $client_id = $hashref->{'clientid'}; - if (defined($client_id) and $client_id > 0) { #and ($status_name eq 'Active') { + if (defined($client_id) and ($client_id > 0) and ($status_name eq 'Active')) { $identified = 1; print "OK\n"; } else { @@ -216,9 +207,6 @@ EndOfQuery #FIXME ADD JOB DEPENDENCIES TO THIS QUERY. my $sth = run_query($query,$client_id); -# debug("Query is $query"); -# my $sth = $dbh->prepare($query); -# $sth->execute($client_id); my $jobs_ref = $sth->fetchall_arrayref(); # Don't ask me...ask the guys in #perl :P my @jobs = map { @$_ } @$jobs_ref; -- cgit v1.2.3-65-gdbad