Skip to content

Commit 4c0deb4

Browse files
committed
add few more debugging test around bindx
1 parent 1f6fcfb commit 4c0deb4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

_sctp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ static int to_sockaddr(const char *caddr, int port, struct sockaddr* saddr, int*
12051205
*slen = 0;
12061206

12071207
#ifdef DEBUG
1208-
printf("Converting %s.%d... ", caddr, port);
1208+
printf("[DEBUG to_sockaddr] converting caddr: %s, port: %d\n", caddr, port);
12091209
#endif
12101210

12111211
if (strcmp(caddr, "") == 0) {
@@ -1232,7 +1232,7 @@ static int to_sockaddr(const char *caddr, int port, struct sockaddr* saddr, int*
12321232
}
12331233

12341234
#ifdef DEBUG
1235-
printf("result is %x.%x.%x\n",
1235+
printf("[DEBUG to_sockaddr] sockaddr result is family: 0x%x, s_addr: 0x%x, port: 0x%x\n",
12361236
((struct sockaddr_in*)saddr)->sin_family,
12371237
((struct sockaddr_in*)saddr)->sin_addr.s_addr,
12381238
((struct sockaddr_in*)saddr)->sin_port);
@@ -1417,6 +1417,12 @@ static PyObject* bindx(PyObject* dummy, PyObject* args)
14171417
saddrs = realloc(saddrs, saddrs_len + saddr_len);
14181418
memcpy( ((char*) saddrs) + saddrs_len, &saddr, saddr_len);
14191419
saddrs_len += saddr_len;
1420+
1421+
#ifdef DEBUG
1422+
printf("[DEBUG bindx] x: %d, caddr: %s, iport: %d, saddrs_len: %d\n",
1423+
x, caddr, iport, saddrs_len);
1424+
#endif
1425+
14201426
}
14211427

14221428
if (sctp_bindx(fd, saddrs, addrcount, flags)) {

sctp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ def bindx(self, sockaddrs, action=BINDX_ADD):
10411041
"""
10421042
Binds to a list of addresses. This method() allows to bind to any subset
10431043
of available interfaces, while standard bind() allows only one specific
1044-
interface, of all of them using the INADDR_ANY pseudo-address. Also, it
1044+
interface, or all of them using the INADDR_ANY pseudo-address. Also, it
10451045
allows to *remove* the binding from one or more addresses.
10461046
10471047
If you don't need the extended functionality of bindx(), standard bind()

0 commit comments

Comments
 (0)