On Thu, Jul 24, 2014 at 01:55:43PM +0100, Gareth Owen wrote:
Andrea
Thanks for taking the time to reply and for the advice. I have just this second discovered this method:
TO_OR_CIRCUIT(circ)->p_chan->get_remote_descr(TO_OR_CIRCUIT(circ)->p_chan, 0)
which returns the endpoint as a string. I wonder, is this safer/future proof or should this approach be discouraged?
Don't call channel methods directly like that. Do call something like channel_get_actual_remote_descr(), channel_get_actual_remote_address(), or channel_get_canonical_remote_descr() (see code in channel.c for differences among them) on TO_OR_CIRCUIT(circ)->p_chan.
Note: only do this if you want a string to show the user or something like that. If you're going to parse it, it's very much brittle and not future- proof.