[SR-Users] auth module README t_newtran() issue
Andrei Pelinescu-Onciul
andrei at iptel.org
Thu Oct 7 14:50:55 CEST 2010
On Oct 07, 2010 at 15:22, Juha Heinanen <jh at tutpro.com> wrote:
> in auth module readme, there is this kind of example code in
> section 1.3.3. nonce_count:
>
> # go stateful and catch retransmissions
> if (!t_newtran())
> drop; # retransmission
>
> based on tm source comment, the #retransmission comment is not correct:
>
> /** if no transaction already exists for the message, create a new one.
> * atomic "new_tran" construct; it returns:
> *
> * @return <0 on error
> * +1 if a request did not match a transaction
> * 0 on retransmission
>
> that is, if t_newtran() returns false, there has been an error. drop
> happens automatically in case of retransmission.
Yes, you're right. The comment should read # t_newtran() error
(where error could be: bad message, t_newtran/t_relay already called,
out of memory a.s.o.).
Andrei
More information about the sr-users
mailing list