Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Other Authors

2001-2004 Herbert Straub <h.straub@aon.at>
See ChangeLog file for details.
2008 Christof Meerwald <cmeerw@web.de>
IPv6 support, removed libsocket++ dependency


Author of Program Parts
Expand Down
10 changes: 10 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Release 1.3.ipv6:
Christof Meerwald

New functions:
* IPv6 support

* new ConnectTimeout, ConnectBackoff and LimitGroupSize options

* client support for SSL connections

Release 1.2:
Herbert Straub - 2004-09-28
New functions:
Expand Down
8 changes: 8 additions & 0 deletions NServer-0.9.1/ActiveDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ ActiveDB::ActiveDB()
ActiveDB::~ActiveDB()
{
}

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
13 changes: 11 additions & 2 deletions NServer-0.9.1/ActiveDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
#include "VirtualIterator.h"

class ActiveDB {
protected:
protected:
ActiveDB();
public:

public:
virtual ~ ActiveDB();
// Used for set
enum {
Expand Down Expand Up @@ -57,3 +58,11 @@ class ActiveDB {
};

#endif

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
8 changes: 8 additions & 0 deletions NServer-0.9.1/ArtSpooler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,11 @@ string ArtSpooler::extractID(Article & a)
ID.replace(ID.length() - 1, 1, "");
return ID;
}

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
26 changes: 17 additions & 9 deletions NServer-0.9.1/ArtSpooler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
* \li .resourceSpooler.lock (LockFile).
*/
class ArtSpooler {
public:
public:
/**
* If the spool directory doesn't exists, the contstructor creates
* it. It uses ObjLock to manage the access to the Spool.
* \param spoolDir Spool Directory
* \throw Error
* \todo Das ist ein Testpunkt
*/
ArtSpooler(const string & spoolDir);
ArtSpooler(const std::string & spoolDir);

~ArtSpooler();

Expand Down Expand Up @@ -81,26 +81,34 @@ class ArtSpooler {
* Create a unique ID
* \return The ID String
*/
string createID(void);
std::string createID(void);

/**
* Extract ID from article message id
* \return The ID String
*/
string extractID(Article & a);
std::string extractID(Article & a);

/**
* store Article in path
* return 0 success, 1 duplicated
*/
int storeArticle(const string & path, Article & a);
int storeArticle(const std::string & path, Article & a);

private:
string spoolDir;
string artSpool;
string badArticles;
private:
std::string spoolDir;
std::string artSpool;
std::string badArticles;
ObjLock *pLock;
};


#endif

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
32 changes: 15 additions & 17 deletions NServer-0.9.1/Article.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@
using namespace std;

InvalidArticleError::InvalidArticleError(const char *txt, const char *file,
const char *function, int line):NSError(txt,
file,
function,
line)
const char *function, int line)
: NSError(txt, file, function, line)
{
}

InvalidArticleError::InvalidArticleError(const string & txt, const char *file,
const char *function, int line):NSError(txt,
file,
function,
line)
const char *function, int line)
: NSError(txt, file, function, line)
{
}

void InvalidArticleError::print(void)
void InvalidArticleError::print(void) const
{
slog << "Exception!\n"
<< " Type: InvalidArticle\n"
Expand All @@ -53,21 +49,15 @@ Article::Article()
}

Article::Article(Article * a)
//: _nbr(a->getnbr()), _text(a->GetText()), _ctext(_text.c_str())
{
_nbr = a->getnbr();
_text = a->GetText();
_ctext = _text.c_str();

}
: _nbr(a->getnbr()), _text(a->GetText()), _ctext(_text.c_str())
{ }

Article::Article(int artnbr)
{
setnbr(artnbr);
}

Article::Article(int artnbr, const char *text, int textlen)
//: setnbr(artnbr), _text.assign(text, textlen), _ctext = _text.c_str()
{
setnbr(artnbr);
_text.assign(text, textlen);
Expand Down Expand Up @@ -373,3 +363,11 @@ ostream & operator <<(ostream & os, Article & art)
os << art._text;
return os;
}

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
22 changes: 15 additions & 7 deletions NServer-0.9.1/Article.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* Syntactic error in Article dectected
*/
class InvalidArticleError:public NSError {
public:
public:
InvalidArticleError(const char *txt, const char *file,
const char *function, int line);
const char *function, int line);

InvalidArticleError(const std::string & txt, const char *file,
const char *function, int line);
const char *function, int line);

virtual void print(void);
virtual void print(void) const;
};

