Changeset 5644
- Timestamp:
- Sep 4, 2017 4:12:50 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/sock_common.c
r5636 r5644 135 135 addr->sin_addr = pj_inet_addr(str_addr); 136 136 if (addr->sin_addr.s_addr == PJ_INADDR_NONE) { 137 pj_hostent he; 138 pj_status_t rc; 139 140 rc = pj_gethostbyname(str_addr, &he); 141 if (rc == 0) { 142 addr->sin_addr.s_addr = *(pj_uint32_t*)he.h_addr; 137 pj_addrinfo ai; 138 unsigned count = 1; 139 pj_status_t status; 140 141 status = pj_getaddrinfo(pj_AF_INET(), str_addr, &count, &ai); 142 if (status==PJ_SUCCESS) { 143 pj_memcpy(&addr->sin_addr, &ai.ai_addr.ipv4.sin_addr, 144 sizeof(addr->sin_addr)); 143 145 } else { 144 addr->sin_addr.s_addr = PJ_INADDR_NONE; 145 return rc; 146 return status; 146 147 } 147 148 }
Note: See TracChangeset
for help on using the changeset viewer.