Changeset 1621 for pjproject/trunk/pjlib/src/pj/sock_bsd.c
- Timestamp:
- Dec 5, 2007 5:08:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/sock_bsd.c
r1601 r1621 123 123 const int PJ_MSG_DONTROUTE = MSG_DONTROUTE; 124 124 125 126 #if 0 127 static void CHECK_ADDR_LEN(const pj_sockaddr *addr, int len) 128 { 129 pj_sockaddr *a = (pj_sockaddr*)addr; 130 pj_assert((a->addr.sa_family==PJ_AF_INET && len==sizeof(pj_sockaddr_in)) || 131 (a->addr.sa_family==PJ_AF_INET6 && len==sizeof(pj_sockaddr_in6))); 132 133 } 134 #else 135 #define CHECK_ADDR_LEN(addr,len) 136 #endif 125 137 126 138 /* … … 450 462 #endif 451 463 452 453 464 /* 454 465 * Bind socket. … … 461 472 462 473 PJ_ASSERT_RETURN(addr && len >= (int)sizeof(struct sockaddr_in), PJ_EINVAL); 474 475 CHECK_ADDR_LEN(addr, len); 463 476 464 477 if (bind(sock, (struct sockaddr*)addr, len) != 0) … … 575 588 PJ_CHECK_STACK(); 576 589 PJ_ASSERT_RETURN(len, PJ_EINVAL); 590 591 CHECK_ADDR_LEN(to, tolen); 577 592 578 593 *len = sendto(sock, (const char*)buf, *len, flags,
Note: See TracChangeset
for help on using the changeset viewer.