]> git.meshlink.io Git - catta/commitdiff
network traffic debug output, including source address on recvmsg
authorSven M. Hallberg <pesco@khjk.org>
Wed, 15 Oct 2014 15:39:31 +0000 (17:39 +0200)
committerSven M. Hallberg <pesco@khjk.org>
Wed, 15 Oct 2014 15:39:31 +0000 (17:39 +0200)
src/compat/windows/wincompat.c

index 3e6417ef2d2115acf87b3fdc6640938393c076c3..890565bd2543cd11ba540e91f4f846e69271ad5f 100644 (file)
@@ -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;
 }