[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] C++-ifying leafnode



All,
Mathias mentioned some time back on this list that he was considering
to convert part of leafnode-2.0 to either C++ or Python or both.

Well, it is my pleasure to announce that I've started converting the
nntp server (nntpd.c) to C++. I'll do the conversion in stages,
namely:

1. Replace printfs with ostreams, C PODs with C++ data types where
   applicable (essentially converting char * to std::string whenever
   possible). The benefits of this are less chance of a printf-induced
   buffer overflow, typesafe data conversions in the ostreams and
   some reduction in the memory management complexity when using
   std::string.

2. Start converting the support library to use C++ data types like
   strings, streams and potentially STL containers. At this point,
   some of the other programs like fetchnews and texpire can also
   start benefiting from the C++ support.

3. Change the structure of programs to take advantage of C++.

Currently I'm in phase 1 and part of the nntp server is
converted. I'll do the rest sometime this week and post the code on my
website - I'll send an announcement to the list once that's
done. The server is still stable :-) and although the C++ binary is
considerably bigger on FreeBSD compared to the C version I didn't
notice a performance degradation.

Please note that:
- the work is currently based on the 14/07 version of leafnode 2. I'm
  usually a bit short of time so I can't always keep up with MA's
  releases. I'll hope that we can get around this once the C++ bits
  are reasonably stable.
- it doesn't integrate with the build system yet. I'm not very
  familiar with autoconf so if anyone could extend the scripts to
  support C++ then I'd be grateful. For the time being I'll include
  a build script to compile the C++ code.
-- 
Timo Geusch

UNIX/NT System programmer & JAVA wizzard-in-training

'I ask for so little ... and boy, do I get it' Dilbert

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list