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 /libmailutils/server/msrv.c | |
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 'libmailutils/server/msrv.c')
-rw-r--r-- | libmailutils/server/msrv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libmailutils/server/msrv.c b/libmailutils/server/msrv.c index a8080daff..6f848f96b 100644 --- a/libmailutils/server/msrv.c +++ b/libmailutils/server/msrv.c @@ -453,8 +453,8 @@ static int m_srv_conn (int fd, struct sockaddr *sa, int salen, void *server_data, void *call_data, mu_ip_server_t srv); -static struct mu_srv_config * -add_server (mu_m_server_t msrv, struct mu_sockaddr *s, int type) +struct mu_srv_config * +mu_m_server_listen (mu_m_server_t msrv, struct mu_sockaddr *s, int type) { mu_ip_server_t tcpsrv; struct mu_srv_config *pconf; @@ -505,7 +505,7 @@ mu_m_server_begin (mu_m_server_t msrv) { struct mu_sockaddr *next = ta->next; ta->next = ta->prev = NULL; - add_server (msrv, ta, msrv->deftype); + mu_m_server_listen (msrv, ta, msrv->deftype); ta = next; } } @@ -789,7 +789,7 @@ server_block_begin (const char *arg, mu_m_server_t msrv, void **pdata) "only the first is used"), arg); mu_sockaddr_free (s->next); } - *pdata = add_server (msrv, s, msrv->deftype); + *pdata = mu_m_server_listen (msrv, s, msrv->deftype); return 0; } @@ -858,14 +858,14 @@ get_port (const char *p) return 1; } - return htons (n); + return n; } else { struct servent *sp = getservbyname (p, "tcp"); if (!sp) return 0; - return sp->s_port; + return ntohs (sp->s_port); } } return 0; |