Commit dc0dbafe dc0dbafe6fbd3560a4140e98777fb58bc433e92f by Sergey Poznyakoff

Bugfix

* libproto/pop/pop3_stream.c (_pop3_event_cb)
(mu_pop3_filter_create): Fix buffer size manipulation.
* libmu_auth/tls.c: Protect gnutls debugging code with
DEBUG_TLS.
1 parent 4af4860e
......@@ -115,7 +115,7 @@ mu_check_tls_environment (void)
int mu_tls_enable = 0;
#if 0
#ifdef DEBUG_TLS
void
_mu_gtls_logger(int level, const char *text)
{
......@@ -128,7 +128,7 @@ mu_init_tls_libs (void)
{
if (mu_tls_module_config.enable && !mu_tls_enable)
mu_tls_enable = !gnutls_global_init (); /* Returns 1 on success */
#if 0
#ifdef DEBUG_TLS
gnutls_global_set_log_function (_mu_gtls_logger);
gnutls_global_set_log_level (110);
#endif
......
......@@ -56,7 +56,8 @@ _pop3_event_cb (mu_stream_t str, int ev, int flags)
if (sp->flags & _POP3F_CHBUF)
{
mu_stream_ioctl (str, MU_IOCTL_SET_TRANSPORT_BUFFER,
mu_stream_ioctl (sp->pop3->carrier,
MU_IOCTL_SET_TRANSPORT_BUFFER,
&sp->oldbuf);
sp->flags = _POP3F_DONE;
}
......@@ -73,27 +74,24 @@ mu_pop3_filter_create (mu_stream_t *pstream, mu_stream_t stream)
MU_STREAM_READ | MU_STREAM_AUTOCLOSE);
if (rc == 0)
{
struct mu_pop3_stream *sp = (struct mu_pop3_stream *) stream;
mu_stream_t str = *pstream;
mu_transport_t trans[2];
str->event_cb = _pop3_event_cb;
str->event_mask = _MU_STR_EOF;
if (mu_stream_ioctl (str, MU_IOCTL_GET_TRANSPORT, trans) == 0)
sp->oldbuf.type = MU_TRANSPORT_OUTPUT;
if (mu_stream_ioctl (sp->pop3->carrier, MU_IOCTL_GET_TRANSPORT_BUFFER,
&sp->oldbuf) == 0)
{
struct mu_pop3_stream *sp = (struct mu_pop3_stream *) trans[0];
if (mu_stream_ioctl (stream, MU_IOCTL_GET_TRANSPORT_BUFFER,
&sp->oldbuf) == 0)
{
struct mu_buffer_query newbuf;
sp->flags |= _POP3F_CHBUF;
newbuf.type = MU_TRANSPORT_OUTPUT;
newbuf.buftype = mu_buffer_full;
newbuf.bufsize = 64*1024;
mu_stream_ioctl (str, MU_IOCTL_SET_TRANSPORT_BUFFER,
&newbuf);
}
struct mu_buffer_query newbuf;
sp->flags |= _POP3F_CHBUF;
newbuf.type = MU_TRANSPORT_OUTPUT;
newbuf.buftype = mu_buffer_full;
newbuf.bufsize = 64*1024;
mu_stream_ioctl (sp->pop3->carrier, MU_IOCTL_SET_TRANSPORT_BUFFER,
&newbuf);
}
}
return rc;
......