*
*/
+#ifdef DLL_EXPORT
+#define IN_LIBCIT
+#endif
+
#include "sysdep.h"
#include <errno.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <string.h>
#include <syslog.h>
#include <limits.h>
#include "server.h"
#include "database.h"
#include "user_ops.h"
+#include "dynloader.h"
#include "sysdep_decls.h"
#include "support.h"
#include "room_ops.h"
#include "control.h"
#include "msgbase.h"
#include "config.h"
-#include "dynloader.h"
#include "tools.h"
#include "citserver.h"
{
struct cdbdata *cdbus;
- cdb_begin_transaction();
cdb_rewind(CDB_USERSUPP);
while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) {
sizeof(struct usersupp) : cdbus->len));
cdb_free(cdbus);
if (usbuf->usernum == number) {
- cdb_end_transaction();
+ cdb_close_cursor(CDB_USERSUPP);
return (0);
}
}
- cdb_end_transaction();
return (-1);
}
void logout(struct CitContext *who)
{
who->logged_in = 0;
+
+ /*
+ * If there is a download in progress, abort it.
+ */
if (who->download_fp != NULL) {
fclose(who->download_fp);
who->download_fp = NULL;
}
+
+ /*
+ * If there is an upload in progress, abort it.
+ */
if (who->upload_fp != NULL) {
abort_upl(who);
}
+
+ /*
+ * If we were talking to a network node, we're not anymore...
+ */
+ if (strlen(who->net_node) > 0) {
+ network_talking_to(who->net_node, NTT_REMOVE);
+ }
+
/* Do modular stuff... */
PerformSessionHooks(EVT_LOGOUT);
}
/* There are unvalidated users. Traverse the usersupp database,
* and return the first user we find that needs validation.
*/
- cdb_begin_transaction();
cdb_rewind(CDB_USERSUPP);
while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) {
memset(&usbuf, 0, sizeof(struct usersupp));
if ((usbuf.flags & US_NEEDVALID)
&& (usbuf.axlevel > 0)) {
cprintf("%d %s\n", MORE_DATA, usbuf.fullname);
- cdb_end_transaction();
+ cdb_close_cursor(CDB_USERSUPP);
return;
}
}
- cdb_end_transaction();
/* If we get to this point, there are no more unvalidated users.
* Therefore we clear the "users need validation" flag.
struct usersupp usbuf;
struct cdbdata *cdbus;
- cdb_begin_transaction();
cdb_rewind(CDB_USERSUPP);
while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) {
cdb_free(cdbus);
(*CallBack) (&usbuf, in_data);
}
- cdb_end_transaction();
}