which should now be considered closed.
$Log$
+ Revision 573.65 2001/01/13 06:40:26 nbryant
+ merged remaining changes from TRANSACTIONS (using cvs update -j TRANSACTIONS)
+ which should now be considered closed.
+
Revision 573.64 2001/01/13 06:12:15 ajc
* Added the ASYN command
Revision 573.52 2000/12/19 20:41:55 ajc
* Fixed generation of unique file names for network uploads etc.
+ Revision 573.51.2.11 2000/12/26 05:30:55 nbryant
+ remove extraneous transaction around dynamic module initializations. this will
+ fix the crash on database creation.
+
+ Revision 573.51.2.10 2000/12/24 23:00:58 nbryant
+ clean: also remove parsedate.c
+
+ Revision 573.51.2.9 2000/12/20 01:38:42 nbryant
+ require transactional cursors
+
+ Revision 573.51.2.8 2000/12/20 00:30:01 nbryant
+ release any stale db handles at the end of a server command
+ (unfinished transactions will be aborted to annoy lazy programmers)
+
+ Revision 573.51.2.7 2000/12/19 06:18:27 nbryant
+ set sched_yield as sleepycat's yield function. this should improve locking
+ performance.
+
+ Revision 573.51.2.6 2000/12/19 02:22:29 nbryant
+ added automatic transaction start/end on cdb_fetch, cdb_delete, and cdb_store
+
+ Revision 573.51.2.5 2000/12/18 03:51:13 nbryant
+ ditto S_USER_TRANS, S_CALLLOG, and S_HOUSEKEEPING, which are no longer used at
+ all
+
+ Revision 573.51.2.4 2000/12/18 02:49:17 nbryant
+ removed all references to S_MSGMAIN critical section; it wasn't really needed.
+ this should make things significantly more scaleable.
+
+ Revision 573.51.2.3 2000/12/17 22:12:48 nbryant
+ reworked shutdown sequence to wait for worker threads to terminate before
+ checkpointing and closing databases. it is no longer safe to call
+ master_cleanup() directly to force a shutdown; instead, just set
+ time_to_die to a nonzero value
+
+ Revision 573.51.2.2 2000/12/17 05:06:09 nbryant
+ added deadlock detection and cleaned up messages
+
+ Revision 573.51.2.1 2000/12/16 21:06:59 nbryant
+ created TRANSACTIONS branch
+ track cursor and transaction id's in thread-specific data
+
Revision 573.51 2000/12/14 18:36:34 ajc
* Fixed the "users not in chat" wholist display
fi
clean:
- rm -f *.o *.ro *.mo
+ rm -f *.o *.ro *.mo parsedate.c
cleaner: clean
rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
/*
* Cleanup routine to be called when the server is shutting down.
+ * WARNING: It's no longer safe to call this function to force a shutdown.
+ * Instead, set time_to_die = 1.
*/
void master_cleanup(void) {
struct CleanupFunctionHook *fcn;
- /* Cancel all running sessions */
- lprintf(7, "Cancelling running sessions...\n");
-
-/* FIXME do something here
- while (ContextList != NULL) {
- }
- */
-
/* Run any cleanup routines registered by loadable modules */
for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
(*fcn->h_function_pointer)();
if (CtdlAccessCheck(ac_aide)) return;
cprintf("%d Shutting down server. Goodbye.\n", OK);
- master_cleanup();
+ time_to_die = 1;
}
/*
/* defrag the message base */
lprintf(7, "Defragmenting message base\n");
- begin_critical_section(S_MSGMAIN);
begin_critical_section(S_DATABASE);
gdbm_reorganize(gdbms[CDB_MSGMAIN]);
end_critical_section(S_DATABASE);
- end_critical_section(S_MSGMAIN);
/* defrag the user file, mailboxes, and user/room relationships */
lprintf(7, "Defragmenting user file\n");
void cdb_end_transaction(void) {
}
+
+void cdb_allocate_tsd(void) {
+}
+
+void cdb_free_tsd(void) {
+}
+
+void cdb_release_handles(void) {
+}
void check_sched_shutdown(void) {
if ((ScheduledShutdown == 1) && (ContextList == NULL)) {
lprintf(3, "Scheduled shutdown initiating.\n");
- master_cleanup();
+ time_to_die = 1;
}
}
#include "citadel.h"
#include "citadel_decls.h"
#include "ipc.h"
+#include "tools.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
#endif
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- strncpy(addr.sun_path, sockpath, sizeof addr.sun_path);
+ safestrncpy(addr.sun_path, sockpath, sizeof addr.sun_path);
s = socket(AF_UNIX, SOCK_STREAM, 0);
if (s < 0) {
}
/* Write our little bundle of joy into the message base */
- begin_critical_section(S_MSGMAIN);
if (cdb_store(CDB_MSGMAIN, &newmsgid, sizeof(long),
smr.ser, smr.len) < 0) {
lprintf(2, "Can't store message\n");
} else {
retval = newmsgid;
}
- end_critical_section(S_MSGMAIN);
/* If the caller specified that a copy should be saved to a particular
* file handle, do that now too.
char *Dynamic_Module_Init(void)
{
CtdlRegisterProtoHook(cmd_pas2, "PAS2", "APOP-based login");
- return "$(RCSID)";
+ return "$Id$";
}
fread(mbuf, msglen, 1, fp);
fclose(fp);
- begin_critical_section(S_MSGMAIN);
cdb_store(CDB_MSGMAIN, &msgnum, sizeof(long), mbuf, msglen);
- end_critical_section(S_MSGMAIN);
phree(mbuf);
unlink(tempfile);
*/
enum {
S_USERSUPP,
- S_USER_TRANS,
S_QUICKROOM,
- S_MSGMAIN,
- S_CALLLOG,
S_SESSION_TABLE,
S_FLOORTAB,
S_CHATQUEUE,
S_CONTROL,
- S_HOUSEKEEPING,
S_DATABASE,
S_NETDB,
S_SUPPMSGMAIN,
#include <string.h>
#include <errno.h>
#include <limits.h>
-#include <pthread.h>
#include <syslog.h>
#include "citadel.h"
#include "server.h"