Changeset 1817 for pjproject/trunk
- Timestamp:
- Feb 22, 2008 9:56:27 AM (17 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r1602 r1817 104 104 pjsip_transport base; 105 105 pj_bool_t is_server; 106 107 /* Do not save listener instance in the transport, because 108 * listener might be destroyed during transport's lifetime. 109 * See http://trac.pjsip.org/repos/ticket/491 106 110 struct tcp_listener *listener; 111 */ 112 107 113 pj_bool_t is_registered; 108 114 pj_bool_t is_closing; … … 525 531 tcp->sock = sock; 526 532 tcp->is_server = is_server; 527 tcp->listener = listener;533 /*tcp->listener = listener;*/ 528 534 pj_list_init(&tcp->delayed_list); 529 535 tcp->base.pool = pool; … … 674 680 /* Stop keep-alive timer. */ 675 681 if (tcp->ka_timer.id) { 676 pjsip_endpt_cancel_timer(tcp-> listener->endpt, &tcp->ka_timer);682 pjsip_endpt_cancel_timer(tcp->base.endpt, &tcp->ka_timer); 677 683 tcp->ka_timer.id = PJ_FALSE; 678 684 } … … 757 763 758 764 /* Init rdata */ 759 pool = pjsip_endpt_create_pool(tcp-> listener->endpt,765 pool = pjsip_endpt_create_pool(tcp->base.endpt, 760 766 "rtd%p", 761 767 PJSIP_POOL_RDATA_LEN, … … 1195 1201 /* Stop keep-alive timer. */ 1196 1202 if (tcp->ka_timer.id) { 1197 pjsip_endpt_cancel_timer(tcp-> listener->endpt, &tcp->ka_timer);1203 pjsip_endpt_cancel_timer(tcp->base.endpt, &tcp->ka_timer); 1198 1204 tcp->ka_timer.id = PJ_FALSE; 1199 1205 } … … 1435 1441 if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { 1436 1442 pj_time_val delay = { PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0 }; 1437 pjsip_endpt_schedule_timer(tcp-> listener->endpt, &tcp->ka_timer,1443 pjsip_endpt_schedule_timer(tcp->base.endpt, &tcp->ka_timer, 1438 1444 &delay); 1439 1445 tcp->ka_timer.id = PJ_TRUE; … … 1463 1469 delay.msec = 0; 1464 1470 1465 pjsip_endpt_schedule_timer(tcp-> listener->endpt, &tcp->ka_timer,1471 pjsip_endpt_schedule_timer(tcp->base.endpt, &tcp->ka_timer, 1466 1472 &delay); 1467 1473 tcp->ka_timer.id = PJ_TRUE; … … 1490 1496 delay.msec = 0; 1491 1497 1492 pjsip_endpt_schedule_timer(tcp-> listener->endpt, &tcp->ka_timer,1498 pjsip_endpt_schedule_timer(tcp->base.endpt, &tcp->ka_timer, 1493 1499 &delay); 1494 1500 tcp->ka_timer.id = PJ_TRUE; -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
r1799 r1817 156 156 pjsip_transport base; 157 157 pj_bool_t is_server; 158 159 /* Do not save listener instance in the transport, because 160 * listener might be destroyed during transport's lifetime. 161 * See http://trac.pjsip.org/repos/ticket/491 158 162 struct tls_listener *listener; 163 */ 164 165 /* TLS settings, copied from listener */ 166 struct { 167 pj_time_val timeout; 168 } setting; 169 159 170 pj_bool_t is_registered; 160 171 pj_bool_t is_closing; … … 591 602 PJ_TODO(SUPPORT_SSL_ASYNCHRONOUS_CONNECT); 592 603 593 if (tls-> listener->setting.timeout.sec == 0 &&594 tls-> listener->setting.timeout.msec == 0)604 if (tls->setting.timeout.sec == 0 && 605 tls->setting.timeout.msec == 0) 595 606 { 596 607 p_timeout = NULL; 597 608 } else { 598 timeout = tls-> listener->setting.timeout;609 timeout = tls->setting.timeout; 599 610 p_timeout = &timeout; 600 611 } … … 723 734 pj_assert(PJ_FD_COUNT(&rd_set) == 1 || PJ_FD_COUNT(&wr_set) == 1); 724 735 725 if (tls-> listener->setting.timeout.sec == 0 &&726 tls-> listener->setting.timeout.msec == 0)736 if (tls->setting.timeout.sec == 0 && 737 tls->setting.timeout.msec == 0) 727 738 { 728 739 p_timeout = NULL; 729 740 } else { 730 timeout = tls-> listener->setting.timeout;741 timeout = tls->setting.timeout; 731 742 p_timeout = &timeout; 732 743 } … … 1217 1228 tls->sock = sock; 1218 1229 tls->is_server = is_server; 1219 tls->listener = listener;1230 /*tls->listener = listener;*/ 1220 1231 pj_list_init(&tls->delayed_list); 1221 1232 tls->base.pool = pool; 1233 tls->setting.timeout = listener->setting.timeout; 1222 1234 1223 1235 pj_ansi_snprintf(tls->base.obj_name, PJ_MAX_OBJ_NAME, … … 1404 1416 /* Stop keep-alive timer. */ 1405 1417 if (tls->ka_timer.id) { 1406 pjsip_endpt_cancel_timer(tls-> listener->endpt, &tls->ka_timer);1418 pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); 1407 1419 tls->ka_timer.id = PJ_FALSE; 1408 1420 } … … 1492 1504 1493 1505 /* Init rdata */ 1494 pool = pjsip_endpt_create_pool(tls-> listener->endpt,1506 pool = pjsip_endpt_create_pool(tls->base.endpt, 1495 1507 "rtd%p", 1496 1508 PJSIP_POOL_RDATA_LEN, … … 1974 1986 /* Stop keep-alive timer. */ 1975 1987 if (tls->ka_timer.id) { 1976 pjsip_endpt_cancel_timer(tls-> listener->endpt, &tls->ka_timer);1988 pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); 1977 1989 tls->ka_timer.id = PJ_FALSE; 1978 1990 } … … 2278 2290 if (PJSIP_TLS_KEEP_ALIVE_INTERVAL) { 2279 2291 pj_time_val delay = { PJSIP_TLS_KEEP_ALIVE_INTERVAL, 0 }; 2280 pjsip_endpt_schedule_timer(tls-> listener->endpt, &tls->ka_timer,2292 pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, 2281 2293 &delay); 2282 2294 tls->ka_timer.id = PJ_TRUE; … … 2308 2320 delay.msec = 0; 2309 2321 2310 pjsip_endpt_schedule_timer(tls-> listener->endpt, &tls->ka_timer,2322 pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, 2311 2323 &delay); 2312 2324 tls->ka_timer.id = PJ_TRUE; … … 2334 2346 delay.msec = 0; 2335 2347 2336 pjsip_endpt_schedule_timer(tls-> listener->endpt, &tls->ka_timer,2348 pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, 2337 2349 &delay); 2338 2350 tls->ka_timer.id = PJ_TRUE;
Note: See TracChangeset
for help on using the changeset viewer.