/**
Expand All @@ -34,7 +34,7 @@ class InvalidArticleError:public NSError {
* \bug Method documentation is missing.
*/
class Article {
private:
private:

/**
* Return the position of a given field in the article's header.
Expand All @@ -43,12 +43,12 @@ class Article {
*/
const char *find_field(const char *ifld) const;

protected:
protected:
int _nbr;
std::string _text;
const char *_ctext;

public:
public:
enum {
Head = 0x1,
Body = 0x2
Expand Down Expand Up @@ -96,3 +96,11 @@ class Article {
};

#endif

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
84 changes: 53 additions & 31 deletions NServer-0.9.1/CNewsgroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void CNewsgroup::listgroup(char *lstgrp, unsigned int f, unsigned int l)
}

void CNewsgroup::sUpdateGroupInfo(unsigned int *infofp,
unsigned int *infolp)
unsigned int *infolp)
{
GroupInfo *info;
unsigned int f, l, infof, infol;
Expand Down Expand Up @@ -79,40 +79,54 @@ void CNewsgroup::sUpdateOverview(void)
try {
listgroup(lstgrp, infof, infol);

f = infof;
while (f <= infol) {
if ((NVArray::shas_element(f) && lstgrp[f - infof])
|| (!NVArray::shas_element(f)
&& !lstgrp[f - infof])) {
f++;
continue;
}
if (lstgrp[f - infof]) {
// We do not have this article
l = f;
for (i = l + 1; i < l + 8 && i <= infol;
i++) {
if (!NVArray::shas_element(i)
&& lstgrp[i - infof])
l = i;
if (_RServer->getnntpflags() & MPListEntry::F_LISTGROUP) {
f = infof;
while (f <= infol) {
if ((NVArray::shas_element(f) && lstgrp[f - infof])
|| (!NVArray::shas_element(f)
&& !lstgrp[f - infof])) {
f++;
continue;
}
_RServer->overviewdb(this, f, l);
f = i;
} else {
i = f - infof;
// We do have this article, but it has been deleted
if (*(mem_p + arrtab[i] + sizeof(long)) ==
bigarticle) {
// Remove article from disk
sprintf(fn, "%s/.art%ud",
_SpoolDirectory, i);
unlink(fn);
if (lstgrp[f - infof]) {
// We do not have this article
l = f;
for (i = l + 1; i < l + 8 && i <= infol;
i++) {
if (!NVArray::shas_element(i)
&& lstgrp[i - infof])
l = i;
}
_RServer->overviewdb(this, f, l);
f = i;
} else {
i = f - infof;
// We do have this article, but it has been deleted
if (*(mem_p + arrtab[i] + sizeof(long)) ==
bigarticle) {
// Remove article from disk
sprintf(fn, "%s/.art%ud",
_SpoolDirectory, i);
unlink(fn);
}
nvfree(arrtab[i]);
arrtab[i] = 0;
f++;
}
nvfree(arrtab[i]);
arrtab[i] = 0;
f++;
}
} else {
f = infol;
while ((f >= infof) && !NVArray::shas_element(f)) {
f--;
}

/* do we have at least one new article? */
if (f < infol)
{
_RServer->overviewdb(this, f + 1, infol);
}
}

time(&now);
setmtime(now);
} catch(Error & e) {
Expand Down Expand Up @@ -248,3 +262,11 @@ void CNewsgroup::prefetchGroup(int lockgrp)
free(lstgrp);
NVArray::lock(NVcontainer::UnLock);
}

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
15 changes: 12 additions & 3 deletions NServer-0.9.1/CNewsgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* \bug method documentation are mising.
*/
class CNewsgroup:public NVNewsgroup {
protected:
protected:
nvtime_t _TTLGroup;
RServer *_RServer;

Expand All @@ -28,10 +28,11 @@ class CNewsgroup:public NVNewsgroup {
NVArray::lock(NVcontainer::ExclLock);
sUpdateOverview();
NVArray::lock(NVcontainer::UnLock);
} void listgroup(char *lstgrp, unsigned int f, unsigned int l);
}
void listgroup(char *lstgrp, unsigned int f, unsigned int l);
virtual Article *retrievearticle(unsigned int nbr);

public:
public:
CNewsgroup(RServer * nsrvr, OverviewFmt * fmt,
const char *spooldir, const char *name):NVNewsgroup(fmt,
spooldir,
Expand Down Expand Up @@ -95,3 +96,11 @@ class CNewsgroup:public NVNewsgroup {
};

#endif

/*
* Local Variables:
* mode: c++
* tab-width: 4
* c-basic-offset: 4
* End:
*/
Loading