Skip to content
Snippets Groups Projects
  • Joshua Colp's avatar
    f1843664
    dns: Fix crash when invoking cancel in DNS recurring unit test. · f1843664
    Joshua Colp authored
    The recurring unit test expects the user data on a DNS query
    created as a result of a recurring DNS query to be the recurring
    structure itself. This is true, mostly. When invoking the user
    provided callback this user data is changed to the user provided
    data. This presents a race condition where the data may or may
    not point to the recurring data.
    
    This change simplifies the callback of the user provided callback
    by creating a new query and populating it with the expected values.
    This leaves the recurring DNS query alone and fixes the race
    condition. This is more in line with how the API should be used
    overall.
    
    ASTERISK-25222 #close
    
    Change-Id: I10fb6deec025dff097157e7ec17e6e4921778478
    f1843664
    History
    dns: Fix crash when invoking cancel in DNS recurring unit test.
    Joshua Colp authored
    The recurring unit test expects the user data on a DNS query
    created as a result of a recurring DNS query to be the recurring
    structure itself. This is true, mostly. When invoking the user
    provided callback this user data is changed to the user provided
    data. This presents a race condition where the data may or may
    not point to the recurring data.
    
    This change simplifies the callback of the user provided callback
    by creating a new query and populating it with the expected values.
    This leaves the recurring DNS query alone and fixes the race
    condition. This is more in line with how the API should be used
    overall.
    
    ASTERISK-25222 #close
    
    Change-Id: I10fb6deec025dff097157e7ec17e6e4921778478