From 61f89c0cfc666760a37d1b3e35f64586e8a23349 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 9 Sep 2004 19:02:43 +0000 Subject: [PATCH] The logical nodenumber for the bbs is now issued by mbtask --- ChangeLog | 9 +++++++++ TODO | 3 --- html/programs/mbtask.html | 4 ++-- lib/client.c | 10 +++++++++- lib/mbse.h | 1 - lib/mbselib.h | 10 +--------- mbsebbs/mbsebbs.c | 2 -- mbtask/taskcomm.c | 7 ++++--- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2779c58e..39f1b469 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,10 @@ v0.61.4 11-Aug-2004 thumbnails if supported by your system. Start mbsetup, enter global setup and leave. + libmbse.a: + The socket_connect function now sets the global nodenumber from + the reply of mbtask. + libnodelist.a: Removed some debug logging. @@ -59,6 +63,9 @@ v0.61.4 11-Aug-2004 is given to joe. In Quick_Bye reset all signal handlers to prevent that die() is called in case something goes wrong during Quick_Bye. + The fake nodenumber is now obtained from mbtask instead of a + count of tty line records so the used nodenumbers will be a lot + lower then before. mbnewusr: During program exit, it tried to remove the wrong socket to @@ -70,6 +77,8 @@ v0.61.4 11-Aug-2004 mbtask: Tried to call nodes during ZMH or during a Tyx window when mail was on hold. + The comm protocol reply to the AINI command now contains a fake + node number. mbsetup: Changed nodes screens to have a separate uplink managers setup diff --git a/TODO b/TODO index 7a0b2409..0abec960 100644 --- a/TODO +++ b/TODO @@ -161,6 +161,3 @@ mbsetup: format, if a filegate list is installed and the filegate switch setting is wrong, a lot of wrong areas will be created. - N: Sort tty records or use another method to create node numbers. - - diff --git a/html/programs/mbtask.html b/html/programs/mbtask.html index 40f69b7f..22e2f674 100644 --- a/html/programs/mbtask.html +++ b/html/programs/mbtask.html @@ -14,7 +14,7 @@
-
Last update 20-Mar-2004
+
Last update 09-Sep-2004

mbtask - MBSE BBS Taskmanager

Sysopsis.

@@ -195,7 +195,7 @@ Sxxx Status commands. Group A, Accounting. Command: AINI:5,pid,tty,uid,prg,city; Initialize connection, and who am I. -Reply: 100:0; Ok. +Reply: 100:1,line; Ok, linen is a logical linennumber for the bbs. 200:1,Syntax Error; Error. Command: ADOI:2,pid,doing; What am I doing right now. diff --git a/lib/client.c b/lib/client.c index 8b3a7c4d..b582c0e5 100644 --- a/lib/client.c +++ b/lib/client.c @@ -51,6 +51,7 @@ int socket_connect(char *user, char *prg, char *city) { int s; static char buf[SS_BUFSIZE], tty[18]; + char *tmp; myname = prg; @@ -123,12 +124,19 @@ int socket_connect(char *user, char *prg, char *city) } strcpy(buf, socket_receive()); - if (strncmp(buf, "100:0;", 6) != 0) { + if (strncmp(buf, "100:1,", 6) != 0) { printf("AINI not acknowledged by the server\n"); sock = -1; return -1; } + /* + * Extract nodenumber from the reply. + */ + tmp = strtok(buf, ","); + tmp = strtok(NULL, ";"); + iNode = atoi(tmp); + return s; } diff --git a/lib/mbse.h b/lib/mbse.h index 3f104c01..4f1e813c 100644 --- a/lib/mbse.h +++ b/lib/mbse.h @@ -105,7 +105,6 @@ int iExpired; /* Check if users time ran out */ char sUnixName[9]; /* Unix login name */ time_t Time2Go; /* Calculated time to force logout */ struct tm *l_date; /* Structure for Date */ -int iNode; /* Current node number */ time_t ltime; time_t Time_Now; diff --git a/lib/mbselib.h b/lib/mbselib.h index 2701070c..c82e49f4 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -1964,15 +1964,6 @@ struct _route { -/* -typedef struct _srv_auth { - struct _srv_auth *next; - char *hostname; - char *authcode; -} srv_auth; -*/ - - extern char SigName[32][16]; @@ -2007,6 +1998,7 @@ char *printablec(char); /* * From client.c */ +int iNode; /* Current node number */ int socket_connect(char *, char *, char *); int socket_send(char *); char *socket_receive(void); diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index aee58d27..082e4e20 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -190,14 +190,12 @@ int main(int argc, char **argv) * line number, this will be used by doors. */ sprintf(temp, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT")); - iNode = 0; if ((pTty = fopen(temp, "r")) == NULL) { WriteError("Can't read %s", temp); } else { fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty); while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) { - iNode++; if (strcmp(ttyinfo.tty, pTTY) == 0) break; } diff --git a/mbtask/taskcomm.c b/mbtask/taskcomm.c index 348615d5..cec8f8fc 100644 --- a/mbtask/taskcomm.c +++ b/mbtask/taskcomm.c @@ -106,13 +106,14 @@ char *exe_cmd(char *in) * The A(counting) commands. * * AINI:5,pid,tty,user,program,city; - * 100:0; + * 100:1,linenr; * 200:1,Syntax Error; */ if (strncmp(cmd, "AINI", 4) == 0) { - if (reg_newcon(token) != -1) + if ((result = reg_newcon(token)) != -1) { + sprintf(obuf, "100:1,%d;", result); return obuf; - else { + } else { stat_inc_serr(); return ebuf; }