[jdev] recipient of a packet
m at tthias.net
Mon May 24 10:30:25 CDT 2004
Remy HAREL schrieb am 2004-05-24 12:07:40:
> I'm looking for the full jid of the recipient of a packet, in c2s
> module.Can I determine it by using this command :
> tmp = nad_find_attr ( nad, 0, -1, "to", NULL )
> But this will return an integer, will not ? I'd prefer a char* because
> the full jid is a char*. Is it the good way to get the full jid of the
> recipient of a packet or is there a better solution ( need in c2s.c ) ?
I do not know why you want to check for the receipient of the packet in
c2s. If you check packets from the sm you might already have the
receipient parsed in the code as c2s has to deliver the packets.
If you want it for packets that arrived from a client, I am not sure if
it is a good idea ...
In any case ... nad_find_attr will return you an integer that is
something like a handle. You can use the macros NAD_AVAL and NAD_AVAL_L
... the first will return a pointer to the string (that is NOT zero
terminated!) and the second will give you the length of the string.
Fon: +49-(0)70 0770 07770 http://matthias.wimmer.name/
HAM: DB1MW xmpp:mawis at amessage.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the JDev