Fix the SMTP SASL (client) without trace.
* include/mailutils/sys/smtp.h (_mu_smtp_get_streams) (_mu_smtp_set_streams): New protos. * libproto/mailer/smtp_gsasl.c (insert_gsasl_stream): Use _mu_smtp_get_streams and _mu_smtp_set_streams to change streams. * libproto/mailer/smtp_starttls.c (smtp_get_streams): Rename to _mu_smtp_get_streams. All callers changed. (smtp_set_streams): Rename to _mu_smtp_set_streams. All callers changed.
Showing
3 changed files
with
15 additions
and
12 deletions
... | @@ -97,4 +97,8 @@ int _mu_smtp_mech_impl (mu_smtp_t smtp, mu_list_t list); | ... | @@ -97,4 +97,8 @@ int _mu_smtp_mech_impl (mu_smtp_t smtp, mu_list_t list); |
97 | int _mu_smtp_data_begin (mu_smtp_t smtp); | 97 | int _mu_smtp_data_begin (mu_smtp_t smtp); |
98 | int _mu_smtp_data_end (mu_smtp_t smtp); | 98 | int _mu_smtp_data_end (mu_smtp_t smtp); |
99 | 99 | ||
100 | int _mu_smtp_get_streams (mu_smtp_t smtp, mu_stream_t *streams); | ||
101 | int _mu_smtp_set_streams (mu_smtp_t smtp, mu_stream_t *streams); | ||
102 | |||
103 | |||
100 | #endif | 104 | #endif | ... | ... |
... | @@ -148,8 +148,8 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) | ... | @@ -148,8 +148,8 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) |
148 | { | 148 | { |
149 | mu_stream_t stream[2], newstream[2]; | 149 | mu_stream_t stream[2], newstream[2]; |
150 | int rc; | 150 | int rc; |
151 | 151 | ||
152 | rc = mu_stream_ioctl (smtp->carrier, MU_IOCTL_GET_STREAM, stream); | 152 | rc = _mu_smtp_get_streams (smtp, stream); |
153 | if (rc) | 153 | if (rc) |
154 | { | 154 | { |
155 | mu_error ("%s failed: %s", "MU_IOCTL_GET_STREAM", | 155 | mu_error ("%s failed: %s", "MU_IOCTL_GET_STREAM", |
... | @@ -158,7 +158,7 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) | ... | @@ -158,7 +158,7 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) |
158 | } | 158 | } |
159 | 159 | ||
160 | rc = gsasl_encoder_stream (&newstream[0], stream[0], sess_ctx, | 160 | rc = gsasl_encoder_stream (&newstream[0], stream[0], sess_ctx, |
161 | MU_STREAM_READ); | 161 | MU_STREAM_READ); |
162 | if (rc) | 162 | if (rc) |
163 | { | 163 | { |
164 | mu_error ("%s failed: %s", "gsasl_encoder_stream", | 164 | mu_error ("%s failed: %s", "gsasl_encoder_stream", |
... | @@ -179,10 +179,9 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) | ... | @@ -179,10 +179,9 @@ insert_gsasl_stream (mu_smtp_t smtp, Gsasl_session *sess_ctx) |
179 | mu_stream_flush (stream[1]); | 179 | mu_stream_flush (stream[1]); |
180 | mu_stream_unref (stream[0]); | 180 | mu_stream_unref (stream[0]); |
181 | mu_stream_unref (stream[1]); | 181 | mu_stream_unref (stream[1]); |
182 | |||
183 | rc = _mu_smtp_set_streams (smtp, newstream); | ||
182 | 184 | ||
183 | rc = mu_stream_ioctl (smtp->carrier, MU_IOCTL_SET_STREAM, newstream); | ||
184 | mu_stream_unref (newstream[0]); | ||
185 | mu_stream_unref (newstream[1]); | ||
186 | if (rc) | 185 | if (rc) |
187 | { | 186 | { |
188 | mu_error ("%s failed when it should not: %s", | 187 | mu_error ("%s failed when it should not: %s", | ... | ... |
... | @@ -27,8 +27,8 @@ | ... | @@ -27,8 +27,8 @@ |
27 | #include <mailutils/sys/smtp.h> | 27 | #include <mailutils/sys/smtp.h> |
28 | #include <mailutils/tls.h> | 28 | #include <mailutils/tls.h> |
29 | 29 | ||
30 | static int | 30 | int |
31 | smtp_get_streams (mu_smtp_t smtp, mu_stream_t *streams) | 31 | _mu_smtp_get_streams (mu_smtp_t smtp, mu_stream_t *streams) |
32 | { | 32 | { |
33 | int rc; | 33 | int rc; |
34 | 34 | ||
... | @@ -45,8 +45,8 @@ smtp_get_streams (mu_smtp_t smtp, mu_stream_t *streams) | ... | @@ -45,8 +45,8 @@ smtp_get_streams (mu_smtp_t smtp, mu_stream_t *streams) |
45 | return rc; | 45 | return rc; |
46 | } | 46 | } |
47 | 47 | ||
48 | static int | 48 | int |
49 | smtp_set_streams (mu_smtp_t smtp, mu_stream_t *streams) | 49 | _mu_smtp_set_streams (mu_smtp_t smtp, mu_stream_t *streams) |
50 | { | 50 | { |
51 | int rc; | 51 | int rc; |
52 | 52 | ||
... | @@ -100,7 +100,7 @@ mu_smtp_starttls (mu_smtp_t smtp) | ... | @@ -100,7 +100,7 @@ mu_smtp_starttls (mu_smtp_t smtp) |
100 | return MU_ERR_FAILURE; | 100 | return MU_ERR_FAILURE; |
101 | 101 | ||
102 | mu_stream_flush (smtp->carrier); | 102 | mu_stream_flush (smtp->carrier); |
103 | status = smtp_get_streams (smtp, streams); | 103 | status = _mu_smtp_get_streams (smtp, streams); |
104 | MU_SMTP_CHECK_ERROR (smtp, status); | 104 | MU_SMTP_CHECK_ERROR (smtp, status); |
105 | 105 | ||
106 | status = mu_tls_client_stream_create (&tlsstream, | 106 | status = mu_tls_client_stream_create (&tlsstream, |
... | @@ -115,7 +115,7 @@ mu_smtp_starttls (mu_smtp_t smtp) | ... | @@ -115,7 +115,7 @@ mu_smtp_starttls (mu_smtp_t smtp) |
115 | return status; | 115 | return status; |
116 | } | 116 | } |
117 | streams[0] = streams[1] = tlsstream; | 117 | streams[0] = streams[1] = tlsstream; |
118 | status = smtp_set_streams (smtp, streams); | 118 | status = _mu_smtp_set_streams (smtp, streams); |
119 | mu_stream_unref (streams[0]); | 119 | mu_stream_unref (streams[0]); |
120 | mu_stream_unref (streams[1]); | 120 | mu_stream_unref (streams[1]); |
121 | MU_SMTP_CHECK_ERROR (smtp, status); | 121 | MU_SMTP_CHECK_ERROR (smtp, status); | ... | ... |
-
Please register or sign in to post a comment