[Bio] / FigWebServices / rast_submit_server.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/rast_submit_server.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7, Fri Oct 23 18:30:17 2009 UTC revision 1.8, Fri Nov 20 17:52:32 2009 UTC
# Line 25  Line 25 
25                   status_of_RAST_job                   status_of_RAST_job
26                   kill_RAST_job                   kill_RAST_job
27                   delete_RAST_job                   delete_RAST_job
28                     get_job_metadata
29                  );                  );
30    
31  my %methods = map { $_ => 1 } @methods;  my %methods = map { $_ => 1 } @methods;
# Line 46  Line 47 
47      while ((my $cgi = new CGI::Fast()) &&      while ((my $cgi = new CGI::Fast()) &&
48             ($max_requests == 0 || $n_requests++ < $max_requests))             ($max_requests == 0 || $n_requests++ < $max_requests))
49      {      {
50            &log("fcgi request received");
51          eval {          eval {
52              &process_request($cgi);              &process_request($cgi);
53          };          };
54          if ($@)          my $had_error = $@;
55            &log("fcgi request completed $had_error");
56            if ($had_error)
57          {          {
58              if (ref($@) ne 'ARRAY')              if (ref($had_error) ne 'ARRAY')
59              {              {
60                  warn "code died, cgi=$cgi returning error\n";                  warn "code died, cgi=$cgi returning error\n";
61                  print $cgi->header(-status => '500 error in body of cgi processing');                  print $cgi->header(-status => '500 error in body of cgi processing');
# Line 64  Line 68 
68  else  else
69  {  {
70      my $cgi = new CGI();      my $cgi = new CGI();
71        &log("request received");
72      &process_request($cgi);      &process_request($cgi);
73        &log("request completed");
74  }  }
75    
76  exit;  exit;
77    
78    sub log
79    {
80        my($msg) = @_;
81        print STDERR strftime("%D %T: $msg\n", localtime);
82    }
83    
84    
85  sub process_request  sub process_request
86  {  {
87      my($cgi) = @_;      my($cgi) = @_;
88    
89      my $function = $cgi->param('function');      my $function = $cgi->param('function');
90  #    print STDERR "got function=$function\n";  #    print STDERR "got function=$function\n";
91        &log("handle $function");
92    
93      my $arg_str = $cgi->param('args');      my $arg_str = $cgi->param('args');
94      my @args;      my @args;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3