Added full newsgroup compile switch

This commit is contained in:
Michiel Broek 2004-06-20 14:38:11 +00:00
parent 44ecaf41b7
commit 58876c0fe3
25 changed files with 121 additions and 25 deletions

View File

@ -1,18 +1,24 @@
$Id$
WARNING!!!!!
This is a testversion for the ICM flag (FSP-1033). This flag
is not yet accepted. It is also possible that certain nodes
are not called anymore!! Please report if so, but only Fidonet
nodes, or if from other nets, show me the nodelist entry too.
v0.61.1 20-Jun-2004.
general:
Added compile directive for full newsgate. If this switch is
used then mbfido behaves like it did upto version 0.50.0 and
mbnntp is disabled.
mbfido:
Added compile directive for full newsgate.
mbnntp:
If compiled in full newsmode, this program acts like a dummy.
v0.61.0 06-Jun-2004.
v0.61.0 06-Jun-2004 - 20-Jun-2004
libnodelist.a:
Prepared for ICM flag (FSP-1033).
Implemented the ICM flag (FSP-1033).
mbmsg:
With te post command, the right number of commandline options
@ -26,13 +32,13 @@ v0.61.0 06-Jun-2004.
failed.
mbout:
Prepared for ICM flag (FSP-1033).
Implemented the ICM flag (FSP-1033).
mbcico:
Prepared for ICM flag (FSP-1033).
Implemented the ICM flag (FSP-1033).
mbtask:
Prepared for ICM flag (FSP-1033). (Partly).
Implemented the ICM flag (FSP-1033).
mbfile:
The filenames in the html pages are now the long filenames.

7
configure vendored
View File

@ -3066,11 +3066,14 @@ if test "${enable_newsgate+set}" = set; then
else
newsgate=no
fi;
if test "$newsgate" = "ues"; then
if test "$newsgate" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define USE_NEWSGATE 1
_ACEOF
NEWSGATE="Yes"
else
NEWSGATE="No"
fi
@ -10189,6 +10192,7 @@ echo "$as_me:$LINENO: result:
Version : ..................... ${VERSION}
Hydra/Binkp zlib compression : ${ZLIBSUP}
Full newsgate : ............... ${NEWSGATE}
" >&5
echo "${ECHO_T}
@ -10198,6 +10202,7 @@ echo "${ECHO_T}
Version : ..................... ${VERSION}
Hydra/Binkp zlib compression : ${ZLIBSUP}
Full newsgate : ............... ${NEWSGATE}
" >&6

View File

@ -102,8 +102,11 @@ dnl
dnl Enable full newsgate, this was default upto 0.50.0
dnl
AC_ARG_ENABLE(newsgate, [ --enable-newsgate Compile with newsgate], [ newsgate=$enableval ], [ newsgate=no ])
if test "$newsgate" = "ues"; then
if test "$newsgate" = "yes"; then
AC_DEFINE(USE_NEWSGATE)
NEWSGATE="Yes"
else
NEWSGATE="No"
fi
@ -383,6 +386,7 @@ AC_MSG_RESULT([
Version : ..................... ${VERSION}
Hydra/Binkp zlib compression : ${ZLIBSUP}
Full newsgate : ............... ${NEWSGATE}
])

View File

@ -487,10 +487,17 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m
}
}
#ifdef USE_NEWSGATE
/*
* Gate to newsserver
*/
if (strlen(msgs.Newsgroup) && tonews) {
#else
/*
* Gate to newsserver if this is a real newsgroup
*/
if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS) && tonews) {
#endif
rewind(nfp);
qp = tmpfile();
while ((fgets(buf, MAX_LINE_LENGTH, nfp)) != NULL) {

View File

@ -282,8 +282,12 @@ void ScanFull()
if (Link.aka.zone)
ExportEcho(Link, Number, &sbl);
}
#ifdef USE_NEWSGATE
if (strlen(msgs.Newsgroup))
#else
if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
ExportNews(Number, &sbl);
#endif
ExportNews(Number, &sbl);
tidy_falist(&sbl);
}
@ -439,8 +443,12 @@ void ScanOne(char *path, unsigned long MsgNum)
ExportEcho(Link, MsgNum, &sbl);
}
}
#ifdef USE_NEWSGATE
if (strlen(msgs.Newsgroup))
#else
if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
ExportNews(MsgNum, &sbl);
#endif
ExportNews(MsgNum, &sbl);
tidy_falist(&sbl);
}

