Changeset 5970


Ignore:
Timestamp:
Apr 16, 2019 4:08:04 AM (5 years ago)
Author:
ming
Message:

Fixed #2190: Crash in ioqueue post completion if callback is not set

File:
1 edited

Legend:

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

    r5907 r5970  
    12811281            pj_ioqueue_unlock_key(key); 
    12821282 
    1283             (*key->cb.on_read_complete)(key, op_key, bytes_status); 
     1283            if (key->cb.on_read_complete) 
     1284                (*key->cb.on_read_complete)(key, op_key, bytes_status); 
    12841285            return PJ_SUCCESS; 
    12851286        } 
     
    12951296            pj_ioqueue_unlock_key(key); 
    12961297 
    1297             (*key->cb.on_write_complete)(key, op_key, bytes_status); 
     1298            if (key->cb.on_write_complete) 
     1299                (*key->cb.on_write_complete)(key, op_key, bytes_status); 
    12981300            return PJ_SUCCESS; 
    12991301        } 
     
    13091311            pj_ioqueue_unlock_key(key); 
    13101312 
    1311             (*key->cb.on_accept_complete)(key, op_key,  
    1312                                           PJ_INVALID_SOCKET, 
    1313                                           (pj_status_t)bytes_status); 
     1313            if (key->cb.on_accept_complete) { 
     1314                (*key->cb.on_accept_complete)(key, op_key,  
     1315                                              PJ_INVALID_SOCKET, 
     1316                                              (pj_status_t)bytes_status); 
     1317            } 
    13141318            return PJ_SUCCESS; 
    13151319        } 
Note: See TracChangeset for help on using the changeset viewer.