Changeset 1288


Ignore:
Timestamp:
May 22, 2007 9:11:10 PM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #285: ICE transport stops receiving packet upon getting ICMP unreach on Windows

Location:
pjproject/trunk/pjnath/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath-test/ice_test.c

    r1129 r1288  
    293293    /* Start ICE on im2 */ 
    294294    status = start_ice(im2, im1); 
    295     if (status != PJ_SUCCESS) 
     295    if (status != PJ_SUCCESS) { 
     296        app_perror("   error starting ICE", status); 
    296297        return -30; 
     298    } 
    297299 
    298300    /* Start ICE on im1 */ 
     
    329331        data_from_answerer = pj_str("from answerer"); 
    330332        status = pj_ice_sess_send_data(im2->ice, 1, data_from_answerer.ptr, data_from_answerer.slen); 
    331         if (status != PJ_SUCCESS) 
     333        if (status != PJ_SUCCESS) { 
     334            app_perror("   error sending packet", status); 
    332335            return -48; 
     336        } 
    333337 
    334338        /* Poll to allow data to be received */ 
     
    477481 
    478482    /* Failure case (all checks fail) */ 
     483#if 0 
     484    /* Cannot just add an SRFLX candidate; it needs a base */ 
    479485    rc = perform_ice_test("Failure case (all checks fail)", PJ_FALSE, 1, PJ_FALSE, D3, D3, 1, ocand, 1, acand); 
    480486    if (rc != 0) 
    481487        goto on_return; 
     488#endif 
    482489 
    483490    /* Direct communication with invalid address */ 
  • pjproject/trunk/pjnath/src/pjnath-test/test.c

    r1129 r1288  
    6565    pj_caching_pool_init( &caching_pool, &pj_pool_factory_default_policy, 0 ); 
    6666 
     67    pjnath_init(); 
     68 
    6769#if INCLUDE_ICE_TEST 
    6870    DO_TEST(ice_test()); 
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r1248 r1288  
    441441    pj_ice_strans *ice_st = comp->ice_st; 
    442442    pj_ssize_t pkt_size; 
     443    enum { RETRY = 4 }; 
     444    unsigned retry; 
    443445    pj_status_t status; 
    444446 
     
    512514 
    513515    /* Read next packet */ 
    514     pkt_size = sizeof(comp->pkt); 
    515     comp->src_addr_len = sizeof(comp->src_addr); 
    516     status = pj_ioqueue_recvfrom(key, op_key, comp->pkt, &pkt_size,  
    517                                  PJ_IOQUEUE_ALWAYS_ASYNC, 
    518                                  &comp->src_addr, &comp->src_addr_len); 
    519     if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
    520         ice_st_perror(comp->ice_st, "ioqueue recvfrom() error", status); 
     516    for (retry=0; retry<RETRY; ++retry) { 
     517        pkt_size = sizeof(comp->pkt); 
     518        comp->src_addr_len = sizeof(comp->src_addr); 
     519        status = pj_ioqueue_recvfrom(key, op_key, comp->pkt, &pkt_size,  
     520                                     PJ_IOQUEUE_ALWAYS_ASYNC, 
     521                                     &comp->src_addr, &comp->src_addr_len); 
     522        if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
     523            ice_st_perror(comp->ice_st, "ioqueue recvfrom() error", status); 
     524        } else { 
     525            break; 
     526        } 
    521527    } 
    522528} 
Note: See TracChangeset for help on using the changeset viewer.