- Timestamp:
- Jul 6, 2010 8:11:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c
r2394 r3235 30 30 enum { MAX_REQUEST = 4 }; 31 31 static int stun_timer[] = {1000, 1000, 1000, 1000 }; 32 #define STUN_MAGIC 0x2112A442 32 33 33 34 #define THIS_FILE "stun_client.c" … … 224 225 pjstun_msg_find_attr(&msg, PJSTUN_ATTR_MAPPED_ADDR); 225 226 if (!attr) { 226 status = PJLIB_UTIL_ESTUNNOMAP; 227 continue; 227 attr = (pjstun_mapped_addr_attr*) 228 pjstun_msg_find_attr(&msg, PJSTUN_ATTR_XOR_MAPPED_ADDR); 229 if (!attr || attr->family != 1) { 230 status = PJLIB_UTIL_ESTUNNOMAP; 231 continue; 232 } 228 233 } 229 234 230 235 rec[sock_idx].srv[srv_idx].mapped_addr = attr->addr; 231 236 rec[sock_idx].srv[srv_idx].mapped_port = attr->port; 237 if (pj_ntohs(attr->hdr.type) == PJSTUN_ATTR_XOR_MAPPED_ADDR) { 238 rec[sock_idx].srv[srv_idx].mapped_addr ^= pj_htonl(STUN_MAGIC); 239 rec[sock_idx].srv[srv_idx].mapped_port ^= pj_htons(STUN_MAGIC >> 16); 240 } 232 241 } 233 242 }
Note: See TracChangeset
for help on using the changeset viewer.