Small fixes to mbnntp
This commit is contained in:
parent
dc5e9a2b16
commit
b7c72a7598
10
ChangeLog
10
ChangeLog
@ -34,6 +34,16 @@ v0.71.1 28-Nov-2004
|
|||||||
The import command now also figures out the difference between
|
The import command now also figures out the difference between
|
||||||
8.3 and long filenames and does the right thing during import.
|
8.3 and long filenames and does the right thing during import.
|
||||||
|
|
||||||
|
mbfido:
|
||||||
|
In rfc2ftn a debug logmessage added to check for unrecognised
|
||||||
|
message ids.
|
||||||
|
|
||||||
|
mbnntp:
|
||||||
|
Removed dead timercode.
|
||||||
|
Code cleanup.
|
||||||
|
When a message is posted without RFC Messageid, a fidonet MSGID
|
||||||
|
is fresh created.
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
Removed bbs list items from the English menus and txtfiles and
|
Removed bbs list items from the English menus and txtfiles and
|
||||||
the Spanish menus and txtfiles.
|
the Spanish menus and txtfiles.
|
||||||
|
@ -342,6 +342,11 @@ int rfc2ftn(FILE *fp, faddr *recipient)
|
|||||||
fprintf(ofp, "\001INTL %d:%d/%d %d:%d/%d\n", fmsg->to->zone, fmsg->to->net, fmsg->to->node,
|
fprintf(ofp, "\001INTL %d:%d/%d %d:%d/%d\n", fmsg->to->zone, fmsg->to->net, fmsg->to->node,
|
||||||
fmsg->from->zone, fmsg->from->net, fmsg->from->node);
|
fmsg->from->zone, fmsg->from->net, fmsg->from->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((fmsg->msgid_a == NULL) || (fmsg->msgid_n == 0)) {
|
||||||
|
Syslog('!', "Warning, no MSGID %s %08lx", MBSE_SS(fmsg->msgid_a), fmsg->msgid_n);
|
||||||
|
}
|
||||||
|
|
||||||
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
|
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
|
||||||
if (fmsg->reply_s)
|
if (fmsg->reply_s)
|
||||||
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
|
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
|
||||||
|
@ -374,9 +374,6 @@ void command_list(char *cmd)
|
|||||||
* No recognized LIST command
|
* No recognized LIST command
|
||||||
*/
|
*/
|
||||||
send_nntp("503 Function not available");
|
send_nntp("503 Function not available");
|
||||||
|
|
||||||
msleep(1); /* For the linker only */
|
|
||||||
mbse_colour(0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -449,22 +449,6 @@ static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static unsigned long lh_strhash(str)
|
|
||||||
char *str;
|
|
||||||
{
|
|
||||||
int i,l;
|
|
||||||
unsigned long ret=0;
|
|
||||||
unsigned short *s;
|
|
||||||
|
|
||||||
if (str == NULL) return(0);
|
|
||||||
l=(strlen(str)+1)/2;
|
|
||||||
s=(unsigned short *)str;
|
|
||||||
for (i=0; i<l; i++)
|
|
||||||
ret^=(s[i]<<(i&0x0f));
|
|
||||||
return(ret);
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* The following hash seems to work very well on normal text strings
|
/* The following hash seems to work very well on normal text strings
|
||||||
@ -480,11 +464,6 @@ unsigned long lh_strhash(char *c)
|
|||||||
|
|
||||||
if ((c == NULL) || (*c == '\0'))
|
if ((c == NULL) || (*c == '\0'))
|
||||||
return(ret);
|
return(ret);
|
||||||
/*
|
|
||||||
unsigned char b[16];
|
|
||||||
MD5(c,strlen(c),b);
|
|
||||||
return(b[0]|(b[1]<<8)|(b[2]<<16)|(b[3]<<24));
|
|
||||||
*/
|
|
||||||
|
|
||||||
n=0x100;
|
n=0x100;
|
||||||
while (*c)
|
while (*c)
|
||||||
|
@ -78,7 +78,6 @@ void die(int onsig)
|
|||||||
ExitClient(onsig);
|
ExitClient(onsig);
|
||||||
|
|
||||||
msleep(1); /* For the linker only */
|
msleep(1); /* For the linker only */
|
||||||
mbse_colour(0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,7 +310,12 @@ int rfc2ftn(FILE *fp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(ofp, "AREA:%s\n", msgs.Tag);
|
fprintf(ofp, "AREA:%s\n", msgs.Tag);
|
||||||
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
|
if ((fmsg->msgid_a == NULL) && (fmsg->msgid_n == 0)) {
|
||||||
|
Syslog('n', "No Messageid from poster, creating new MSGID");
|
||||||
|
fprintf(ofp, "\001MSGID: %s %08lx\n", aka2str(msgs.Aka), sequencer());
|
||||||
|
} else {
|
||||||
|
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
|
||||||
|
}
|
||||||
if (fmsg->reply_s)
|
if (fmsg->reply_s)
|
||||||
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
|
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
|
||||||
else if (fmsg->reply_a)
|
else if (fmsg->reply_a)
|
||||||
|
@ -35,7 +35,6 @@ extern int hanged_up;
|
|||||||
extern char *inetaddr;
|
extern char *inetaddr;
|
||||||
|
|
||||||
#define TT_BUFSIZ 1024
|
#define TT_BUFSIZ 1024
|
||||||
#define NUMTIMERS 3
|
|
||||||
|
|
||||||
|
|
||||||
int tty_status = 0;
|
int tty_status = 0;
|
||||||
@ -45,7 +44,6 @@ static char *next;
|
|||||||
static int left = 0;
|
static int left = 0;
|
||||||
|
|
||||||
|
|
||||||
static time_t timer[NUMTIMERS];
|
|
||||||
|
|
||||||
char *ttystat[]= {(char *)"Ok",
|
char *ttystat[]= {(char *)"Ok",
|
||||||
(char *)"Error",
|
(char *)"Error",
|
||||||
@ -62,8 +60,7 @@ char *ttystat[]= {(char *)"Ok",
|
|||||||
*/
|
*/
|
||||||
static int tty_read(char *buf, int size, int tot)
|
static int tty_read(char *buf, int size, int tot)
|
||||||
{
|
{
|
||||||
time_t timeout, now;
|
int rc;
|
||||||
int i, rc;
|
|
||||||
fd_set readfds, writefds, exceptfds;
|
fd_set readfds, writefds, exceptfds;
|
||||||
struct timeval seltimer;
|
struct timeval seltimer;
|
||||||
|
|
||||||
@ -71,30 +68,12 @@ static int tty_read(char *buf, int size, int tot)
|
|||||||
return 0;
|
return 0;
|
||||||
tty_status = 0;
|
tty_status = 0;
|
||||||
|
|
||||||
now = time(NULL);
|
|
||||||
timeout = (time_t)300; /* maximum of 5 minutes */
|
|
||||||
|
|
||||||
for (i = 0; i < NUMTIMERS; i++) {
|
|
||||||
if (timer[i]) {
|
|
||||||
if (now >= timer[i]) {
|
|
||||||
tty_status=STAT_TIMEOUT;
|
|
||||||
Syslog('!', "tty_read: timer %d already expired, return", i);
|
|
||||||
return -tty_status;
|
|
||||||
} else {
|
|
||||||
if (timeout > (timer[i]-now))
|
|
||||||
timeout=timer[i]-now;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((tot != -1) && (timeout > tot))
|
|
||||||
timeout=tot;
|
|
||||||
|
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_ZERO(&writefds);
|
FD_ZERO(&writefds);
|
||||||
FD_ZERO(&exceptfds);
|
FD_ZERO(&exceptfds);
|
||||||
FD_SET(0,&readfds);
|
FD_SET(0,&readfds);
|
||||||
FD_SET(0,&exceptfds);
|
FD_SET(0,&exceptfds);
|
||||||
seltimer.tv_sec=timeout;
|
seltimer.tv_sec=tot;
|
||||||
seltimer.tv_usec=0;
|
seltimer.tv_usec=0;
|
||||||
|
|
||||||
rc = select(1,&readfds,&writefds,&exceptfds,&seltimer);
|
rc = select(1,&readfds,&writefds,&exceptfds,&seltimer);
|
||||||
|
Reference in New Issue
Block a user