improved debugging/logging of mci caching
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 22 Oct 1993 04:28:36 +0000 (20:28 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 22 Oct 1993 04:28:36 +0000 (20:28 -0800)
SCCS-vsn: usr.sbin/sendmail/src/mci.c 8.5

usr/src/usr.sbin/sendmail/src/mci.c

index 61f166c..621e0b0 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mci.c      8.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)mci.c      8.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -78,6 +78,15 @@ mci_cache(mci)
        if (*mcislot != NULL)
                mci_uncache(mcislot, TRUE);
 
        if (*mcislot != NULL)
                mci_uncache(mcislot, TRUE);
 
+       if (tTd(42, 5))
+               printf("mci_cache: caching %x (%s) in slot %d\n",
+                       mci, mci->mci_host, mcislot - MciCache);
+#ifdef LOG
+       if (tTd(91, 100))
+               syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%s) in slot %d",
+                       CurEnv->e_id, mci, mci->mci_host, mcislot - MciCache);
+#endif
+
        *mcislot = mci;
        mci->mci_flags |= MCIF_CACHED;
 }
        *mcislot = mci;
        mci->mci_flags |= MCIF_CACHED;
 }
@@ -159,6 +168,15 @@ mci_uncache(mcislot, doquit)
                return;
        *mcislot = NULL;
 
                return;
        *mcislot = NULL;
 
+       if (tTd(42, 5))
+               printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n",
+                       mci, mci->mci_host, mcislot - MciCache, doquit);
+#ifdef LOG
+       if (tTd(91, 100))
+               syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%s) from slot %d (%d)",
+                       CurEnv->e_id, mci, mci->mci_host, mcislot - MciCache, doquit);
+#endif
+
        if (doquit)
        {
                message("Closing connection to %s", mci->mci_host);
        if (doquit)
        {
                message("Closing connection to %s", mci->mci_host);