[OpenSIPS-Devel] [ opensips-Patches-3042432 ] [pua] add a "publish" queue to avoid deadlock
Alex Hermann
alex at speakup.nl
Mon Aug 16 15:16:50 CEST 2010
On Monday 16 August 2010, Anca Vamanu wrote:
> On 08/16/2010 01:45 PM, Alex Hermann wrote:
> > 2) Add queueing. In your implementation you only keep one extra publish.
> > I'd prefer that the presence server receives all publishes, so i updated
> > the patch from csollet to put them in a queue.
>
> I have now looked closer in this patch - it is not entirely correct. I
> see that on the tm callback when the reply is received, you send all the
> publishes in a loop - well, you actually have to wait for the reply of
> the first before sending another one. So there is no need for the
> 'while' there, but only a 'if'.
It was not supposed to do that :)
It was meant to loop through them on failure (the 'continue' statement). I
missed a break after shm_free(pending_publ). The section now looks like this:
presentity->waiting_reply = 0;
while(presentity->pending_publ)
{
LM_DBG("Found pending publish\n");
publ_t* pending_publ = presentity->pending_publ;
publ_info_t* publ = construct_pending_publ(presentity);
presentity->pending_publ = pending_publ->next;
if(!publ)
{
LM_ERR("Failed to create publish record\n");
shm_free(pending_publ);
continue;
}
presentity->waiting_reply = 1;
send_publish_int(presentity, publ, get_event(presentity-
>event),
presentity->hash_index);
pkg_free(publ);
shm_free(pending_publ);
break;
}
--
Greetings,
Alex Hermann
More information about the Devel
mailing list