#include "housekeeping.h"
#include "user_ops.h"
#include "logging.h"
-#include "support.h"
#include "msgbase.h"
+#include "support.h"
#include "locate_host.h"
#include "room_ops.h"
#include "file_ops.h"
syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
- /* Deallocate any message list we might have in memory */
- if (CC->msglist != NULL) phree(CC->msglist);
-
/* Deallocate any user-data attached to this session */
deallocate_user_data(CC);
lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
RemoveContext(CC);
- /* While we still have an extra thread with no user attached to it,
- * take the opportunity to do some housekeeping before exiting.
- */
- do_housekeeping();
+ /* Wake up the housekeeping thread */
+ enter_housekeeping_cmd("SCHED_SHUTDOWN");
}
lprintf(9, "CtdlAllocUserData(%ld) called\n", requested_sym);
+ /* Fail silently if the symbol is already registered. */
for (ptr = CC->FirstSessData; ptr != NULL; ptr = ptr->next) {
if (ptr->sym_id == requested_sym) {
- lprintf(2, "ERROR: CtdlAllocUserData() requested for"
- " symbol id %ld already registered\n",
- requested_sym);
return;
}
}
+ /* Grab us some memory! Dem's good eatin' !! */
ptr = mallok(sizeof(struct CtdlSessData));
ptr->sym_id = requested_sym;
ptr->sym_data = mallok(num_bytes);
strncpy(CC->cs_clientname,desc,31);
CC->cs_clientname[31] = 0;
+ lprintf(9, "Looking up hostname\n");
if ((strlen(from_host)>0) &&
(is_public_client(CC->cs_host))) {
if (inet_aton(from_host, &addr))
CC->cs_host[24] = 0;
}
}
+
+ lprintf(9, "Setting wtmpsupp\n");
set_wtmpsupp_to_current_room();
syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
char un[40], room[40], host[40], flags[5];
aide = CC->usersupp.axlevel >= 6;
- cprintf("%d\n",LISTING_FOLLOWS);
+ cprintf("%d%c \n", LISTING_FOLLOWS, check_express() );
for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
{
}
}
+
+ /* Now it's magic time. Before we finish, call any EVT_RWHO hooks
+ * so that external paging modules such as serv_icq can add more
+ * content to the Wholist.
+ */
+ PerformSessionHooks(EVT_RWHO);
cprintf("000\n");
}
}
else {
cprintf("%d Authentication failed.\n",ERROR);
+ lprintf(3, "Warning: ipgm authentication failed.\n");
}
}
*/
void cmd_down(void) {
if (!CC->logged_in) {
- cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
+ cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
return;
}
CC->upload_fp = NULL;
CC->cs_pid = con->client_socket; /* not necessarily portable */
CC->FirstExpressMessage = NULL;
- CC->msglist = NULL;
- CC->num_msgs = 0;
time(&CC->lastcmd);
time(&CC->lastidle);
strcpy(CC->lastcmdname, " ");
cmd_gnur();
}
- else if (!strncasecmp(cmdbuf,"GREG",4)) {
- cmd_greg(&cmdbuf[5]);
- }
-
else if (!strncasecmp(cmdbuf,"VALI",4)) {
cmd_vali(&cmdbuf[5]);
}
cmd_list();
}
- else if (!strncasecmp(cmdbuf,"REGI",4)) {
- cmd_regi();
- }
-
else if (!strncasecmp(cmdbuf,"CHEK",4)) {
cmd_chek();
}
ERROR);
}
+ /* Run any after-each-command outines registered by modules */
+ PerformSessionHooks(EVT_CMD);
+
} while(strncasecmp(cmdbuf, "QUIT", 4));
cleanup(EXIT_NORMAL);