View File

@ -205,7 +205,11 @@ void ScanNews(void)
while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) {
fseek(pAreas, Msgshdr.syssize, SEEK_CUR);
#ifdef USE_NEWSGATE
if ((Msgs.Active) && strlen(Msgs.Newsgroup)) {
#else
if ((Msgs.Active) && strlen(Msgs.Newsgroup) && (Msgs.Type == NEWS)) {
#endif
if (IsSema((char *)"upsalarm")) {
Syslog('+', "Detected upsalarm semafore, aborting newsscan");
break;

View File

@ -33,6 +33,8 @@
#include "atoul.h"
#ifndef USE_NEWSGATE
unsigned long atoul(char *str)
{
unsigned long x;
@ -43,3 +45,4 @@ unsigned long atoul(char *str)
return 0xffffffff;
}
#endif

View File

@ -3,6 +3,10 @@
/* $Id$ */
#ifndef USE_NEWSGATE
unsigned long atoul(char*);
#endif
#endif

View File

@ -33,6 +33,7 @@
#include "mbnntp.h"
#include "auth.h"
#ifndef USE_NEWSGATE
int authorized = FALSE; /* Authentication status */
int got_username = FALSE; /* Did we get a username? */
@ -168,4 +169,4 @@ void auth_pass(char *cmd)
send_nntp("281 Authentication accepted");
}
#endif

View File

@ -3,8 +3,12 @@
/* $Id$ */
#ifndef USE_NEWSGATE
int check_auth(char *); /* Check user is authorized */
void auth_user(char *); /* Auth username */
void auth_pass(char *); /* Auth password */
#endif
#endif

View File

@ -39,6 +39,7 @@
#include "commands.h"
#ifndef USE_NEWSGATE
unsigned long article = 0L; /* Current article */
char currentgroup[81]; /* Current newsgroup */
@ -595,4 +596,4 @@ void command_xover(char *cmd)
send_nntp(".");
}
#endif

View File

@ -3,6 +3,8 @@
/* $Id$ */
#ifndef USE_NEWSGATE
void command_abhs(char *); /* ARTICLE/BODY/HEADER/STAT */
void command_group(char *); /* GROUP */
void command_list(char *); /* LIST */
@ -10,3 +12,5 @@ void command_post(char *); /* POST */
void command_xover(char *); /* XOVER */
#endif
#endif

View File

@ -33,6 +33,7 @@
#include "hash.h"
#include "lhash.h"
#ifndef USE_NEWSGATE
void hash_update_s(unsigned long *id, char *mod)
{
@ -50,3 +51,4 @@ void hash_update_n(unsigned long *id, unsigned long mod)
}
#endif

View File

@ -1,8 +1,13 @@
#ifndef HASH_H
#define HASH_H
/* $Id$ */
#ifndef USE_NEWSGATE
void hash_update_s(unsigned long *, char *);
void hash_update_n(unsigned long *, unsigned long);
#endif
#endif

View File

@ -32,6 +32,8 @@
#include "../lib/mbselib.h"
#include "lhash.h"
#ifndef USE_NEWSGATE
/* crypto/lhash/lhash.c */
/* Copyright (C) 1995-1996 Eric Young (eay@mincom.oz.au)
* All rights reserved.
@ -498,3 +500,4 @@ unsigned long lh_strhash(char *c)
return((ret>>16)^ret);
}
#endif

View File

@ -52,6 +52,8 @@
#ifndef HEADER_LHASH_H
#define HEADER_LHASH_H
#ifndef USE_NEWSGATE
#ifdef __cplusplus
extern "C" {
#endif
@ -145,3 +147,5 @@ void lh_node_usage_stats_bio();
#endif
#endif
#endif

View File

@ -76,10 +76,14 @@ void die(int onsig)
free(envptr);
ExitClient(onsig);
msleep(1); /* For the linker only */
colour(0, 0);
}
#ifndef USE_NEWSGATE
/*
* Check if the system is available.
*/
@ -96,6 +100,7 @@ int check_free(void)
return TRUE;
}
#endif
@ -135,6 +140,10 @@ int main(int argc, char *argv[])
Syslog(' ', "MBNNTP v%s", VERSION);
IsDoing("Loging in");
#ifdef USE_NEWSGATE
WriteError("MBSEBBS is compiled for full newsgate, you cannot use mbnntp!");
#endif
/*
* Catch all the signals we can, and ignore the rest.
*/
@ -155,12 +164,16 @@ int main(int argc, char *argv[])
Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s",
addrlen,peeraddr.sin_family, peeraddr.sin_port, inet_ntoa(peeraddr.sin_addr));
Syslog('+', "Incoming connection from %s", inet_ntoa(peeraddr.sin_addr));
#ifdef USE_NEWSGATE
send_nntp("400 Server closed");
#else
if (! check_free()) {
send_nntp("400 Server closed");
} else {
send_nntp("200 MBNNTP v%s server ready -- posting allowed", VERSION);
nntp();
}
#endif
}
}
@ -172,6 +185,7 @@ int main(int argc, char *argv[])
#ifndef USE_NEWSGATE
/*
* Get command from the client.
* return < 0: error
@ -212,6 +226,7 @@ int get_nntp(char *buf, int max)
return 0; /* Not reached */
}
#endif
@ -236,6 +251,7 @@ void send_nntp(const char *format, ...)
#ifndef USE_NEWSGATE
void nntp(void)
{
char buf[4096];
@ -335,4 +351,4 @@ void nntp(void)
}
}
#endif

