From 51e407dccb00b6b2bf3b39ffd1973b3049225012 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Wed, 15 Oct 2014 17:39:31 +0200 Subject: [PATCH] network traffic debug output, including source address on recvmsg --- src/compat/windows/wincompat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/compat/windows/wincompat.c b/src/compat/windows/wincompat.c index 3e6417e..890565b 100644 --- a/src/compat/windows/wincompat.c +++ b/src/compat/windows/wincompat.c @@ -138,6 +138,12 @@ ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) msg->msg_flags = (int)wsamsg.dwFlags; // all flags that fit into dwFlags also fit into msg_flags (see above) + // XXX debug, remove + { + char where[64]; + getnameinfo(msg->msg_name, msg->msg_namelen, where, sizeof(where), NULL, 0, NI_NUMERICHOST); + catta_log_debug("recvmsg: %u bytes from %s", (unsigned int)bytesrcvd, where); + } return bytesrcvd; } @@ -214,6 +220,12 @@ ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) return -1; } + // XXX debug, remove + { + char where[64]; + getnameinfo(msg->msg_name, msg->msg_namelen, where, sizeof(where), NULL, 0, NI_NUMERICHOST); + catta_log_debug("sendmsg: %u bytes to %s", (unsigned int)bytessent, where); + } return bytessent; } -- 2.39.5