diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-06-07 14:20:50 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-06-07 14:20:50 +0300 |
commit | 8f95e3582c89689599c7e5a0496d4f9fc2cc4e06 (patch) | |
tree | adca55d632eaf17d28063699c16318c1b6d613f2 /maidag | |
parent | 8ef7c0ad473e5271fb349a69c819675e242235a2 (diff) | |
download | mailutils-8f95e3582c89689599c7e5a0496d4f9fc2cc4e06.tar.gz mailutils-8f95e3582c89689599c7e5a0496d4f9fc2cc4e06.tar.bz2 |
Fixes: port cfg statement, listen cfg statement in maidag, final dot recognition in maidag.
* include/mailutils/server.h (mu_m_server_listen)
(mu_m_server_parse_url): New protos.
* libmailutils/server/msrv.c (add_server): Rename to
mu_m_server_listen (now extern). All uses updated.
(get_port): Bugfix: return port in server byte order.
This fixes the use of the "port" configuration statement.
* maidag/lmtp.c (cfun_data): Don't switch to full buffering.
This makes it impossible to note the final dot in time.
* maidag/maidag.c (cb_listen): New callback.
(maidag_cfg_param): Attach cb_listen to the "listen" statement.
Diffstat (limited to 'maidag')
-rw-r--r-- | maidag/lmtp.c | 19 | ||||
-rw-r--r-- | maidag/maidag.c | 15 |
2 files changed, 15 insertions, 19 deletions
diff --git a/maidag/lmtp.c b/maidag/lmtp.c index 49b478f30..9c8b9ea0f 100644 --- a/maidag/lmtp.c +++ b/maidag/lmtp.c @@ -346,8 +346,7 @@ cfun_data (mu_stream_t iostr, char *arg) mu_stream_t flt, tempstr; time_t t; struct tm *tm; - int xlev = MU_XSCRIPT_PAYLOAD, xlev_switch = 0, buf_switch = 0; - struct mu_buffer_query oldbuf; + int xlev = MU_XSCRIPT_PAYLOAD, xlev_switch = 0; if (*arg) { @@ -389,19 +388,6 @@ cfun_data (mu_stream_t iostr, char *arg) lmtp_reply (iostr, "354", NULL, "Go ahead"); - if (mu_stream_ioctl (iostr, MU_IOCTL_TRANSPORT_BUFFER, - MU_IOCTL_OP_GET, &oldbuf) == 0) - { - struct mu_buffer_query newbuf; - - newbuf.type = MU_TRANSPORT_OUTPUT; - newbuf.buftype = mu_buffer_full; - newbuf.bufsize = 64*1024; - if (mu_stream_ioctl (iostr, MU_IOCTL_TRANSPORT_BUFFER, MU_IOCTL_OP_SET, - &newbuf)) - buf_switch = 1; - } - if (mu_stream_ioctl (iostr, MU_IOCTL_XSCRIPTSTREAM, MU_IOCTL_XSCRIPTSTREAM_LEVEL, &xlev) == 0) xlev_switch = 1; @@ -410,9 +396,6 @@ cfun_data (mu_stream_t iostr, char *arg) if (xlev_switch) mu_stream_ioctl (iostr, MU_IOCTL_XSCRIPTSTREAM, MU_IOCTL_XSCRIPTSTREAM_LEVEL, &xlev); - if (buf_switch) - mu_stream_ioctl (iostr, MU_IOCTL_TRANSPORT_BUFFER, MU_IOCTL_OP_SET, - &oldbuf); if (rc) { maidag_error (_("copy error: %s"), mu_strerror (rc)); diff --git a/maidag/maidag.c b/maidag/maidag.c index a5843a08b..dc8638794 100644 --- a/maidag/maidag.c +++ b/maidag/maidag.c @@ -415,6 +415,19 @@ cb_delivery_mode (void *data, mu_config_value_t *val) return 0; } +static int +cb_listen (void *data, mu_config_value_t *val) +{ + struct mu_sockaddr *s; + + if (mu_cfg_assert_value_type (val, MU_CFG_STRING)) + return 1; + if (mu_m_server_parse_url (server, val->v.string, &s)) + return 1; + mu_m_server_listen (server, s, MU_IP_TCP); + return 0; +} + struct mu_cfg_param maidag_cfg_param[] = { { "delivery-mode", mu_cfg_callback, NULL, 0, cb_delivery_mode, N_("Set delivery mode"), @@ -458,7 +471,7 @@ struct mu_cfg_param maidag_cfg_param[] = { { "group", mu_cfg_callback, &lmtp_groups, 0, cb_group, N_("In LMTP mode, retain these supplementary groups."), N_("groups: list of string") }, - { "listen", mu_cfg_string, &lmtp_url_string, 0, NULL, + { "listen", mu_cfg_callback, NULL, 0, cb_listen, N_("In LMTP mode, listen on the given URL. Valid URLs are:\n" " tcp://<address: string>:<port: number> (note that port is " "mandatory)\n" |