View File

@ -4,7 +4,12 @@
/* $Id$ */
void send_nntp(const char *, ...);
#ifndef USE_NEWSGATE
int get_nntp(char *, int);
void nntp(void);
#endif
#endif

View File

@ -48,10 +48,9 @@
#include "atoul.h"
#include "hash.h"
#include "msgflags.h"
//#include "aliasdb.h"
#include "mkftnhdr.h"
#ifndef USE_NEWSGATE
#ifndef ULONG_MAX
#define ULONG_MAX 4294967295
@ -591,4 +590,4 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int newsmode, faddr *recipient)
return tmsg;
}
#endif

View File

@ -1,10 +1,13 @@
#ifndef _MKFTNHDR_H
#define _MKFTNHDR_H
/* $Id$ */
#ifndef USE_NEWSGATE
int ftnmsgid(char *,char **,unsigned long *,char *);
ftnmsg *mkftnhdr(rfcmsg *, int, faddr *);
#endif
#endif

View File

@ -32,6 +32,7 @@
#include "../lib/mbselib.h"
#include "msgflags.h"
#ifndef USE_NEWSGATE
static char *flnm[] = {
(char *)"PVT",(char *)"CRS",(char *)"RCV",(char *)"SNT",
@ -130,4 +131,4 @@ int flag_on(char *flag, char *flags)
return up;
}
#endif

View File

@ -3,6 +3,8 @@
/* $Id$ */
#ifndef USE_NEWSGATE
int flag_on(char *,char *);
int flagset(char *);
char *compose_flags(int,char *);
@ -11,3 +13,4 @@ int flag_on(char *,char *);
#endif
#endif

View File

@ -6,5 +6,4 @@
int rawport(void);
int cookedport(void);
#endif

View File

@ -40,6 +40,7 @@
#include "msgflags.h"
#include "rfc2ftn.h"
#ifndef USE_NEWSGATE
#define MAXHDRSIZE 2048
#define MAXSEEN 70
@ -841,4 +842,4 @@ int needputrfc(rfcmsg *msg, int newsmode)
return 1;
}
#endif

View File

@ -3,6 +3,10 @@
/* $Id$ */
#ifndef USE_NEWSGATE
int rfc2ftn(FILE *fp);
#endif
#endif