diff --git a/src/main/util/iobuf.c b/src/main/util/iobuf.c index c2d0ad1..45884ea 100644 --- a/src/main/util/iobuf.c +++ b/src/main/util/iobuf.c @@ -14,11 +14,18 @@ void iobuf_log(struct iobuf *buffer, const char *tag) str = xmalloc(str_len); log_misc( - "[%s] (%d %d)", tag, (uint32_t) buffer->nbytes, (uint32_t) buffer->pos); + "[%s] (nbytes %d, pos %d)", + tag, + (uint32_t) buffer->nbytes, + (uint32_t) buffer->pos); hex_encode_uc(buffer->bytes, buffer->nbytes, str, str_len); - log_misc("[%s]: %s", tag, str); + log_misc("full [%s]: %s", tag, str); + + hex_encode_uc(buffer->bytes, buffer->pos, str, str_len); + + log_misc("pos [%s]: %s", tag, str); free(str); } @@ -32,11 +39,18 @@ void iobuf_log_const(struct const_iobuf *buffer, const char *tag) str = xmalloc(str_len); log_misc( - "[%s] (%d %d)", tag, (uint32_t) buffer->nbytes, (uint32_t) buffer->pos); + "[%s] (nbytes %d, pos %d)", + tag, + (uint32_t) buffer->nbytes, + (uint32_t) buffer->pos); hex_encode_uc(buffer->bytes, buffer->nbytes, str, str_len); - log_misc("[%s]: %s", tag, str); + log_misc("full [%s]: %s", tag, str); + + hex_encode_uc(buffer->bytes, buffer->pos, str, str_len); + + log_misc("pos [%s]: %s", tag, str); free(str); }