]> mj.ucw.cz Git - eval.git/commitdiff
Implemented NOP command and used it for testing that the server still
authorMartin Mares <mj@ucw.cz>
Fri, 29 Jun 2007 14:41:33 +0000 (16:41 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 29 Jun 2007 14:41:33 +0000 (16:41 +0200)
exists.

submit/PROTOCOL
submit/commands.c
submit/contest

index fcd1106b8c6296ecab93c60bff0b54043d041f41..2307ddbd8289202fb2d101d0087696ec45a9c321 100644 (file)
@@ -54,6 +54,14 @@ Status reply:
                Aallowed_extension
        )
 
+NOP request:
+
+       !NOP
+
+NOP reply:
+
+       (only status)
+
 
 Task status objects
 ~~~~~~~~~~~~~~~~~~~
index 7ecd7810ed1a0c7a940feb04116a3fcc29b9d2c3..1e576055f72bf31a1a36d5e11ef9bc19164f9b69 100644 (file)
@@ -308,6 +308,8 @@ execute_command(struct conn *c)
     cmd_submit(c);
   else if (!strcasecmp(cmd, "STATUS"))
     cmd_status(c);
+  else if (!strcasecmp(cmd, "NOP"))
+    ;
   else
     err(c, "Unknown command");
 }
index 811a0f10b3bf9c091c021f69942c13676293c2c9..29b046e5d8ea5c60e2c11e86c45b1a9c5746dbe8 100755 (executable)
@@ -154,7 +154,7 @@ my $refresh_timer_id;
 
 sub timed_refresh()
 {
-       refresh();      # FIXME: If-modified-since version?
+       refresh();
        return 1;       # We wish to re-run the timer
 }
 
@@ -279,8 +279,7 @@ my %submit_fn_cache = ();
 sub end_submit($) {
        my ($close) = @_;
        $subwin->destroy if $close;
-       start_refresh_timer(0);
-       ### FIXME: ... and refresh status
+       start_refresh_timer(1);
 }
 
 sub finish_submit() {
@@ -325,14 +324,14 @@ sub run_submit() {
 
        if ($conn->is_connected) {
                busy("Checking server status...");
-               my $r = new Sherlock::Object("!" => "STATUS");  ### FIXME: use a NOP command
+               my $r = new Sherlock::Object("!" => "NOP");
                $r = $conn->request($r);
        }
        if (!$conn->is_connected) {
                busy("Reconnecting to server...");
                if (!$conn->connect) {
                        ready($conn->{"error"});
-                       submit_failed("Unable to connect to the server");       ### FIXME: Mention local submit
+                       submit_failed("Unable to connect to the server");
                        return;
                }
        }