Changeset 1080 for pjproject/trunk/pjnath/src/pjnath/stun_transaction.c
- Timestamp:
- Mar 18, 2007 5:39:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/stun_transaction.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_transaction.h>20 #include <pj lib-util/errno.h>19 #include <pjnath/stun_transaction.h> 20 #include <pjnath/errno.h> 21 21 #include <pj/assert.h> 22 22 #include <pj/log.h> … … 32 32 { 33 33 char obj_name[PJ_MAX_OBJ_NAME]; 34 pj_stun_ endpoint *endpt;34 pj_stun_config *cfg; 35 35 pj_stun_tsx_cb cb; 36 36 void *user_data; … … 64 64 * Create a STUN client transaction. 65 65 */ 66 PJ_DEF(pj_status_t) pj_stun_client_tsx_create(pj_stun_ endpoint *endpt,66 PJ_DEF(pj_status_t) pj_stun_client_tsx_create(pj_stun_config *cfg, 67 67 pj_pool_t *pool, 68 68 const pj_stun_tsx_cb *cb, … … 71 71 pj_stun_client_tsx *tsx; 72 72 73 PJ_ASSERT_RETURN( endpt&& cb && p_tsx, PJ_EINVAL);73 PJ_ASSERT_RETURN(cfg && cb && p_tsx, PJ_EINVAL); 74 74 PJ_ASSERT_RETURN(cb->on_send_msg, PJ_EINVAL); 75 75 76 76 tsx = PJ_POOL_ZALLOC_T(pool, pj_stun_client_tsx); 77 tsx-> endpt = endpt;77 tsx->cfg = cfg; 78 78 pj_memcpy(&tsx->cb, cb, sizeof(*cb)); 79 79 … … 98 98 99 99 if (tsx->timer.id != 0) { 100 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);100 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 101 101 tsx->timer.id = 0; 102 102 } … … 150 150 if (tsx->transmit_count == 0) { 151 151 tsx->retransmit_time.sec = 0; 152 tsx->retransmit_time.msec = tsx-> endpt->rto_msec;152 tsx->retransmit_time.msec = tsx->cfg->rto_msec; 153 153 154 154 } else if (tsx->transmit_count < PJ_STUN_MAX_RETRANSMIT_COUNT-1) { … … 169 169 * cancel transmission). 170 170 */; 171 status = pj_timer_heap_schedule(tsx-> endpt->timer_heap, &tsx->timer,171 status = pj_timer_heap_schedule(tsx->cfg->timer_heap, &tsx->timer, 172 172 &tsx->retransmit_time); 173 173 if (status != PJ_SUCCESS) { … … 183 183 if (status != PJ_SUCCESS) { 184 184 if (tsx->timer.id != 0) { 185 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);185 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 186 186 tsx->timer.id = 0; 187 187 } … … 236 236 tsx->complete = PJ_TRUE; 237 237 if (tsx->cb.on_complete) { 238 tsx->cb.on_complete(tsx, PJ LIB_UTIL_ESTUNNOTRESPOND, NULL);238 tsx->cb.on_complete(tsx, PJNATH_ESTUNNOTRESPOND, NULL); 239 239 } 240 240 return; … … 269 269 PJ_LOG(4,(tsx->obj_name, 270 270 "STUN rx_msg() error: not response message")); 271 return PJ LIB_UTIL_ESTUNNOTRESPONSE;271 return PJNATH_ESTUNNOTRESPONSE; 272 272 } 273 273 … … 277 277 */ 278 278 if (tsx->timer.id) { 279 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);279 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 280 280 tsx->timer.id = 0; 281 281 } … … 301 301 status = PJ_SUCCESS; 302 302 } else { 303 status = PJ LIB_UTIL_ESTUNTSXFAILED;303 status = PJNATH_ESTUNTSXFAILED; 304 304 } 305 305
Note: See TracChangeset
for help on using the changeset viewer.