Changeset 605
- Timestamp:
- Jul 16, 2006 10:40:37 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
r603 r605 363 363 sip_uri = (pjsip_sip_uri*) uri; 364 364 365 /* Check for matching user part*/366 if ( pj_strcmp(&sip_uri->user, &call_user)!=0)365 /* Only want to handle INVITE requests. */ 366 if (rdata->msg_info.msg->line.req.method.id != PJSIP_INVITE_METHOD) { 367 367 return PJ_FALSE; 368 369 /* Only want to handle INVITE requests (for now). */ 370 if (rdata->msg_info.msg->line.req.method.id != PJSIP_INVITE_METHOD) { 368 } 369 370 371 /* Check for matching user part. Incoming requests will be handled 372 * call-statefully if: 373 * - user part is "2", or 374 * - user part is not "0" nor "1" and method is INVITE. 375 */ 376 if (pj_strcmp(&sip_uri->user, &call_user) == 0 || 377 sip_uri->user.slen != 1 || 378 (*sip_uri->user.ptr != '0' && *sip_uri->user.ptr != '1')) 379 { 380 /* Match */ 381 382 } else { 371 383 return PJ_FALSE; 372 384 } … … 460 472 } 461 473 474 475 476 /************************************************************************** 477 * Default handler when incoming request is not handled by any other 478 * modules. 479 */ 480 static pj_bool_t mod_responder_on_rx_request(pjsip_rx_data *rdata); 481 482 /* Module to handle incoming requests statelessly. 483 */ 484 static pjsip_module mod_responder = 485 { 486 NULL, NULL, /* prev, next. */ 487 { "mod-responder", 13 }, /* Name. */ 488 -1, /* Id */ 489 PJSIP_MOD_PRIORITY_APPLICATION+1, /* Priority */ 490 NULL, /* load() */ 491 NULL, /* start() */ 492 NULL, /* stop() */ 493 NULL, /* unload() */ 494 &mod_responder_on_rx_request, /* on_rx_request() */ 495 NULL, /* on_rx_response() */ 496 NULL, /* on_tx_request. */ 497 NULL, /* on_tx_response() */ 498 NULL, /* on_tsx_state() */ 499 }; 500 501 502 static pj_bool_t mod_responder_on_rx_request(pjsip_rx_data *rdata) 503 { 504 const pj_str_t reason = pj_str("Not expecting request at this URI"); 505 506 /* 507 * Respond any requests with 500. 508 */ 509 pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, &reason, 510 NULL, NULL); 511 return PJ_TRUE; 512 } 462 513 463 514 … … 721 772 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 722 773 774 /* Register default responder module */ 775 status = pjsip_endpt_register_module( app.sip_endpt, &mod_responder); 776 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 723 777 724 778 /* Register stateless server module */ … … 1489 1543 static char report[1024]; 1490 1544 1491 puts("PJSIP Performance Measurement Tool\n" 1492 "(c)2006 pjsip.org\n"); 1545 printf("PJSIP Performance Measurement Tool v%s\n" 1546 "(c)2006 pjsip.org\n\n", 1547 PJ_VERSION); 1493 1548 1494 1549 if (create_app() != 0) … … 1506 1561 pj_log_set_level(app.log_level); 1507 1562 1508 if (app.log_level > 3) {1563 if (app.log_level > 4) { 1509 1564 pjsip_endpt_register_module(app.sip_endpt, &msg_logger); 1510 1565 } … … 1658 1713 app.local_port, 1659 1714 (app.use_tcp ? ";transport=tcp" : "")); 1715 printf("INVITE with non-matching user part will be handled call-statefully\n"); 1660 1716 1661 1717 for (i=0; i<app.thread_count; ++i) { -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r600 r605 366 366 for (i=0; i<PJ_ARRAY_SIZE(listener->accept_op); ++i) { 367 367 if (listener->accept_op[i] && listener->accept_op[i]->pool) { 368 pj_pool_ release(listener->accept_op[i]->pool);368 pj_pool_t *pool = listener->accept_op[i]->pool; 369 369 listener->accept_op[i]->pool = NULL; 370 pj_pool_release(pool); 370 371 } 371 372 }
Note: See TracChangeset
for help on using the changeset viewer.