Removes I<filename> from the cache. Any pending updates B<WILL BE LOST>.
+=item B<QUEUE>
+
+Shows the files that are on the output queue. Returns zero or more lines
+in the following format, where E<lt>num_valsE<gt> is the number of values
+to be written for the E<lt>fileE<gt>:
+
+ <num_vals> <file>
+
=item B<HELP> [I<command>]
Returns a short usage message. If no command is given, or I<command> is
"FLUSHALL\n"
"PENDING <filename>\n"
"FORGET <filename>\n"
+ "QUEUE\n"
"UPDATE <filename> <values> [<values> ...]\n"
"BATCH\n"
"STATS\n"
"Any pending updates for the file will be lost.\n"
};
+ char *help_queue[2] =
+ {
+ "Help for QUEUE\n"
+ ,
+ "Shows all files in the output queue.\n"
+ "The output is zero or more lines in the following format:\n"
+ "(where <num_vals> is the number of values to be written)\n"
+ "\n"
+ "<num_vals> <filename>\n"
+ "\n"
+ };
+
char *help_update[2] =
{
"Help for UPDATE\n"
help_text = help_pending;
else if (strcasecmp (command, "forget") == 0)
help_text = help_forget;
+ else if (strcasecmp (command, "queue") == 0)
+ help_text = help_queue;
else if (strcasecmp (command, "stats") == 0)
help_text = help_stats;
else if (strcasecmp (command, "batch") == 0)
assert(1==0);
} /* }}} static int handle_request_forget */
+static int handle_request_queue (listen_socket_t *sock) /* {{{ */
+{
+ cache_item_t *ci;
+
+ pthread_mutex_lock(&cache_lock);
+
+ ci = cache_queue_head;
+ while (ci != NULL)
+ {
+ add_response_info(sock, "%d %s\n", ci->values_num, ci->file);
+ ci = ci->next;
+ }
+
+ pthread_mutex_unlock(&cache_lock);
+
+ return send_response(sock, RESP_OK, "in queue.\n");
+} /* }}} int handle_request_queue */
+
static int handle_request_update (listen_socket_t *sock, /* {{{ */
time_t now,
char *buffer, size_t buffer_size)
return (handle_request_pending(sock, buffer_ptr, buffer_size));
else if (strcasecmp (command, "forget") == 0)
return (handle_request_forget(sock, buffer_ptr, buffer_size));
+ else if (strcasecmp (command, "queue") == 0)
+ return (handle_request_queue(sock));
else if (strcasecmp (command, "stats") == 0)
return (handle_request_stats (sock));
else if (strcasecmp (command, "help") == 0)