Changeset 2243


Ignore:
Timestamp:
Aug 26, 2008 5:10:51 PM (16 years ago)
Author:
bennylp
Message:

Fixed ticket #603: Crash in ICE with IoCompletionPort? ioqueue with the test framework because active socket calls the callback with NULL packet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/activesock.c

    r2187 r2243  
    468468                 * there too. 
    469469                 */ 
    470                 ret = (*asock->cb.on_data_recvfrom)(asock, NULL, 0, 
    471                                                     NULL, 0, status); 
     470                /* In some scenarios, status may be PJ_SUCCESS. The upper  
     471                 * layer application may not expect the callback to be called 
     472                 * with successful status and NULL data, so lets not call the 
     473                 * callback if the status is PJ_SUCCESS. 
     474                 */ 
     475                if (status != PJ_SUCCESS ) { 
     476                    ret = (*asock->cb.on_data_recvfrom)(asock, NULL, 0, 
     477                                                        NULL, 0, status); 
     478                } 
    472479            } 
    473480 
     
    504511        } 
    505512 
    506     } while (status != PJ_EPENDING && status != PJ_ECANCELLED); 
     513        if (status != PJ_EPENDING && status != PJ_ECANCELLED) { 
     514            bytes_read = -status; 
     515        } else { 
     516            break; 
     517        } 
     518    } while (1); 
    507519 
    508520} 
Note: See TracChangeset for help on using the changeset viewer.