Changeset 1503


Ignore:
Timestamp:
Oct 16, 2007 2:10:58 PM (17 years ago)
Author:
bennylp
Message:

Tolerate more ICMP errors in ICE media transport

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r1498 r1503  
    2626#include <pj/rand.h> 
    2727#include <pj/string.h> 
     28#include <pj/compat/socket.h> 
    2829 
    2930 
     
    441442    pj_ice_strans *ice_st = comp->ice_st; 
    442443    pj_ssize_t pkt_size; 
    443     enum { RETRY = 4 }; 
     444    enum { RETRY = 10 }; 
    444445    unsigned retry; 
    445446    pj_status_t status; 
     
    516517 
    517518    /* Read next packet */ 
    518     for (retry=0; retry<RETRY; ++retry) { 
     519    for (retry=0; retry<RETRY;) { 
    519520        pkt_size = sizeof(comp->pkt); 
    520521        comp->src_addr_len = sizeof(comp->src_addr); 
     
    522523                                     PJ_IOQUEUE_ALWAYS_ASYNC, 
    523524                                     &comp->src_addr, &comp->src_addr_len); 
    524         if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
     525        if (status == PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK) || 
     526            status == PJ_STATUS_FROM_OS(OSERR_EINPROGRESS) ||  
     527            status == PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) 
     528        { 
     529            ice_st_perror(comp->ice_st, "ioqueue recvfrom() error", status); 
     530            ++retry; 
     531            continue; 
     532        } else if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
     533            retry += 2; 
    525534            ice_st_perror(comp->ice_st, "ioqueue recvfrom() error", status); 
    526535        } else { 
Note: See TracChangeset for help on using the changeset viewer.