aboutsummaryrefslogtreecommitdiffstats
path: root/src/lmtp_proto.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-01 15:52:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-01 15:52:11 +0100
commit37845898cbf779c7d3b5664997d0db48968c929c (patch)
treea190b5ee9d152ba60135136bbe8108d7da81166c /src/lmtp_proto.c
parent8cc2aee8859731ee2fe280070423f79e7d009ca3 (diff)
downloadrspamd-37845898cbf779c7d3b5664997d0db48968c929c.tar.gz
rspamd-37845898cbf779c7d3b5664997d0db48968c929c.zip
Rework socket creation logic to support both ipv4 and ipv6 sockets.
Diffstat (limited to 'src/lmtp_proto.c')
-rw-r--r--src/lmtp_proto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lmtp_proto.c b/src/lmtp_proto.c
index eb92ed7c1..95b8ca13a 100644
--- a/src/lmtp_proto.c
+++ b/src/lmtp_proto.c
@@ -416,6 +416,7 @@ mta_read_socket (f_str_t * in, void *arg)
return FALSE;
}
cd->state = LMTP_WANT_CLOSING;
+ break;
case LMTP_WANT_CLOSING:
if (!parse_mta_str (in, cd)) {
msg_warn ("message not delivered");
@@ -452,10 +453,11 @@ lmtp_deliver_mta (struct worker_task *task)
if (task->cfg->deliver_family == AF_UNIX) {
un = alloca (sizeof (struct sockaddr_un));
- sock = make_unix_socket (task->cfg->deliver_host, un, FALSE, TRUE);
+ sock = make_unix_socket (task->cfg->deliver_host, un, SOCK_STREAM, FALSE, TRUE);
}
else {
- sock = make_tcp_socket (&task->cfg->deliver_addr, task->cfg->deliver_port, FALSE, TRUE);
+ sock = make_universal_socket (task->cfg->deliver_host, task->cfg->deliver_port,
+ SOCK_STREAM, TRUE, FALSE, TRUE);
}
if (sock == -1) {
msg_warn ("cannot create socket for %s, %s", task->cfg->deliver_host, strerror (errno));