fix mci_state after sending RSET command
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 29 Jan 1993 00:05:32 +0000 (16:05 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 29 Jan 1993 00:05:32 +0000 (16:05 -0800)
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 6.4
SCCS-vsn: usr.sbin/sendmail/src/version.c 6.16

usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/version.c

index 124ff51..05a5a7a 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 6.3 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 6.4 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 6.3 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 6.4 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -79,7 +79,7 @@ smtpinit(m, mci, e)
          case MCIS_ACTIVE:
                /* need to clear old information */
                smtprset(m, mci, e);
          case MCIS_ACTIVE:
                /* need to clear old information */
                smtprset(m, mci, e);
-               mci->mci_state = MCIS_OPEN;
+               /* fall through */
 
          case MCIS_OPEN:
                return;
 
          case MCIS_OPEN:
                return;
@@ -88,6 +88,7 @@ smtpinit(m, mci, e)
          case MCIS_SSD:
                /* shouldn't happen */
                smtpquit(m, mci, e);
          case MCIS_SSD:
                /* shouldn't happen */
                smtpquit(m, mci, e);
+               /* fall through */
 
          case MCIS_CLOSED:
                syserr("smtpinit: state CLOSED");
 
          case MCIS_CLOSED:
                syserr("smtpinit: state CLOSED");
@@ -374,13 +375,15 @@ smtprset(m, mci, e)
        int r;
 
        smtpmessage("RSET", m, mci);
        int r;
 
        smtpmessage("RSET", m, mci);
-       r = reply(m, mci, e, ReadTimeout);
-       if (r < 0 || REPLYTYPE(r) == 4)
-               return EX_TEMPFAIL;
+       r = reply(m, mci, e, (time_t) 300);
+       if (r < 0)
+               mci->mci_state = MCIS_ERROR;
        else if (REPLYTYPE(r) == 2)
        else if (REPLYTYPE(r) == 2)
-               return EX_OK;
-       else
-               return EX_PROTOCOL;
+       {
+               mci->mci_state = MCIS_OPEN;
+               return;
+       }
+       smtpquit(m, mci, e);
 }
 \f/*
 **  SMTPNOOP -- send a NOOP (no operation) command to check the connection state
 }
 \f/*
 **  SMTPNOOP -- send a NOOP (no operation) command to check the connection state
index 2f0bc0d..1f73838 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  6.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  6.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "ALPHA-6.15";
+char   Version[] = "ALPHA-6.16";