diff --git a/conn.h b/conn.h index e1cc5bd8..0d28e740 100644 --- a/conn.h +++ b/conn.h @@ -17,17 +17,17 @@ * currently "release 18446744073709551615 4294967295 4294967295\r\n". */ #define LINE_BUF_SIZE 54 -#define OP_UNKNOWN -1 -#define OP_PUT 0 -#define OP_PEEKJOB 1 -#define OP_RESERVE 2 -#define OP_DELETE 3 -#define OP_RELEASE 4 -#define OP_BURY 5 -#define OP_KICK 6 -#define OP_STATS 7 -#define OP_JOBSTATS 8 -#define OP_PEEK 9 +#define OP_UNKNOWN 0 +#define OP_PUT 1 +#define OP_PEEKJOB 2 +#define OP_RESERVE 3 +#define OP_DELETE 4 +#define OP_RELEASE 5 +#define OP_BURY 6 +#define OP_KICK 7 +#define OP_STATS 8 +#define OP_JOBSTATS 9 +#define OP_PEEK 10 /* CONN_TYPE_* are bit masks */ #define CONN_TYPE_PRODUCER 1 diff --git a/prot.c b/prot.c index 72f2bb1f..c0cea90d 100644 --- a/prot.c +++ b/prot.c @@ -32,6 +32,21 @@ static unsigned long long int put_ct = 0, peek_ct = 0, reserve_ct = 0, delete_ct = 0, release_ct = 0, bury_ct = 0, kick_ct = 0, stats_ct = 0, timeout_ct = 0; +#ifdef DEBUG +static const char * op_names[] = { + "", + CMD_PUT, + CMD_PEEKJOB, + CMD_RESERVE, + CMD_DELETE, + CMD_RELEASE, + CMD_BURY, + CMD_KICK, + CMD_STATS, + CMD_JOBSTATS, + CMD_PEEK, +}; +#endif static int waiting_conn_p() @@ -543,6 +558,7 @@ dispatch_cmd(conn c) if (strlen(c->cmd) != c->cmd_len - 2) return conn_close(c); type = which_cmd(c); + dprintf("got %s command: \"%s\"\n", op_names[(int) type], c->cmd); switch (type) { case OP_PUT: