diff options
author | Russ Allbery <eagle@eyrie.org> | 2018-04-22 17:36:56 -0700 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2018-04-22 17:36:56 -0700 |
commit | 429d8a9dc8f97b62b73b69d4fd44f8697b7fcc6e (patch) | |
tree | 6fea98be7c87d9d3fa3a3b7e630d49c39f8bf35d /server | |
parent | 1e7eb6b986cf73f5fb2ef3c46eff17c928ac6417 (diff) |
Add more debugging output for v2 protocol
Log debugging output each time the server sends any sort of token.
It helps with debugging test suite failures.
Diffstat (limited to 'server')
-rw-r--r-- | server/server-v2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/server-v2.c b/server/server-v2.c index b7b2a48..b28dfd3 100644 --- a/server/server-v2.c +++ b/server/server-v2.c @@ -72,6 +72,7 @@ server_v2_send_output(struct client *client, int stream, die("internal error: cannot move data from output buffer"); /* Send the token. */ + debug("sending OUTPUT token (size=%lu)", (unsigned long) token.length); status = token_send_priv(client->fd, client->context, TOKEN_DATA | TOKEN_PROTOCOL, &token, TIMEOUT, &major, &minor); @@ -157,6 +158,7 @@ server_v2_command_finish(struct client *client, struct evbuffer *output UNUSED, token.value = &buffer; /* Send the token. */ + debug("sending STATUS token (status=%d)", (int) buffer[2]); status = token_send_priv(client->fd, client->context, TOKEN_DATA | TOKEN_PROTOCOL, &token, TIMEOUT, &major, &minor); @@ -202,6 +204,7 @@ server_v2_send_error(struct client *client, enum error_codes code, memcpy(p, message, strlen(message)); /* Send the token. */ + debug("sending ERROR token (size=%lu)", (unsigned long) token.length); status = token_send_priv(client->fd, client->context, TOKEN_DATA | TOKEN_PROTOCOL, &token, TIMEOUT, &major, &minor); @@ -237,6 +240,7 @@ server_v2_send_version(struct client *client) token.value = &buffer; /* Send the token. */ + debug("sending VERSION token"); status = token_send_priv(client->fd, client->context, TOKEN_DATA | TOKEN_PROTOCOL, &token, TIMEOUT, &major, &minor); @@ -269,6 +273,7 @@ server_v3_send_noop(struct client *client) token.value = &buffer; /* Send the token. */ + debug("sending NOOP token"); status = token_send_priv(client->fd, client->context, TOKEN_DATA | TOKEN_PROTOCOL, &token, TIMEOUT, &major, &minor); |