src/graph_list.[ch]: Fix parsing the JSON cache.
[collection4.git] / src / main.c
index 7bc024a..470d67d 100644 (file)
@@ -107,14 +107,25 @@ static int handle_request (void) /* {{{ */
   else
   {
     size_t i;
+    int status = ENOENT;
+
+    gl_update (/* request_served = */ 0);
 
     for (i = 0; i < actions_num; i++)
     {
       if (strcmp (action, actions[i].name) == 0)
-        return ((*actions[i].callback) ());
+      {
+        status = (*actions[i].callback) ();
+        break;
+      }
     }
 
-    return (action_usage ());
+    if (i >= actions_num)
+      status = action_usage ();
+
+    gl_update (/* request_served = */ 1);
+
+    return (status);
   }
 } /* }}} int handle_request */