[jdev] Hints about the resolver
Jacob Bunk Nielsen
jbnliste at bunk.cc
Wed May 18 04:48:02 CDT 2005
Ivan Santarelli <ivan.santarelli at students.cefriel.it> writes:
>> Maybe you want to do that elsewhere, or maybe you even want to write
>> your own component that can connect to the router and be default route
>> before it sends stuff back to the s2s component?
>
> This seems to be interesting, do you know where can I find some
> documentation about writing components?
No, sorry.
I'm writing something not too different from the s2s component, so I
grabbed a copy of that, and stripped away all the code that wasn't
used for communicating with the router component and started from
there. It seems to work well for me so far.
>> If you explain a bit more about what you want to do the answers you
>> get might be better.
>>
>
> The resolution must be take in mind the jid, not only the domain part. I
> thought it could be hacked in the s2s component, because the pkt
> structure defined in pkt.c has many fields like rto, rfrom, to and from.
> Unfortunally I saw that s2s.h redefined that structure and that only the
> domain field is passed to s2s component.
It has:
jid_t from;
jid_t to;
The problem is that from is set to be the server, e.g.
jabber.example.com because route stanzas should bounce back to the
server in case of an error. You probably want to and from from the
message part of the nad.
> Perhaps I can navigate through the nad to extract the to and from
> fields... going to investigate...
Yes you can. Get them from the message part of the nad by first
finding the message element (with nad_find_elem()) and the finding the
to and from attributes (with nad_find_attr()).
--
Jacob
More information about the JDev
mailing list