diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-12 00:43:18 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-12 00:43:18 +0200 |
commit | 2d19f03a0734cc308733c9103dbd75446d8b46c6 (patch) | |
tree | 9d8c8db8c0a509665d5c35ad44f13d43dce9f766 | |
parent | 08ef65498f3156475bbced2523ec063b6290b600 (diff) |
WIP unix socket debug 5
-rw-r--r-- | sysdep/unix/io.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 14bf99fe..5d269ec6 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1512,6 +1512,17 @@ sk_open_unix(sock *s, char *name) return 0; } +static void hexdump(const char *data, socklen_t size) +{ + char buf[1024]; + + for (int i = 0; i < size; i++) + { + sprintf(buf + i*3, "%02x ", data[i]); + } + log(L_DEBUG, "sk_connect_unix: %s", buf); +} + int sk_connect_unix(sock *s, char *name, socklen_t namelen) { @@ -1535,6 +1546,7 @@ sk_connect_unix(sock *s, char *name, socklen_t namelen) sa.sun_family = AF_UNIX; memcpy(sa.sun_path, name, namelen); + hexdump((const char*)&sa, sizeof(sa.sun_family) + namelen); if (connect(fd, (struct sockaddr *) &sa, sizeof(sa.sun_family) + namelen) < 0) return -1; |