[JDEV] Strange server behaviour
Rodolphe Duge de Bernonville
rod at idealx.com
Fri Jun 29 07:11:40 CDT 2001
Gerard BUNEL a écrit :
>
> Rodolphe Duge de Bernonville a écrit :
>
> > Gerard BUNEL a écrit :
> > >
> > > Hello,
> > >
> > > I need some help on server side development.
> > > I've writen a module in replacement to the standard mod_presence
> > > The objective of this module is to route presence messages to a service
> > > So I wrote function to route some mesages
> > >
> > > void route_packet(mapi m) {
> > > xmlnode node = xmlnode_dup(m->packet->x);
> > > node = xmlnode_wrap(node, "route");
> > > xmlnode_put_attrib(node, "to", packet_to);
> > > deliver(dpacket_new(node), m->si->i);
> > > }
> > >
> > > The result is that sometimes the message is correctly routed, sometimes
> > > it is not at all and sometimes it
> > > seems to hang up partially the server (other messages are not sent)
> >
> > where do you call your function in mod_presence ?
> > do you mean the callback in mod_presence are not called anymore ?
> > which sort of packet do you want to route to your external component ?
>
> It's not mod_presence but a replacement for it.
> I try to route presence packet and I use globaly the same scheme than in
> mod_presence
> It can be in either in es_IN, es_OUT or es_DELIVER callbacks
>
> I've tried using js_deliver instead of deliver, but the result seems to be
> the same.
>
> I notably route presence in es_OUT callback when it is a presence to a
> conference
> and in this case, the server is seems completely freezed.
if your function is inside mod_presence : check the destination
to see if it is the name of your module.
maybe you try to deliver your packet whereas the presence packet
has not been delivered inside the jsm core (maybe due to thread switch
...), so that could explain why sometimes the module receive the
presence
packet and sometimes not.
if you try to implement a new module which will handle presence packet
take care not to return M_HANDLED when you do stuff with a packet
and to place your module (in jabber.xml) before mod_presence.
thats all I can say for the moment :p
More information about the JDev
mailing list