Changeset 5737 for pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
- Timestamp:
- Feb 15, 2018 1:57:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r5649 r5737 143 143 goto on_return; 144 144 145 #if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \ 146 PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0 147 if (-bytes_read == PJ_ESOCKETSTOP) { 148 --tp->read_loop_spin; 149 /* Try to recover by restarting the transport. */ 150 PJ_LOG(4,(tp->base.obj_name, "Restarting SIP UDP transport")); 151 status = pjsip_udp_transport_restart2( 152 &tp->base, 153 PJSIP_UDP_TRANSPORT_DESTROY_SOCKET, 154 PJ_INVALID_SOCKET, 155 &tp->base.local_addr, 156 &tp->base.local_name); 157 158 if (status != PJ_SUCCESS) { 159 PJ_PERROR(1,(THIS_FILE, status, 160 "Error restarting SIP UDP transport")); 161 } 162 return; 163 } 164 #endif 165 145 166 /* 146 167 * The idea of the loop is to process immediate data received by … … 262 283 status != PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) 263 284 { 264 265 285 PJSIP_ENDPT_LOG_ERROR((rdata->tp_info.transport->endpt, 266 286 rdata->tp_info.transport->obj_name, … … 305 325 tdata_op_key->tdata = NULL; 306 326 327 #if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \ 328 PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0 329 if (-bytes_sent == PJ_ESOCKETSTOP) { 330 pj_status_t status; 331 /* Try to recover by restarting the transport. */ 332 PJ_LOG(4,(tp->base.obj_name, "Restarting SIP UDP transport")); 333 status = pjsip_udp_transport_restart2( 334 &tp->base, 335 PJSIP_UDP_TRANSPORT_DESTROY_SOCKET, 336 PJ_INVALID_SOCKET, 337 &tp->base.local_addr, 338 &tp->base.local_name); 339 340 if (status != PJ_SUCCESS) { 341 PJ_PERROR(1,(THIS_FILE, status, 342 "Error restarting SIP UDP transport")); 343 } 344 return; 345 } 346 #endif 347 307 348 if (tdata_op_key->callback) { 308 349 tdata_op_key->callback(&tp->base, tdata_op_key->token, bytes_sent); … … 562 603 563 604 pj_assert(a_name->host.slen != 0); 605 606 if (pj_strcmp(&tp->base.local_name.host, &a_name->host) == 0 && 607 tp->base.local_name.port == a_name->port) 608 { 609 return; 610 } 611 564 612 pj_strdup_with_null(tp->base.pool, &tp->base.local_name.host, 565 613 &a_name->host); … … 1133 1181 /* Create the socket if it's not specified */ 1134 1182 if (sock == PJ_INVALID_SOCKET) { 1135 status = create_socket(local->addr.sa_family, local, 1136 pj_sockaddr_get_len(local), &sock); 1183 status = create_socket(local?local->addr.sa_family:pj_AF_UNSPEC(), 1184 local, local?pj_sockaddr_get_len(local):0, 1185 &sock); 1137 1186 if (status != PJ_SUCCESS) 1138 1187 return status;
Note: See TracChangeset
for help on using the changeset viewer.