aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorGregory Neil Shapiro <gshapiro@FreeBSD.org>2005-02-14 08:04:08 +0000
committerGregory Neil Shapiro <gshapiro@FreeBSD.org>2005-02-14 08:04:08 +0000
commitdbda3744f4e05f831f0611c60eabcedd5ba0e36e (patch)
tree6219b4cfa01fcc12d027f0a1708d3b8579191d3b /contrib
parent9945c0e21f69eb22f3a73def4c6a14f5b88b5de2 (diff)
downloadsrc-dbda3744f4e05f831f0611c60eabcedd5ba0e36e.tar.gz
src-dbda3744f4e05f831f0611c60eabcedd5ba0e36e.zip
Merge mci.c change to add mci_close() from the vendor branch.
Problem noted by: marcus
Notes
Notes: svn path=/head/; revision=141887
Diffstat (limited to 'contrib')
-rw-r--r--contrib/sendmail/src/mci.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index 894c3029bec7..095700b9f396 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -399,6 +399,57 @@ mci_get(host, m)
return mci;
}
+
+/*
+** MCI_CLOSE -- (forcefully) close files used for a connection.
+** Note: this is a last resort, usually smtpquit() or endmailer()
+** should be used to close a connection.
+**
+** Parameters:
+** mci -- the connection to close.
+** where -- where has this been called?
+**
+** Returns:
+** none.
+*/
+
+void
+mci_close(mci, where)
+ MCI *mci;
+ char *where;
+{
+ bool dumped;
+
+ if (mci == NULL)
+ return;
+ dumped = false;
+ if (mci->mci_out != NULL)
+ {
+ if (tTd(56, 1))
+ {
+ sm_dprintf("mci_close: mci_out!=NULL, where=%s\n",
+ where);
+ mci_dump(sm_debug_file(), mci, false);
+ dumped = true;
+ }
+ (void) sm_io_close(mci->mci_out, SM_TIME_DEFAULT);
+ mci->mci_out = NULL;
+ }
+ if (mci->mci_in != NULL)
+ {
+ if (tTd(56, 1))
+ {
+ sm_dprintf("mci_close: mci_in!=NULL, where=%s\n",
+ where);
+ if (!dumped)
+ mci_dump(sm_debug_file(), mci, false);
+ }
+ (void) sm_io_close(mci->mci_in, SM_TIME_DEFAULT);
+ mci->mci_in = NULL;
+ }
+ mci->mci_state = MCIS_CLOSED;
+}
+
/*
** MCI_NEW -- allocate new MCI structure
**