X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=command.c;h=1b9fd6da48ed142239ce3a22a569b40f78c1970e;hb=eca54f46680e3da32c28be81f127be97049b6edb;hp=d2cc4a49f84c44d4579d0731baaea9777f4dae15;hpb=c5d9167d93505c16ea9cf460c21e0ded735f6a47;p=pazpar2-moved-to-github.git diff --git a/command.c b/command.c index d2cc4a4..1b9fd6d 100644 --- a/command.c +++ b/command.c @@ -1,4 +1,4 @@ -/* $Id: command.c,v 1.3 2006-11-20 19:46:40 quinn Exp $ */ +/* $Id: command.c,v 1.5 2006-12-03 06:43:24 quinn Exp $ */ #include #include @@ -44,6 +44,7 @@ static int cmd_quit(struct command_session *s, char **argv, int argc) return 0; } +#ifdef GAGA static int cmd_load(struct command_session *s, char **argv, int argc) { if (argc != 2) { @@ -53,6 +54,7 @@ static int cmd_load(struct command_session *s, char **argv, int argc) command_puts(s, "Failed to open file\n"); return 1; } +#endif static int cmd_search(struct command_session *s, char **argv, int argc) { @@ -75,8 +77,8 @@ static int cmd_hitsbytarget(struct command_session *s, char **argv, int argc) { char buf[1024]; - sprintf(buf, "%s: %d (%d records, diag=%d, state=%s)\n", ht[i].id, ht[i].hits, - ht[i].records, ht[i].diagnostic, ht[i].state); + sprintf(buf, "%s: %d (%d records, diag=%d, state=%s conn=%d)\n", ht[i].id, ht[i].hits, + ht[i].records, ht[i].diagnostic, ht[i].state, ht[i].connected); command_puts(s, buf); } return 1; @@ -86,12 +88,13 @@ static int cmd_show(struct command_session *s, char **argv, int argc) { struct record **recs; int num = 10; + int merged, total; int i; if (argc == 2) num = atoi(argv[1]); - recs = show(s->psession, 0, &num); + recs = show(s->psession, 0, &num, &merged, &total); for (i = 0; i < num; i++) { @@ -119,7 +122,7 @@ static int cmd_stat(struct command_session *s, char **argv, int argc) struct statistics stat; statistics(s->psession, &stat); - sprintf(buf, "Number of connections: %d\n", stat.num_connections); + sprintf(buf, "Number of connections: %d\n", stat.num_clients); command_puts(s, buf); if (stat.num_no_connection) { @@ -169,7 +172,9 @@ static struct { int (*fun)(struct command_session *s, char *argv[], int argc); } cmd_array[] = { {"quit", cmd_quit}, +#ifdef GAGA {"load", cmd_load}, +#endif {"find", cmd_search}, {"ht", cmd_hitsbytarget}, {"stat", cmd_stat},