* Checked in some test code and logging to determine whether a bad cast/copy is the...
[citadel.git] / citadel / modules / expire / serv_expire.c
index d45ca51211e809c45cb8c926de6f3a2686de31ac..32b6d270cf6c939a690d59d6c41c984811d9fc7e 100644 (file)
@@ -3,10 +3,11 @@
  *
  * This module handles the expiry of old messages and the purging of old users.
  *
- */
-
-
-/*
+ * You might also see this module affectionately referred to as the DAP (the Dreaded Auto-Purger).
+ *
+ * Copyright (c) 1988-2009 by citadel.org (Art Cancro, Wilifried Goesgens, and others)
+ * Brought to you, our happy user community, under the terms of the GNU General Public License v3
+ *
  * A brief technical discussion:
  *
  * Several of the purge operations found in this module operate in two
@@ -66,7 +67,7 @@
 #include "msgbase.h"
 #include "user_ops.h"
 #include "control.h"
-#include "serv_network.h"      /* Needed for defenition of UseTable */
+#include "serv_network.h"      /* Needed for definition of UseTable */
 #include "threads.h"
 
 #include "ctdl_module.h"
@@ -815,6 +816,13 @@ int PurgeStaleOpenIDassociations(void) {
                if (cdboi->len > sizeof(long)) {
                        long usernum;
                        usernum = ((long)*(cdboi->ptr));
+                       /* FIXME two different things here, trying to figure out whether this is the
+                        * source of a bug.
+                        */
+                       CtdlLogPrintf(CTDL_DEBUG, "#1 Evaluating openid association for user %ld\n", usernum);
+                       usernum = 0;
+                       memcpy(&usernum, cdboi->ptr, sizeof(long));
+                       CtdlLogPrintf(CTDL_DEBUG, "#2 Evaluating openid association for user %ld\n", usernum);
                        if (getuserbynumber(&usbuf, usernum) != 0) {
                                deleteme = strdup(cdboi->ptr + sizeof(long)),
                                Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler);