From: Sven M. Hallberg Date: Wed, 15 Oct 2014 15:39:31 +0000 (+0200) Subject: network traffic debug output, including source address on recvmsg X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=51e407dccb00b6b2bf3b39ffd1973b3049225012;p=catta network traffic debug output, including source address on recvmsg --- 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; }