Commit 34bbf3cc 34bbf3cc3526975957cc22345f63849c66742a75 by Sergey Poznyakoff

Fix reusability of smtp mailers.

* libproto/mailer/smtp.c (_smtp_set_rcpt): Initialize smtp->ptr to
smtp->buffer, not NULL.
(smtp_close): Reset smtp->state.
1 parent 8594f053
......@@ -200,7 +200,7 @@ static int _smtp_set_rcpt (smtp_t, mu_message_t, mu_address_t);
static void
CLEAR_STATE (smtp_t smtp)
{
smtp->ptr = NULL;
smtp->ptr = smtp->buffer;
smtp->nl = NULL;
smtp->s_offset = 0;
......@@ -559,6 +559,7 @@ smtp_close (mu_mailer_t mailer)
default:
break;
}
smtp->state = SMTP_NO_STATE;
return mu_stream_close (mailer->stream);
}
......