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.
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -200,7 +200,7 @@ static int _smtp_set_rcpt (smtp_t, mu_message_t, mu_address_t); | ... | @@ -200,7 +200,7 @@ static int _smtp_set_rcpt (smtp_t, mu_message_t, mu_address_t); |
200 | static void | 200 | static void |
201 | CLEAR_STATE (smtp_t smtp) | 201 | CLEAR_STATE (smtp_t smtp) |
202 | { | 202 | { |
203 | smtp->ptr = NULL; | 203 | smtp->ptr = smtp->buffer; |
204 | smtp->nl = NULL; | 204 | smtp->nl = NULL; |
205 | smtp->s_offset = 0; | 205 | smtp->s_offset = 0; |
206 | 206 | ||
... | @@ -559,6 +559,7 @@ smtp_close (mu_mailer_t mailer) | ... | @@ -559,6 +559,7 @@ smtp_close (mu_mailer_t mailer) |
559 | default: | 559 | default: |
560 | break; | 560 | break; |
561 | } | 561 | } |
562 | smtp->state = SMTP_NO_STATE; | ||
562 | return mu_stream_close (mailer->stream); | 563 | return mu_stream_close (mailer->stream); |
563 | } | 564 | } |
564 | 565 | ... | ... |
-
Please register or sign in to post a comment