Changeset 1610
- Timestamp:
- Dec 2, 2007 3:40:52 PM (17 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/build/test_pjsip.dsp
r1469 r1610 43 43 # PROP Target_Dir "" 44 44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 # ADD CPP /nologo /MD /W3 /Zi /O2 /Ob2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" / D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /c45 # ADD CPP /nologo /MD /W3 /Zi /O2 /Ob2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../pjmedia/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /c 46 46 # SUBTRACT CPP /YX 47 47 # ADD BASE RSC /l 0x409 /d "NDEBUG" … … 68 68 # PROP Target_Dir "" 69 69 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 70 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" / D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /GZ /c70 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../pjmedia/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /GZ /c 71 71 # SUBTRACT CPP /YX 72 72 # ADD BASE RSC /l 0x409 /d "_DEBUG" -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r1417 r1610 1774 1774 buf += hdr->transport.slen; 1775 1775 *buf++ = ' '; 1776 pj_memcpy(buf, hdr->sent_by.host.ptr, hdr->sent_by.host.slen); 1777 buf += hdr->sent_by.host.slen; 1776 1777 /* Check if host contains IPv6 */ 1778 if (pj_memchr(hdr->sent_by.host.ptr, ':', hdr->sent_by.host.slen)) { 1779 copy_advance_pair_quote_cond(buf, "", 0, hdr->sent_by.host, '[', ']'); 1780 } else { 1781 copy_advance_check(buf, hdr->sent_by.host); 1782 } 1783 1778 1784 if (hdr->sent_by.port != 0) { 1779 1785 *buf++ = ':'; … … 1804 1810 1805 1811 1806 copy_advance_pair(buf, ";maddr=", 7, hdr->maddr_param); 1812 if (hdr->maddr_param.slen) { 1813 /* Detect IPv6 IP address */ 1814 if (pj_memchr(hdr->maddr_param.ptr, ':', hdr->maddr_param.slen)) { 1815 copy_advance_pair_quote_cond(buf, ";maddr=", 7, hdr->maddr_param, 1816 '[', ']'); 1817 } else { 1818 copy_advance_pair(buf, ";maddr=", 7, hdr->maddr_param); 1819 } 1820 } 1821 1807 1822 copy_advance_pair(buf, ";received=", 10, hdr->recvd_param); 1808 1823 copy_advance_pair(buf, ";branch=", 8, hdr->branch_param); -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r1566 r1610 1078 1078 pvalue->slen -= 2; 1079 1079 } 1080 } else if (*scanner->curptr == '[') { 1081 /* pvalue can be a quoted IPv6; in this case, the 1082 * '[' and ']' quote characters are to be removed 1083 * from the pvalue. 1084 */ 1085 pj_scan_get_char(scanner); 1086 pj_scan_get_until_ch(scanner, ']', pvalue); 1087 pj_scan_get_char(scanner); 1080 1088 } else if(pj_cis_match(spec, *scanner->curptr)) { 1081 1089 parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue); … … 1158 1166 } 1159 1167 1168 /* Parse host part: 1169 * host = hostname / IPv4address / IPv6reference 1170 */ 1171 static void int_parse_host(pj_scanner *scanner, pj_str_t *host) 1172 { 1173 if (*scanner->curptr == '[') { 1174 /* Note: the '[' and ']' characters are removed from the host */ 1175 pj_scan_get_char(scanner); 1176 pj_scan_get_until_ch(scanner, ']', host); 1177 pj_scan_get_char(scanner); 1178 } else { 1179 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, host); 1180 } 1181 } 1182 1160 1183 /* Parse host:port in URI. */ 1161 1184 static void int_parse_uri_host_port( pj_scanner *scanner, 1162 1185 pj_str_t *host, int *p_port) 1163 1186 { 1164 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, host); 1187 int_parse_host(scanner, host); 1188 1165 1189 /* RFC3261 section 19.1.2: host don't need to be unescaped */ 1166 1190 if (*scanner->curptr == ':') { … … 1843 1867 pj_str_t pname, pvalue; 1844 1868 1845 int_parse_param( scanner, pool, &pname, &pvalue, 0); 1869 //Parse with PARAM_CHAR instead, to allow IPv6 1870 //int_parse_param( scanner, pool, &pname, &pvalue, 0); 1871 /* Get ';' character */ 1872 pj_scan_get_char(scanner); 1873 1874 parse_param_imp(scanner, pool, &pname, &pvalue, 1875 &pconst.pjsip_PARAM_CHAR_SPEC, 1876 &pconst.pjsip_PARAM_CHAR_SPEC_ESC, 0); 1846 1877 1847 1878 if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) { … … 1984 2015 1985 2016 pj_scan_get( scanner, &pconst.pjsip_TOKEN_SPEC, &hdr->transport); 1986 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, &hdr->sent_by.host);2017 int_parse_host(scanner, &hdr->sent_by.host); 1987 2018 1988 2019 if (*scanner->curptr==':') { -
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r1602 r1610 226 226 if (ip_addr_ver || resolver->res == NULL) { 227 227 228 pj_in_addr ip_addr;228 char ip_addr[PJ_INET6_ADDRSTRLEN]; 229 229 int af; 230 230 pj_addrinfo ai; … … 272 272 273 273 /* Call the callback. */ 274 ip_addr = ((pj_sockaddr_in*)&svr_addr.entry[0].addr)->sin_addr;275 274 PJ_LOG(5,(THIS_FILE, 276 275 "Target '%.*s:%d' type=%s resolved to " 277 "'%s:%d' type=%s ",276 "'%s:%d' type=%s (%s)", 278 277 (int)target->addr.host.slen, 279 278 target->addr.host.ptr, 280 279 target->addr.port, 281 280 pjsip_transport_get_type_name(target->type), 282 pj_inet_ntoa(ip_addr), 281 pj_inet_ntop2(af, pj_sockaddr_get_addr(&svr_addr.entry[0].addr), 282 ip_addr, sizeof(ip_addr)), 283 283 srv_port, 284 pjsip_transport_get_type_name(type))); 284 pjsip_transport_get_type_name(type), 285 pjsip_transport_get_type_desc(type))); 285 286 svr_addr.count = 1; 286 287 svr_addr.entry[0].priority = 0; 287 288 svr_addr.entry[0].weight = 0; 288 289 svr_addr.entry[0].type = type; 289 svr_addr.entry[0].addr_len = sizeof(pj_sockaddr_in);290 svr_addr.entry[0].addr_len = pj_sockaddr_get_len(&svr_addr.entry[0].addr); 290 291 (*cb)(status, token, &svr_addr); 291 292 -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1602 r1610 273 273 PJ_DEF(int) pjsip_transport_type_get_af(pjsip_transport_type_e type) 274 274 { 275 if (type |PJSIP_TRANSPORT_IPV6)275 if (type & PJSIP_TRANSPORT_IPV6) 276 276 return pj_AF_INET6(); 277 277 else … … 1159 1159 } 1160 1160 1161 return PJ_SUCCESS;1161 return status; 1162 1162 } 1163 1163 -
pjproject/trunk/pjsip/src/pjsip/sip_uri.c
r1417 r1610 266 266 /* Print host. */ 267 267 pj_assert(url->host.slen != 0); 268 copy_advance_check(buf, url->host); 268 /* Detect IPv6 IP address */ 269 if (pj_memchr(url->host.ptr, ':', url->host.slen)) { 270 copy_advance_pair_quote_cond(buf, "", 0, url->host, '[', ']'); 271 } else { 272 copy_advance_check(buf, url->host); 273 } 269 274 270 275 /* Only print port if it is explicitly specified. … … 312 317 313 318 /* maddr param is not allowed in From and To header. */ 314 if (context != PJSIP_URI_IN_FROMTO_HDR) { 315 copy_advance_pair_escape(buf, ";maddr=", 7, url->maddr_param, 316 pc->pjsip_PARAM_CHAR_SPEC); 319 if (context != PJSIP_URI_IN_FROMTO_HDR && url->maddr_param.slen) { 320 /* Detect IPv6 IP address */ 321 if (pj_memchr(url->maddr_param.ptr, ':', url->maddr_param.slen)) { 322 copy_advance_pair_quote_cond(buf, ";maddr=", 7, url->maddr_param, 323 '[', ']'); 324 } else { 325 copy_advance_pair_escape(buf, ";maddr=", 7, url->maddr_param, 326 pc->pjsip_PARAM_CHAR_SPEC); 327 } 317 328 } 318 329 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r1569 r1610 326 326 pjsua_acc_config cfg; 327 327 pjsua_transport_data *t = &pjsua_var.tpdata[tid]; 328 const char *beginquote, *endquote; 329 char transport_param[32]; 328 330 char uri[PJSIP_MAX_URL_SIZE]; 329 331 … … 340 342 --cfg.priority; 341 343 344 /* Enclose IPv6 address in square brackets */ 345 if (t->type & PJSIP_TRANSPORT_IPV6) { 346 beginquote = "["; 347 endquote = "]"; 348 } else { 349 beginquote = endquote = ""; 350 } 351 352 /* Don't add transport parameter if it's UDP */ 353 if ((t->type & PJSIP_TRANSPORT_UDP) == 0) { 354 pj_ansi_snprintf(transport_param, sizeof(transport_param), 355 ";transport=%s", 356 pjsip_transport_get_type_name(t->type)); 357 } else { 358 transport_param[0] = '\0'; 359 } 360 342 361 /* Build URI for the account */ 343 362 pj_ansi_snprintf(uri, PJSIP_MAX_URL_SIZE, 344 "<sip:%.*s:%d;transport=%s>", 363 "<sip:%s%.*s%s:%d%s>", 364 beginquote, 345 365 (int)t->local_name.host.slen, 346 366 t->local_name.host.ptr, 367 endquote, 347 368 t->local_name.port, 348 pjsip_transport_get_type_name(t->type));369 transport_param); 349 370 350 371 cfg.id = pj_str(uri); … … 1362 1383 int secure; 1363 1384 int local_port; 1385 const char *beginquote, *endquote; 1386 char transport_param[32]; 1387 1364 1388 1365 1389 PJ_ASSERT_RETURN(pjsua_acc_is_valid(acc_id), PJ_EINVAL); … … 1406 1430 return PJSIP_EUNSUPTRANSPORT; 1407 1431 1432 /* If destination URI specifies IPv6, then set transport type 1433 * to use IPv6 as well. 1434 */ 1435 if (pj_strchr(suri, ':')) 1436 tp_type = (pjsip_transport_type_e)(((int)tp_type) + PJSIP_TRANSPORT_IPV6); 1437 1408 1438 flag = pjsip_transport_get_flag_from_type(tp_type); 1409 1439 secure = (flag & PJSIP_TRANSPORT_SECURE) != 0; … … 1419 1449 return status; 1420 1450 1451 /* Enclose IPv6 address in square brackets */ 1452 if (tp_type & PJSIP_TRANSPORT_IPV6) { 1453 beginquote = "["; 1454 endquote = "]"; 1455 } else { 1456 beginquote = endquote = ""; 1457 } 1458 1459 /* Don't add transport parameter if it's UDP */ 1460 if ((tp_type & PJSIP_TRANSPORT_UDP) == 0) { 1461 pj_ansi_snprintf(transport_param, sizeof(transport_param), 1462 ";transport=%s", 1463 pjsip_transport_get_type_name(tp_type)); 1464 } else { 1465 transport_param[0] = '\0'; 1466 } 1467 1468 1421 1469 /* Create the contact header */ 1422 1470 contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1423 1471 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1424 "%.*s%s<%s:%.*s%s% .*s:%d;transport=%s>",1472 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s>", 1425 1473 (int)acc->display.slen, 1426 1474 acc->display.ptr, … … 1430 1478 acc->user_part.ptr, 1431 1479 (acc->user_part.slen?"@":""), 1480 beginquote, 1432 1481 (int)local_addr.slen, 1433 1482 local_addr.ptr, 1483 endquote, 1434 1484 local_port, 1435 pjsip_transport_get_type_name(tp_type));1485 transport_param); 1436 1486 1437 1487 return PJ_SUCCESS; … … 1462 1512 int secure; 1463 1513 int local_port; 1514 const char *beginquote, *endquote; 1515 char transport_param[32]; 1464 1516 1465 1517 PJ_ASSERT_RETURN(pjsua_acc_is_valid(acc_id), PJ_EINVAL); … … 1509 1561 } else 1510 1562 tp_type = pjsip_transport_get_type_from_name(&sip_uri->transport_param); 1511 1563 1512 1564 if (tp_type == PJSIP_TRANSPORT_UNSPECIFIED) 1513 1565 return PJSIP_EUNSUPTRANSPORT; 1566 1567 /* If destination URI specifies IPv6, then set transport type 1568 * to use IPv6 as well. 1569 */ 1570 if (pj_strchr(&sip_uri->host, ':')) 1571 tp_type = (pjsip_transport_type_e)(((int)tp_type) + PJSIP_TRANSPORT_IPV6); 1514 1572 1515 1573 flag = pjsip_transport_get_flag_from_type(tp_type); … … 1526 1584 return status; 1527 1585 1586 /* Enclose IPv6 address in square brackets */ 1587 if (tp_type & PJSIP_TRANSPORT_IPV6) { 1588 beginquote = "["; 1589 endquote = "]"; 1590 } else { 1591 beginquote = endquote = ""; 1592 } 1593 1594 /* Don't add transport parameter if it's UDP */ 1595 if ((tp_type & PJSIP_TRANSPORT_UDP) == 0) { 1596 pj_ansi_snprintf(transport_param, sizeof(transport_param), 1597 ";transport=%s", 1598 pjsip_transport_get_type_name(tp_type)); 1599 } else { 1600 transport_param[0] = '\0'; 1601 } 1602 1603 1528 1604 /* Create the contact header */ 1529 1605 contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1530 1606 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1531 "%.*s%s<%s:%.*s%s% .*s:%d;transport=%s>",1607 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s>", 1532 1608 (int)acc->display.slen, 1533 1609 acc->display.ptr, … … 1537 1613 acc->user_part.ptr, 1538 1614 (acc->user_part.slen?"@":""), 1615 beginquote, 1539 1616 (int)local_addr.slen, 1540 1617 local_addr.ptr, 1618 endquote, 1541 1619 local_port, 1542 pjsip_transport_get_type_name(tp_type));1620 transport_param); 1543 1621 1544 1622 return PJ_SUCCESS; -
pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
r1451 r1610 701 701 702 702 703 #if INCLUDE_BENCHMARKS 703 704 static int msg_benchmark(unsigned *p_detect, unsigned *p_parse, 704 705 unsigned *p_print) … … 776 777 return status; 777 778 } 779 #endif /* INCLUDE_BENCHMARKS */ 778 780 779 781 /*****************************************************************************/ … … 796 798 static int hdr_test_to(pjsip_hdr *h); 797 799 static int hdr_test_via(pjsip_hdr *h); 798 800 static int hdr_test_via_ipv6_1(pjsip_hdr *h); 801 static int hdr_test_via_ipv6_2(pjsip_hdr *h); 802 static int hdr_test_via_ipv6_3(pjsip_hdr *h); 799 803 800 804 801 805 #define GENERIC_PARAM "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3" 802 806 #define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab:cd;p3" 803 #define PARAM_CHAR " []/:&+$"807 #define PARAM_CHAR "][/:&+$" 804 808 #define SIMPLE_ADDR_SPEC "sip:host" 805 809 #define ADDR_SPEC SIMPLE_ADDR_SPEC ";"PARAM_CHAR"="PARAM_CHAR ";p1=\";\"" … … 948 952 "SIP/2.0/XYZ host" ";" GENERIC_PARAM, 949 953 &hdr_test_via 954 }, 955 956 { 957 /* Via with IPv6 */ 958 "Via", "v", 959 "SIP/2.0/UDP [::1]", 960 &hdr_test_via_ipv6_1 961 }, 962 963 { 964 /* Via with IPv6 */ 965 "Via", "v", 966 "SIP/2.0/UDP [::1]:5061", 967 &hdr_test_via_ipv6_2 968 }, 969 970 { 971 /* Via with IPv6 */ 972 "Via", "v", 973 "SIP/2.0/UDP [::1];rport=5061;received=::2", 974 &hdr_test_via_ipv6_3 950 975 } 951 976 }; … … 1112 1137 1113 1138 /* 1114 #define PARAM_CHAR " []/:&+$"1139 #define PARAM_CHAR "][/:&+$" 1115 1140 #define SIMPLE_ADDR_SPEC "sip:host" 1116 1141 #define ADDR_SPEC SIMPLE_ADDR_SPEC ";"PARAM_CHAR"="PARAM_CHAR ";p1=\";\"" … … 1433 1458 } 1434 1459 1460 1461 /* 1462 "SIP/2.0/UDP [::1]" 1463 */ 1464 static int hdr_test_via_ipv6_1(pjsip_hdr *h) 1465 { 1466 pjsip_via_hdr *hdr = (pjsip_via_hdr*)h; 1467 1468 if (h->type != PJSIP_H_VIA) 1469 return -2610; 1470 1471 if (pj_strcmp2(&hdr->transport, "UDP")) 1472 return -2615; 1473 1474 if (pj_strcmp2(&hdr->sent_by.host, "::1")) 1475 return -2620; 1476 1477 if (hdr->sent_by.port != 0) 1478 return -2630; 1479 1480 return 0; 1481 } 1482 1483 /* "SIP/2.0/UDP [::1]:5061" */ 1484 static int hdr_test_via_ipv6_2(pjsip_hdr *h) 1485 { 1486 pjsip_via_hdr *hdr = (pjsip_via_hdr*)h; 1487 1488 if (h->type != PJSIP_H_VIA) 1489 return -2710; 1490 1491 if (pj_strcmp2(&hdr->transport, "UDP")) 1492 return -2715; 1493 1494 if (pj_strcmp2(&hdr->sent_by.host, "::1")) 1495 return -2720; 1496 1497 if (hdr->sent_by.port != 5061) 1498 return -2730; 1499 1500 return 0; 1501 } 1502 1503 /* "SIP/2.0/UDP [::1];rport=5061;received=::2" */ 1504 static int hdr_test_via_ipv6_3(pjsip_hdr *h) 1505 { 1506 pjsip_via_hdr *hdr = (pjsip_via_hdr*)h; 1507 1508 if (h->type != PJSIP_H_VIA) 1509 return -2810; 1510 1511 if (pj_strcmp2(&hdr->transport, "UDP")) 1512 return -2815; 1513 1514 if (pj_strcmp2(&hdr->sent_by.host, "::1")) 1515 return -2820; 1516 1517 if (hdr->sent_by.port != 0) 1518 return -2830; 1519 1520 if (pj_strcmp2(&hdr->recvd_param, "::2")) 1521 return -2840; 1522 1523 if (hdr->rport_param != 5061) 1524 return -2850; 1525 1526 return 0; 1527 } 1435 1528 1436 1529 static int hdr_test(void) … … 1534 1627 pj_status_t status; 1535 1628 1629 status = hdr_test(); 1630 if (status != 0) 1631 return status; 1632 1536 1633 status = simple_test(); 1537 1634 if (status != PJ_SUCCESS) 1538 1635 return status; 1539 1636 1540 status = hdr_test(); 1541 if (status != 0) 1542 return status; 1543 1637 #if INCLUDE_BENCHMARKS 1544 1638 for (i=0; i<COUNT; ++i) { 1545 1639 PJ_LOG(3,(THIS_FILE, " benchmarking (%d of %d)..", i+1, COUNT)); … … 1609 1703 "The value is derived from msg-print-per-sec above."); 1610 1704 1705 #endif /* INCLUDE_BENCHMARKS */ 1611 1706 1612 1707 return PJ_SUCCESS; -
pjproject/trunk/pjsip/src/test-pjsip/test.h
r1469 r1610 41 41 #define INCLUDE_TSX_GROUP 1 42 42 #define INCLUDE_INV_GROUP 1 43 44 #define INCLUDE_BENCHMARKS 1 43 45 44 46 /* -
pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
r1373 r1610 77 77 static pjsip_uri *create_uri33( pj_pool_t *pool ); 78 78 static pjsip_uri *create_uri34( pj_pool_t *pool ); 79 //static pjsip_uri *create_uri35( pj_pool_t *pool ); 79 static pjsip_uri *create_uri35( pj_pool_t *pool ); 80 static pjsip_uri *create_uri36( pj_pool_t *pool ); 80 81 static pjsip_uri *create_dummy( pj_pool_t *pool ); 81 82 … … 319 320 "tel:911;p1=p1;p2=p2" 320 321 }, 321 322 { 323 /* 35: IPv6 in host and maddr parameter */ 324 PJ_SUCCESS, 325 "sip:user@[::1];maddr=[::01]", 326 &create_uri35, 327 "sip:user@[::1];maddr=[::01]" 328 }, 329 { 330 /* 36: IPv6 in host and maddr, without username */ 331 PJ_SUCCESS, 332 "sip:[::1];maddr=[::01]", 333 &create_uri36, 334 "sip:[::1];maddr=[::01]" 335 } 336 322 337 }; 323 338 … … 670 685 } 671 686 687 /* "sip:user@[::1];maddr=[::01]" */ 688 static pjsip_uri *create_uri35( pj_pool_t *pool ) 689 { 690 pjsip_sip_uri *url; 691 url = pjsip_sip_uri_create(pool, 0); 692 url->user = pj_str("user"); 693 url->host = pj_str("::1"); 694 url->maddr_param = pj_str("::01"); 695 return (pjsip_uri*)url; 696 } 697 698 /* "sip:[::1];maddr=[::01]" */ 699 static pjsip_uri *create_uri36( pj_pool_t *pool ) 700 { 701 pjsip_sip_uri *url; 702 url = pjsip_sip_uri_create(pool, 0); 703 url->host = pj_str("::1"); 704 url->maddr_param = pj_str("::01"); 705 return (pjsip_uri*)url; 706 707 } 672 708 673 709 static pjsip_uri *create_dummy(pj_pool_t *pool) … … 825 861 } 826 862 863 #if INCLUDE_BENCHMARKS 827 864 static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp) 828 865 { … … 910 947 return status; 911 948 } 912 949 #endif /* INCLUDE_BENCHMARKS */ 913 950 914 951 /*****************************************************************************/ … … 930 967 return status; 931 968 969 #if INCLUDE_BENCHMARKS 932 970 for (i=0; i<COUNT; ++i) { 933 971 PJ_LOG(3,(THIS_FILE, " benchmarking (%d of %d)...", i+1, COUNT)); … … 994 1032 report_ival("uri-cmp-per-sec", max, "URI/sec", desc); 995 1033 1034 #endif /* INCLUDE_BENCHMARKS */ 1035 996 1036 return PJ_SUCCESS; 997 1037 }
Note: See TracChangeset
for help on using the changeset viewer.