mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Merge mci.c change to add mci_close() from the vendor branch.
Problem noted by: marcus
This commit is contained in:
parent
9945c0e21f
commit
dbda3744f4
1 changed files with 51 additions and 0 deletions
|
|
@ -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
|
||||
**
|
||||
|
|
|
|||
Loading…
Reference in a new issue