Reply or Printf?

Julien ÉLIE julien at trigofacile.com
Wed Sep 17 20:12:18 UTC 2008


Hi

I answer one of my (old) messages.  It dates back to July 2007!


> I was looking at the code of « nnrpd/group.c ».
> I have a little question (perhaps stupid) but I wonder
> what the difference is between the use of Reply()
> and Printf() in the code.

I have just found out the answer while reading nnrpd's source code.
Printf() is never traced whereas Reply() can be, if tracing is enabled.

Well, I have just fixed their calls in nnrpd (I sometimes inverted them
but there were also existing inversions).


> For instance, there is
>  Printf("%d No group specified\r\n", NNTP_FAIL_XGTITLE);
> and
>  Reply("%s %s\r\n", NOSUCHGROUP, group);
>
> Are they interchangeable?

No.  It should be Reply() in these two cases.


> Or is there a best practice in INN coding style?

Yep.


> And, another question, when will NNTP_FAIL_XGTITLE be changed
> in the code to NNTP_FAIL_AUTHINFO_BAD?

Both of them are 481.  I also have my answer:  never!
We keep NNTP_FAIL_XGTITLE.  I did not know at all response codes
when I asked that question last year!

-- 
Julien ÉLIE

« -- Ils transportent une arme secrète dans un tonneau !
  -- La cervoise tiède !!!
  -- Non, ça c'est une arme connue. » (Astérix)



More information about the inn-workers mailing list