aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-08-03 15:08:30 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commit01601a4db44b3adccfbcc07129a4584649252736 (patch)
tree57d55b377b3358decca0a6ae938be1c283bbca38 /erts/emulator/nifs/common
parentd8b1eace1cfe3184497752f345e5f6bc5def9769 (diff)
downloadotp-01601a4db44b3adccfbcc07129a4584649252736.tar.gz
otp-01601a4db44b3adccfbcc07129a4584649252736.tar.bz2
otp-01601a4db44b3adccfbcc07129a4584649252736.zip
[socket-nif] Add more data types (with doc) and (C) debug
Add more debug printouts for the new sendmsg. Also added new (erlang) types with doc. OTP-14831
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r--erts/emulator/nifs/common/socket_nif.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c
index 0d584306f1..90b727eff7 100644
--- a/erts/emulator/nifs/common/socket_nif.c
+++ b/erts/emulator/nifs/common/socket_nif.c
@@ -3770,7 +3770,8 @@ ERL_NIF_TERM nif_sendmsg(ErlNifEnv* env,
res = nsendmsg(env, descP, sendRef, eMsgHdr, flags);
- SGDBG( ("SOCKET", "nif_sendmsg -> done with result: "
+ SSDBG( descP,
+ ("SOCKET", "nif_sendmsg -> done with result: "
"\r\n %T"
"\r\n", res) );
@@ -3808,6 +3809,8 @@ ERL_NIF_TERM nsendmsg(ErlNifEnv* env,
/* We don't need the address */
+ SSDBG( descP, ("SOCKET", "nsendmsg -> connected: no address\r\n") );
+
msgHdr.msg_name = NULL;
msgHdr.msg_namelen = 0;
@@ -3820,6 +3823,11 @@ ERL_NIF_TERM nsendmsg(ErlNifEnv* env,
sys_memzero((char *) msgHdr.msg_name, msgHdr.msg_namelen);
if (!GET_MAP_VAL(env, eMsgHdr, esock_atom_addr, &eAddr))
return esock_make_error(env, esock_atom_einval);
+
+ SSDBG( descP, ("SOCKET", "nsendmsg -> not connected: "
+ "\r\n %T"
+ "\r\n", eAddr) );
+
if ((xres = esock_decode_sockaddr(env, eAddr,
msgHdr.msg_name,
&msgHdr.msg_namelen)) != NULL)
@@ -3836,6 +3844,8 @@ ERL_NIF_TERM nsendmsg(ErlNifEnv* env,
if (!GET_LIST_LEN(env, eIOV, &iovLen) && (iovLen > 0))
return esock_make_error(env, esock_atom_einval);
+ SSDBG( descP, ("SOCKET", "nsendmsg -> iov length: %d\r\n", iovLen) );
+
iovBins = MALLOC(iovLen * sizeof(ErlNifBinary));
ESOCK_ASSERT( (iovBins != NULL) );
@@ -3866,6 +3876,10 @@ ERL_NIF_TERM nsendmsg(ErlNifEnv* env,
msgHdr.msg_iovlen = iovLen;
+ SSDBG( descP, ("SOCKET",
+ "nsendmsg -> total (iov) data size: %d\r\n", dataSize) );
+
+
/* Decode the ctrl and initiate that part of the msghdr */
if (ctrlBuf != NULL) {
if ((xres = decode_cmsghdrs(env, descP,