Changeset 252
- Timestamp:
- Mar 1, 2006 7:28:08 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_transport.h
r145 r252 164 164 /** The transport object which received this packet. */ 165 165 pjsip_transport *transport; 166 167 /** Other transport specific data to be attached to this buffer. */ 168 void *tp_data; 166 169 167 170 /** Ioqueue key. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r184 r252 42 42 43 43 /* 44 * Initialize transport's receive buffer from the specified pool. 45 */ 46 static void init_rdata(struct udp_transport *tp, unsigned rdata_index, 47 pj_pool_t *pool, pjsip_rx_data **p_rdata) 48 { 49 pjsip_rx_data *rdata; 50 51 /* Reset pool. */ 52 pj_pool_reset(pool); 53 54 rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data)); 55 56 /* Init tp_info part. */ 57 rdata->tp_info.pool = pool; 58 rdata->tp_info.transport = &tp->base; 59 rdata->tp_info.tp_data = (void*) rdata_index; 60 rdata->tp_info.op_key.rdata = rdata; 61 pj_ioqueue_op_key_init(&rdata->tp_info.op_key.op_key, 62 sizeof(pj_ioqueue_op_key_t)); 63 64 tp->rdata[rdata_index] = rdata; 65 66 if (p_rdata) 67 *p_rdata = rdata; 68 } 69 70 71 /* 44 72 * udp_on_read_complete() 45 73 * … … 116 144 flags = 0; 117 145 } 146 147 /* Reset pool. */ 148 pj_pool_reset(rdata->tp_info.pool); 149 init_rdata((struct udp_transport*)rdata->tp_info.transport, 150 (unsigned)rdata->tp_info.tp_data, 151 rdata->tp_info.pool, 152 &rdata); 118 153 119 154 /* Read next packet. */ … … 413 448 } 414 449 415 tp->rdata[i] = pj_pool_zalloc(rdata_pool, sizeof(pjsip_rx_data)); 416 417 /* Init tp_info part. */ 418 tp->rdata[i]->tp_info.pool = rdata_pool; 419 tp->rdata[i]->tp_info.transport = &tp->base; 420 tp->rdata[i]->tp_info.op_key.rdata = tp->rdata[i]; 421 pj_ioqueue_op_key_init(&tp->rdata[i]->tp_info.op_key.op_key, 422 sizeof(pj_ioqueue_op_key_t)); 423 450 init_rdata(tp, i, rdata_pool, NULL); 424 451 tp->rdata_cnt++; 425 452 }
Note: See TracChangeset
for help on using the changeset viewer.