Author: file Date: Thu Jan 15 06:11:07 2015 New Revision: 430666 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430666 Log: res_pjsip_outbound_registration: Fix race condition when reloading and listing registrations.
Due to the split of outbound registration state from configuration it is possible during a reload for a "pjsip show registrations" CLI command to be executed which gets an older snapshot of the configuration. This configuration may include outbound registrations which have been removed due to a reload operation occurring at the same time. The code for printing the outbound registration did not take this into account but now it does. AST-1506 #close Review: https://reviewboard.asterisk.org/r/4338/ ........ Merged revisions 430664 from http://svn.asterisk.org/svn/asterisk/branches/13 Modified: certified/branches/13.1/ (props changed) certified/branches/13.1/res/res_pjsip_outbound_registration.c Propchange: certified/branches/13.1/ ------------------------------------------------------------------------------ --- branch-13-merged (original) +++ branch-13-merged Thu Jan 15 06:11:07 2015 @@ -1,1 +1,1 @@ -/branches/13:429128-429222,429224-429246,429352,429407,429409,429433,429477,429497,429519,429540,429571,429739,429741,429761,429829,430010,430034,430083-430084,430092,430200,430252 +/branches/13:429128-429222,429224-429246,429352,429407,429409,429433,429477,429497,429519,429540,429571,429739,429741,429761,429829,430010,430034,430083-430084,430092,430200,430252,430664 Modified: certified/branches/13.1/res/res_pjsip_outbound_registration.c URL: http://svnview.digium.com/svn/asterisk/certified/branches/13.1/res/res_pjsip_outbound_registration.c?view=diff&rev=430666&r1=430665&r2=430666 ============================================================================== --- certified/branches/13.1/res/res_pjsip_outbound_registration.c (original) +++ certified/branches/13.1/res/res_pjsip_outbound_registration.c Thu Jan 15 06:11:07 2015 @@ -1314,6 +1314,10 @@ ast_assert(context->output_buffer != NULL); + if (!state) { + return 0; + } + ast_str_append(&context->output_buffer, 0, " %-s/%-*.*s %-16s %-16s\n", id, (int) (REGISTRATION_URI_FIELD_LEN - strlen(id)), -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits