Updates for mbtask and mbnntp

This commit is contained in:
Michiel Broek 2004-04-15 21:29:59 +00:00
parent 007b7b1d41
commit 9e9fec9912
5 changed files with 39 additions and 14 deletions

View File

@ -42,6 +42,10 @@ v0.51.4 11-Apr-2004
a faked newsgroup name in echomail areas. Both settings are a faked newsgroup name in echomail areas. Both settings are
needed for the newsserver. needed for the newsserver.
mbtask:
Removed debug logging for the disk thread.
Added mbnntp to the taskregs to count as a user program.
v0.51.3 22-Mar-2003 - 11-Apr-2004 v0.51.3 22-Mar-2003 - 11-Apr-2004

3
TODO
View File

@ -29,9 +29,6 @@ libdiesel.a:
U: Processed stringlines containing unbalanced " characters are not U: Processed stringlines containing unbalanced " characters are not
processed, instead the previous macro value will be returned. processed, instead the previous macro value will be returned.
libmsgbase.a:
N: CRC fields are not filled.
mbsebbs: mbsebbs:
X: Better word wrapping or paragraph justification in editor. X: Better word wrapping or paragraph justification in editor.

View File

@ -76,6 +76,25 @@ void die(int onsig)
/*
* Check if the system is available.
*/
int check_free(void);
int check_free(void)
{
char buf[128];
strcpy(buf, SockR("SBBS:0;"));
if (strncmp(buf, "100:2,1", 7) == 0) {
Syslog('+', "The system is closed");
return FALSE;
}
return TRUE;
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct passwd *pw; struct passwd *pw;
@ -131,8 +150,12 @@ int main(int argc, char *argv[])
Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s", Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s",
addrlen,peeraddr.sin_family, peeraddr.sin_port, inet_ntoa(peeraddr.sin_addr)); addrlen,peeraddr.sin_family, peeraddr.sin_port, inet_ntoa(peeraddr.sin_addr));
Syslog('+', "Incoming connection from %s", inet_ntoa(peeraddr.sin_addr)); Syslog('+', "Incoming connection from %s", inet_ntoa(peeraddr.sin_addr));
send_nntp("200 MBNNTP v%s server ready -- no posting allowed", VERSION); if (! check_free()) {
nntp(); send_nntp("400 Server closed");
} else {
send_nntp("200 MBNNTP v%s server ready -- posting allowed", VERSION);
nntp();
}
} }
} }
@ -162,7 +185,7 @@ int get_nntp(char *buf, int max)
/* /*
* Timeout * Timeout
*/ */
send_nntp("400 Service discontinued"); send_nntp("400 Service discontinued, timeout");
} }
Syslog('+', "Receiver status %s", ttystat[- c]); Syslog('+', "Receiver status %s", ttystat[- c]);
return c; return c;
@ -223,6 +246,10 @@ void nntp(void)
continue; continue;
Syslog('n', "< \"%s\"", printable(buf, 0)); Syslog('n', "< \"%s\"", printable(buf, 0));
if (! check_free()) {
send_nntp("400 server closed");
return;
}
/* /*
* Process received command * Process received command

View File

@ -401,14 +401,11 @@ void add_path(char *lpath)
return; return;
} }
rpath = calloc(PATH_MAX, sizeof(char)); rpath = calloc(PATH_MAX, sizeof(char));
mbt_realpath(lpath, rpath); mbt_realpath(lpath, rpath);
Syslog('d', "realpath %s", MBSE_SS(rpath));
if (lstat(rpath, &sb) == 0) { if (lstat(rpath, &sb) == 0) {
Syslog('d', "add_path(%s)", rpath);
if (S_ISDIR(sb.st_mode)) { if (S_ISDIR(sb.st_mode)) {
#if defined(__linux__) #if defined(__linux__)
@ -687,9 +684,9 @@ void *disk_thread(void)
disk_run = FALSE; disk_run = FALSE;
Syslog('+', "Disk thread stopped"); Syslog('+', "Disk thread stopped");
pthread_exit(NULL); pthread_exit(NULL);
#if defined(__NetBSD__)
return NULL; #if defined(__NetBSD__)
return NULL;
#endif #endif
} }

View File

@ -489,7 +489,7 @@ char *reg_fre(void)
if (reginfo[i].pid) { if (reginfo[i].pid) {
if ((!strncmp(reginfo[i].prg, "mbsebbs", 7)) || if ((!strncmp(reginfo[i].prg, "mbsebbs", 7)) ||
(!strncmp(reginfo[i].prg, "mbnewusr", 8)) || (!strncmp(reginfo[i].prg, "mbnewusr", 8)) ||
(!strncmp(reginfo[i].prg, "mbftpd", 6))) (!strncmp(reginfo[i].prg, "mbnntp", 6)))
users++; users++;
if ((!strncmp(reginfo[i].prg, "mbfido", 6)) || if ((!strncmp(reginfo[i].prg, "mbfido", 6)) ||