Diff for /loncom/lonr between versions 1.1 and 1.6

version 1.1, 2009/04/17 00:07:00 version 1.6, 2009/06/23 03:01:09
Line 1 Line 1
 #!/usr/bin/perl  #!/usr/bin/perl
 #  #
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # Connect to MAXIMA CAS  # Connect to R CAS
 #  #
 # $Id$  # $Id$
 #  #
Line 269  sub make_new_child { Line 269  sub make_new_child {
  };   };
   
  $command->log_stdout(0);   $command->log_stdout(0);
  $command->log_file("$execdir/logs/lonr.session.log");  # $command->log_file("$execdir/logs/lonr.session.log");
   
         for (my $i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) {          for (my $i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) {
             &status('Accepting connections');              &status('Accepting connections');
             my $client = $server->accept()     or last;              my $client = $server->accept()     or last;
             &sync($command);              &sync($command);
 #            print $command ("display2d:false;simp:true;kill(all);\n");              print $command ("library(phpSerialize);\n");
 #    &getroutput($command,2);      &getroutput($command);
 #            &sync($command);              &sync($command);
             my $syntaxerr = 0;              my $syntaxerr = 0;
             while (my $cmd=<$client>) {              while (my $cmd=<$client>) {
                 &status('Processing command');                  &status('Processing command');
                 print $command &unescape($cmd);                  print $command &unescape($cmd);
                 my ($reply,$syntaxerr) = &getroutput($command,1);                  my ($reply,$syntaxerr) = &getroutput($command);
                 print $client &escape($reply)."\n";                  print $client &escape($reply)."\n";
                 if ($syntaxerr) {                  if ($syntaxerr) {
                     last;                      last;
Line 316  sub make_new_child { Line 316  sub make_new_child {
     sub sync {      sub sync {
  my ($command)=@_;   my ($command)=@_;
  $counter++;   $counter++;
  my $expect=$counter.time;   my $expect=$counter;
  print $command "$expect;\n";   print $command "$expect;\n";
  while (1) {   while (1) {
     my $output=&getroutput($command);      my $output=&getroutput($command);
Line 351  sub getroutput { Line 351  sub getroutput {
     my $realoutput='';      my $realoutput='';
     foreach my $line (split(/\n/,$output)) {      foreach my $line (split(/\n/,$output)) {
        $line=~s/\s$//gs;         $line=~s/\s$//gs;
        if (my ($result)=($line=~/^\[\d+\,*\]\s*(.*)/)) { $realoutput.=$result."\n"; }         if ($line=~/^Error\:/) { $syntaxerr=1; next; }
          if (my ($result)=($line=~/^\[?\d+\,*\]?\s*(.*)/)) { $realoutput.=$result."\n"; }
     }      }
     if (wantarray) {      if (wantarray) {
         return ($realoutput,$syntaxerr);          return ($realoutput,$syntaxerr);

Removed from v.1.1  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.