Changeset 110 for pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c
- Timestamp:
- Jan 7, 2006 11:01:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c
r109 r110 254 254 { 255 255 struct loop_transport *loop = arg; 256 struct recv_list r; 257 struct send_list s; 258 259 pj_list_init(&r); 260 pj_list_init(&s); 256 261 257 262 while (!loop->thread_quit_flag) { … … 263 268 pj_lock_acquire(loop->base.lock); 264 269 265 /* Process pending send notification. */270 /* Move expired send notification to local list. */ 266 271 while (!pj_list_empty(&loop->send_list)) { 267 272 struct send_list *node = loop->send_list.next; … … 270 275 if (PJ_TIME_VAL_GTE(node->sent_time, now)) 271 276 break; 277 278 /* Delete this from the list. */ 279 pj_list_erase(node); 280 281 /* Add to local list. */ 282 pj_list_push_back(&s, node); 283 } 284 285 /* Move expired "incoming" packet to local list. */ 286 while (!pj_list_empty(&loop->recv_list)) { 287 struct recv_list *node = loop->recv_list.next; 288 289 /* Break when next node time is greater than now. */ 290 if (PJ_TIME_VAL_GTE(node->rdata.pkt_info.timestamp, now)) 291 break; 292 293 /* Delete this from the list. */ 294 pj_list_erase(node); 295 296 /* Add to local list. */ 297 pj_list_push_back(&r, node); 298 299 } 300 301 pj_lock_release(loop->base.lock); 302 303 /* Process send notification and incoming packet notification 304 * without holding down the loop's mutex. 305 */ 306 while (!pj_list_empty(&s)) { 307 struct send_list *node = s.next; 308 309 pj_list_erase(node); 272 310 273 311 /* Notify callback. */ … … 276 314 } 277 315 278 /* Delete this from the list. */279 pj_list_erase(node);280 281 316 /* Decrement tdata reference counter. */ 282 317 pjsip_tx_data_dec_ref(node->tdata); 283 318 } 284 319 285 /* Process "incoming" packet s. */286 while (!pj_list_empty(& loop->recv_list)) {287 struct recv_list *node = loop->recv_list.next;320 /* Process "incoming" packet. */ 321 while (!pj_list_empty(&r)) { 322 struct recv_list *node = r.next; 288 323 pj_ssize_t size_eaten; 289 324 290 /* Break when next node time is greater than now. */ 291 if (PJ_TIME_VAL_GTE(node->rdata.pkt_info.timestamp, now)) 292 break; 325 pj_list_erase(node); 293 326 294 327 /* Notify transport manager about the "incoming packet" */ … … 298 331 /* Must "eat" all the packets. */ 299 332 pj_assert(size_eaten == node->rdata.pkt_info.len); 300 301 /* Delete this from the list. */302 pj_list_erase(node);303 333 304 334 /* Done. */ … … 306 336 node->rdata.tp_info.pool); 307 337 } 308 309 pj_lock_release(loop->base.lock);310 338 } 311 339
Note: See TracChangeset
for help on using the changeset viewer.