Ignore:
Timestamp:
Nov 21, 2005 1:55:47 AM (18 years ago)
Author:
bennylp
Message:

Set svn:eol-style property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/test-pjsip/uri.c

    • Property svn:eol-style set to native
    r64 r65  
    2626                    "0123456789" 
    2727#define MARK        "-_.!~*'()" 
    28 #define USER        "&=+$,;?/%" 
    29 #define PASS        "&=+$,%" 
    30 #define PARAM_CHAR  "[]/:&+$" MARK "%" 
    31  
    32 #define POOL_SIZE       4096 
    33  
    34 static pj_uint32_t parse_len, parse_time, print_time; 
     28#define USER_CHAR   ALPHANUM MARK "&=+$,;?/" 
     29#define PASS_CHAR   ALPHANUM MARK "&=+$," 
     30#define PARAM_CHAR  ALPHANUM MARK "[]/:&+$" 
     31 
     32#define POOL_SIZE       4000 
     33#define LOOP_COUNT      1000 
     34#define AVERAGE_URL_LEN 80 
     35#define THREAD_COUNT    4 
     36 
     37static pj_uint32_t parse_len; 
     38static pj_timestamp parse_time, print_time; 
    3539 
    3640 
    3741/* URI creator functions. */ 
     42static pjsip_uri *create_uri0( pj_pool_t *pool ); 
    3843static pjsip_uri *create_uri1( pj_pool_t *pool ); 
    3944static pjsip_uri *create_uri2( pj_pool_t *pool ); 
     
    5358static pjsip_uri *create_uri16( pj_pool_t *pool ); 
    5459static pjsip_uri *create_uri17( pj_pool_t *pool ); 
    55 static pjsip_uri *create_uri18( pj_pool_t *pool ); 
    56 static pjsip_uri *create_uri19( pj_pool_t *pool ); 
    5760static pjsip_uri *create_dummy( pj_pool_t *pool ); 
    5861 
     
    7174        PJ_SUCCESS, 
    7275        "sip:localhost", 
     76        &create_uri0 
     77    }, 
     78    { 
     79        PJ_SUCCESS, 
     80        "sip:user@localhost", 
    7381        &create_uri1 
    7482    }, 
    7583    { 
    7684        PJ_SUCCESS, 
    77         "sip:user@localhost", 
    78         &create_uri2 
    79     }, 
    80     { 
    81         PJ_SUCCESS, 
    8285        "sip:user:password@localhost:5060", 
    83         &create_uri3, 
     86        &create_uri2, 
    8487    }, 
    8588    { 
     
    8790        ERR_NOT_EQUAL, 
    8891        "sip:localhost:5060", 
     92        &create_uri3 
     93    }, 
     94    { 
     95        /* All recognized parameters. */ 
     96        PJ_SUCCESS, 
     97        "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK", 
    8998        &create_uri4 
    90     }, 
    91     { 
    92         /* All recognized parameters. */ 
    93         PJ_SUCCESS, 
    94         "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK", 
    95         &create_uri5 
    9699    }, 
    97100    { 
     
    100103        "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry" 
    101104        "?Subject=Hello%20There&Server=SIP%20Server", 
    102         &create_uri6 
     105        &create_uri5 
    103106    }, 
    104107    { 
     
    106109        PJ_SUCCESS, 
    107110        "sips:localhost", 
    108         &create_uri7, 
     111        &create_uri6, 
    109112    }, 
    110113    { 
     
    112115        PJ_SUCCESS, 
    113116        "<sip:localhost>", 
    114         &create_uri8 
     117        &create_uri7 
    115118    }, 
    116119    { 
     
    120123        PJ_SUCCESS, 
    121124        "  Power Administrator  <sips:localhost>", 
     125        &create_uri8 
     126    }, 
     127    { 
     128        /* Name address. */ 
     129        PJ_SUCCESS, 
     130        " \"User\" <sip:user@localhost:5071>", 
    122131        &create_uri9 
    123132    }, 
    124133    { 
    125         /* Name address. */ 
    126         PJ_SUCCESS, 
    127         " \"User\" <sip:user@localhost:5071>", 
    128         &create_uri10 
    129     }, 
    130     { 
    131134        /* Escaped sequence in display name (display=Strange User\"\\\"). */ 
    132135        PJ_SUCCESS, 
    133136        " \"Strange User\\\"\\\\\\\"\" <sip:localhost>", 
     137        &create_uri10, 
     138    }, 
     139    { 
     140        /* Errorneous escaping in display name. */ 
     141        ERR_SYNTAX_ERR, 
     142        " \"Rogue User\\\" <sip:localhost>", 
    134143        &create_uri11, 
    135144    }, 
    136145    { 
    137         /* Errorneous escaping in display name. */ 
    138         ERR_SYNTAX_ERR, 
    139         " \"Rogue User\\\" <sip:localhost>", 
     146        /* Dangling quote in display name, but that should be OK. */ 
     147        PJ_SUCCESS, 
     148        "Strange User\" <sip:localhost>", 
    140149        &create_uri12, 
    141150    }, 
    142151    { 
    143         /* Dangling quote in display name, but that should be OK. */ 
    144         PJ_SUCCESS, 
    145         "Strange User\" <sip:localhost>", 
     152        /* Special characters in parameter value must be quoted. */ 
     153        PJ_SUCCESS, 
     154        "sip:localhost;pvalue=\"hello world\"", 
    146155        &create_uri13, 
    147     }, 
    148     { 
    149         /* Special characters in parameter value must be quoted. */ 
    150         PJ_SUCCESS, 
    151         "sip:localhost;pvalue=\"hello world\"", 
    152         &create_uri14, 
    153156    }, 
    154157    { 
     
    157160         */ 
    158161        PJ_SUCCESS, 
    159         "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@" 
     162        "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@" 
    160163        "my_proxy09.MY-domain.com:9801>", 
     164        &create_uri14, 
     165    }, 
     166    { 
     167        /* Another excercise to the allowed character sets to the hostname. */ 
     168        PJ_SUCCESS, 
     169        "sip:" ALPHANUM "-_.com", 
    161170        &create_uri15, 
    162     }, 
    163     { 
    164         /* Another excercise to the allowed character sets to the hostname. */ 
    165         PJ_SUCCESS, 
    166         "sip:" ALPHANUM "-_.com", 
    167         &create_uri16, 
    168171    }, 
    169172    { 
     
    172175         */ 
    173176        PJ_SUCCESS, 
    174         "sip:" ALPHANUM USER ":" ALPHANUM PASS "@host", 
    175         &create_uri17, 
     177        "sip:" USER_CHAR ":" PASS_CHAR "@host", 
     178        &create_uri16, 
    176179    }, 
    177180    { 
     
    180183         */ 
    181184        PJ_SUCCESS, 
    182         "sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR  
     185        "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21" 
    183186        ";lr;other=1;transport=sctp;other2", 
    184         &create_uri18, 
    185     }, 
    186     { 
    187         /* This should trigger syntax error. */ 
     187        &create_uri17, 
     188    }, 
     189    { 
     190        /* 18: This should trigger syntax error. */ 
    188191        ERR_SYNTAX_ERR, 
    189192        "sip:", 
     
    191194    }, 
    192195    { 
    193         /* Syntax error: whitespace after scheme. */ 
     196        /* 19: Syntax error: whitespace after scheme. */ 
    194197        ERR_SYNTAX_ERR, 
    195198        "sip :host", 
     
    197200    }, 
    198201    { 
    199         /* Syntax error: whitespace before hostname. */ 
     202        /* 20: Syntax error: whitespace before hostname. */ 
    200203        ERR_SYNTAX_ERR, 
    201204        "sip: host", 
     
    203206    }, 
    204207    { 
    205         /* Syntax error: invalid port. */ 
     208        /* 21: Syntax error: invalid port. */ 
    206209        ERR_SYNTAX_ERR, 
    207210        "sip:user:password", 
     
    209212    }, 
    210213    { 
    211         /* Syntax error: no host. */ 
     214        /* 22: Syntax error: no host. */ 
    212215        ERR_SYNTAX_ERR, 
    213216        "sip:user@", 
     
    215218    }, 
    216219    { 
    217         /* Syntax error: no user/host. */ 
     220        /* 23: Syntax error: no user/host. */ 
    218221        ERR_SYNTAX_ERR, 
    219222        "sip:@", 
     
    221224    }, 
    222225    { 
    223         /* Syntax error: empty string. */ 
     226        /* 24: Syntax error: empty string. */ 
    224227        ERR_SYNTAX_ERR, 
    225228        "", 
     
    228231}; 
    229232 
    230 static pjsip_uri *create_uri1(pj_pool_t *pool) 
     233static pjsip_uri *create_uri0(pj_pool_t *pool) 
    231234{ 
    232235    /* "sip:localhost" */ 
     
    237240} 
    238241 
    239 static pjsip_uri *create_uri2(pj_pool_t *pool) 
     242static pjsip_uri *create_uri1(pj_pool_t *pool) 
    240243{ 
    241244    /* "sip:user@localhost" */ 
     
    248251} 
    249252 
    250 static pjsip_uri *create_uri3(pj_pool_t *pool) 
     253static pjsip_uri *create_uri2(pj_pool_t *pool) 
    251254{ 
    252255    /* "sip:user:password@localhost:5060" */ 
     
    261264} 
    262265 
    263 static pjsip_uri *create_uri4(pj_pool_t *pool) 
     266static pjsip_uri *create_uri3(pj_pool_t *pool) 
    264267{ 
    265268    /* Like: "sip:localhost:5060", but without the port. */ 
     
    270273} 
    271274 
    272 static pjsip_uri *create_uri5(pj_pool_t *pool) 
     275static pjsip_uri *create_uri4(pj_pool_t *pool) 
    273276{ 
    274277    /* "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK" */ 
     
    286289} 
    287290 
    288 static pjsip_uri *create_uri6(pj_pool_t *pool) 
     291#define param_add(list,pname,pvalue)  \ 
     292        do { \ 
     293            pjsip_param *param; \ 
     294            param=pj_pool_alloc(pool, sizeof(pjsip_param)); \ 
     295            param->name = pj_str(pname); \ 
     296            param->value = pj_str(pvalue); \ 
     297            pj_list_insert_before(&list, param); \ 
     298        } while (0) 
     299 
     300static pjsip_uri *create_uri5(pj_pool_t *pool) 
    289301{ 
    290302    /* "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry" 
     
    295307    pj_strdup2(pool, &url->host, "localhost"); 
    296308    pj_strdup2(pool, &url->user_param, "phone"); 
    297     pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry"); 
    298     pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server"); 
    299     return (pjsip_uri*)url; 
    300  
    301 } 
    302  
    303 static pjsip_uri *create_uri7(pj_pool_t *pool) 
     309 
     310    //pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry"); 
     311    param_add(url->other_param, "pickup", "hurry"); 
     312    param_add(url->other_param, "message", "I am sorry"); 
     313 
     314    //pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server"); 
     315    param_add(url->header_param, "Subject", "Hello There"); 
     316    param_add(url->header_param, "Server", "SIP Server"); 
     317    return (pjsip_uri*)url; 
     318 
     319} 
     320 
     321static pjsip_uri *create_uri6(pj_pool_t *pool) 
    304322{ 
    305323    /* "sips:localhost" */ 
     
    310328} 
    311329 
    312 static pjsip_uri *create_uri8(pj_pool_t *pool) 
     330static pjsip_uri *create_uri7(pj_pool_t *pool) 
    313331{ 
    314332    /* "<sip:localhost>" */ 
     
    323341} 
    324342 
    325 static pjsip_uri *create_uri9(pj_pool_t *pool) 
     343static pjsip_uri *create_uri8(pj_pool_t *pool) 
    326344{ 
    327345    /* "  Power Administrator <sips:localhost>" */ 
     
    337355} 
    338356 
    339 static pjsip_uri *create_uri10(pj_pool_t *pool) 
     357static pjsip_uri *create_uri9(pj_pool_t *pool) 
    340358{ 
    341359    /* " \"User\" <sip:user@localhost:5071>" */ 
     
    346364    name_addr->uri = (pjsip_uri*) url; 
    347365 
    348     pj_strdup2(pool, &name_addr->display, "\"User\""); 
     366    pj_strdup2(pool, &name_addr->display, "User"); 
    349367    pj_strdup2(pool, &url->user, "user"); 
    350368    pj_strdup2(pool, &url->host, "localhost"); 
     
    353371} 
    354372 
    355 static pjsip_uri *create_uri11(pj_pool_t *pool) 
     373static pjsip_uri *create_uri10(pj_pool_t *pool) 
    356374{ 
    357375    /* " \"Strange User\\\"\\\\\\\"\" <sip:localhost>" */ 
     
    362380    name_addr->uri = (pjsip_uri*) url; 
    363381 
    364     pj_strdup2(pool, &name_addr->display, "\"Strange User\\\"\\\\\\\"\""); 
     382    pj_strdup2(pool, &name_addr->display, "Strange User\\\"\\\\\\\""); 
    365383    pj_strdup2(pool, &url->host, "localhost"); 
    366384    return (pjsip_uri*)name_addr; 
    367385} 
    368386 
    369 static pjsip_uri *create_uri12(pj_pool_t *pool) 
     387static pjsip_uri *create_uri11(pj_pool_t *pool) 
    370388{ 
    371389    /* " \"Rogue User\\\" <sip:localhost>" */ 
     
    376394    name_addr->uri = (pjsip_uri*) url; 
    377395 
    378     pj_strdup2(pool, &name_addr->display, "\"Rogue User\\\""); 
     396    pj_strdup2(pool, &name_addr->display, "Rogue User\\"); 
    379397    pj_strdup2(pool, &url->host, "localhost"); 
    380398    return (pjsip_uri*)name_addr; 
    381399} 
    382400 
    383 static pjsip_uri *create_uri13(pj_pool_t *pool) 
     401static pjsip_uri *create_uri12(pj_pool_t *pool) 
    384402{ 
    385403    /* "Strange User\" <sip:localhost>" */ 
     
    395413} 
    396414 
     415static pjsip_uri *create_uri13(pj_pool_t *pool) 
     416{ 
     417    /* "sip:localhost;pvalue=\"hello world\"" */ 
     418    pjsip_url *url; 
     419    url = pjsip_url_create(pool, 0); 
     420    pj_strdup2(pool, &url->host, "localhost"); 
     421    //pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\""); 
     422    param_add(url->other_param, "pvalue", "hello world"); 
     423    return (pjsip_uri*)url; 
     424} 
     425 
    397426static pjsip_uri *create_uri14(pj_pool_t *pool) 
    398427{ 
    399     /* "sip:localhost;pvalue=\"hello world\"" */ 
    400     pjsip_url *url; 
    401     url = pjsip_url_create(pool, 0); 
    402     pj_strdup2(pool, &url->host, "localhost"); 
    403     pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\""); 
    404     return (pjsip_uri*)url; 
    405 } 
    406  
    407 static pjsip_uri *create_uri15(pj_pool_t *pool) 
    408 { 
    409     /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@my_proxy09.my-domain.com:9801>" */ 
     428    /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@my_proxy09.my-domain.com:9801>" */ 
    410429    pjsip_name_addr *name_addr = pjsip_name_addr_create(pool); 
    411430    pjsip_url *url; 
     
    415434 
    416435    pj_strdup2(pool, &name_addr->display, "This is -. !% *_+`'~ me"); 
    417     pj_strdup2(pool, &url->user, "a19A&=+$,;?/%2c"); 
    418     pj_strdup2(pool, &url->passwd, "%09a&Zz=+$,"); 
     436    pj_strdup2(pool, &url->user, "a19A&=+$,;?/,"); 
     437    pj_strdup2(pool, &url->passwd, "@a&Zz=+$,"); 
    419438    pj_strdup2(pool, &url->host, "my_proxy09.MY-domain.com"); 
    420439    url->port = 9801; 
     
    422441} 
    423442 
     443static pjsip_uri *create_uri15(pj_pool_t *pool) 
     444{ 
     445    /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */ 
     446    pjsip_url *url; 
     447    url = pjsip_url_create(pool, 0); 
     448    pj_strdup2(pool, &url->host, ALPHANUM "-_.com"); 
     449    return (pjsip_uri*)url; 
     450} 
     451 
    424452static pjsip_uri *create_uri16(pj_pool_t *pool) 
    425453{ 
    426     /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */ 
    427     pjsip_url *url; 
    428     url = pjsip_url_create(pool, 0); 
    429     pj_strdup2(pool, &url->host, ALPHANUM "-_.com"); 
     454    /* "sip:" USER_CHAR ":" PASS_CHAR "@host" */ 
     455    pjsip_url *url; 
     456    url = pjsip_url_create(pool, 0); 
     457    pj_strdup2(pool, &url->user, USER_CHAR); 
     458    pj_strdup2(pool, &url->passwd, PASS_CHAR); 
     459    pj_strdup2(pool, &url->host, "host"); 
    430460    return (pjsip_uri*)url; 
    431461} 
     
    433463static pjsip_uri *create_uri17(pj_pool_t *pool) 
    434464{ 
    435     /* "sip:" ALPHANUM USER ":" ALPHANUM PASS "@host" */ 
    436     pjsip_url *url; 
    437     url = pjsip_url_create(pool, 0); 
    438     pj_strdup2(pool, &url->user, ALPHANUM USER); 
    439     pj_strdup2(pool, &url->passwd, ALPHANUM PASS); 
    440     pj_strdup2(pool, &url->host, "host"); 
    441     return (pjsip_uri*)url; 
    442 } 
    443  
    444 static pjsip_uri *create_uri18(pj_pool_t *pool) 
    445 { 
    446     /* "sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";lr;other=1;transport=sctp;other2" */ 
     465    /* "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21;lr;other=1;transport=sctp;other2" */ 
    447466    pjsip_url *url; 
    448467    url = pjsip_url_create(pool, 0); 
     
    450469    pj_strdup2(pool, &url->user_param, "ip"); 
    451470    pj_strdup2(pool, &url->transport_param, "sctp"); 
    452     pj_strdup2(pool, &url->other_param, ";" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";other=1;other2");     
     471    param_add(url->other_param, PARAM_CHAR "!", PARAM_CHAR "!"); 
     472    param_add(url->other_param, "other", "1"); 
     473    param_add(url->other_param, "other2", ""); 
    453474    url->lr_param = 1; 
    454475    return (pjsip_uri*)url; 
     
    485506         */ 
    486507        status = entry->status==ERR_SYNTAX_ERR ? PJ_SUCCESS : -10; 
     508        if (status != 0) { 
     509            PJ_LOG(3,("", "   uri parse error!\n" 
     510                          "   uri='%s'\n", 
     511                          entry->str)); 
     512        } 
    487513        goto on_return; 
    488514    } 
    489515    pj_get_timestamp(&t2); 
    490     parse_time += t2.u32.lo - t1.u32.lo; 
     516    pj_sub_timestamp(&t2, &t1); 
     517    pj_add_timestamp(&parse_time, &t2); 
    491518 
    492519    /* Create the reference URI. */ 
     
    503530        goto on_return; 
    504531    } 
     532    s1.ptr[len] = '\0'; 
    505533    s1.slen = len; 
     534 
     535    pj_get_timestamp(&t2); 
     536    pj_sub_timestamp(&t2, &t1); 
     537    pj_add_timestamp(&print_time, &t2); 
    506538 
    507539    len = pjsip_uri_print( PJSIP_URI_IN_OTHER, ref_uri, s2.ptr, PJSIP_MAX_URL_SIZE); 
     
    510542        goto on_return; 
    511543    } 
     544    s2.ptr[len] = '\0'; 
    512545    s2.slen = len; 
    513     pj_get_timestamp(&t2); 
    514     print_time += t2.u32.lo - t1.u32.lo; 
    515546 
    516547    /* Full comparison of parsed URI with reference URI. */ 
    517     if (pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri) != 0) { 
     548    status = pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri); 
     549    if (status != 0) { 
    518550        /* Not equal. See if this is the expected status. */ 
    519551        status = entry->status==ERR_NOT_EQUAL ? PJ_SUCCESS : -40; 
     552        if (status != 0) { 
     553            PJ_LOG(3,("", "   uri comparison mismatch, status=%d:\n" 
     554                          "    uri1='%s'\n" 
     555                          "    uri2='%s'", 
     556                          status, s1.ptr, s2.ptr)); 
     557        } 
    520558        goto on_return; 
    521559 
     
    540578pj_status_t uri_test() 
    541579{ 
    542     unsigned i; 
     580    unsigned i, loop; 
    543581    pj_pool_t *pool; 
    544582    pj_status_t status; 
    545  
    546     pool = pjsip_endpt_create_pool(endpt, "", 4000, 4000); 
    547  
     583    pj_timestamp zero; 
     584    pj_highprec_t avg_parse, avg_print; 
     585 
     586    zero.u32.hi = zero.u32.lo = 0; 
     587 
     588    PJ_LOG(3,("", "  simple test")); 
     589    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 
    548590    for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 
    549591        status = do_uri_test(pool, &uri_test_array[i]); 
     
    551593            PJ_LOG(3,("uri_test", "  error %d when testing entry %d", 
    552594                      status, i)); 
    553             break; 
     595            goto on_return; 
    554596        } 
    555597    } 
    556  
     598    pjsip_endpt_destroy_pool(endpt, pool); 
     599 
     600    PJ_LOG(3,("", "  benchmarking...")); 
     601    parse_len = 0; 
     602    parse_time.u32.hi = parse_time.u32.lo = 0; 
     603    print_time.u32.hi = print_time.u32.lo = 0; 
     604    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 
     605    for (loop=0; loop<LOOP_COUNT; ++loop) { 
     606        for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 
     607            status = do_uri_test(pool, &uri_test_array[i]); 
     608            if (status != PJ_SUCCESS) { 
     609                PJ_LOG(3,("uri_test", "  error %d when testing entry %d", 
     610                          status, i)); 
     611                goto on_return; 
     612            } 
     613        } 
     614    } 
     615 
     616    avg_parse = pj_elapsed_usec(&zero, &parse_time); 
     617    pj_highprec_mul(avg_parse, AVERAGE_URL_LEN); 
     618    pj_highprec_div(avg_parse, parse_len); 
     619    avg_parse = 1000000 / avg_parse; 
     620 
     621    avg_print = pj_elapsed_usec(&zero, &print_time); 
     622    pj_highprec_mul(avg_print, AVERAGE_URL_LEN); 
     623    pj_highprec_div(avg_print, parse_len); 
     624    avg_print = 1000000 / avg_print; 
     625 
     626    PJ_LOG(3,("", "   done. Average parse=%d url/sec, print=%d url/sec", 
     627                  (unsigned)avg_parse, (unsigned)avg_print)); 
     628 
     629    PJ_LOG(3,("", "  multithreaded test")); 
     630 
     631 
     632on_return: 
    557633    pjsip_endpt_destroy_pool(endpt, pool); 
    558634    return status; 
Note: See TracChangeset for help on using the changeset viewer.