commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-608-gd2455d5


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-608-gd2455d5
Date: Thu, 07 Jun 2012 15:04:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=d2455d52c2789022e57b80584140248aedd3973e

The branch, master has been updated
       via  d2455d52c2789022e57b80584140248aedd3973e (commit)
       via  8f95e3582c89689599c7e5a0496d4f9fc2cc4e06 (commit)
      from  8ef7c0ad473e5271fb349a69c819675e242235a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d2455d52c2789022e57b80584140248aedd3973e
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Jun 7 18:00:21 2012 +0300

    Minor fix.
    
    * imap4d/imap4d.c Include mailutils/gsasl.h unconditionally.

commit 8f95e3582c89689599c7e5a0496d4f9fc2cc4e06
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Jun 7 14:20:50 2012 +0300

    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.

-----------------------------------------------------------------------

Summary of changes:
 imap4d/imap4d.c            |    4 +---
 include/mailutils/server.h |    5 +++++
 libmailutils/server/msrv.c |   12 ++++++------
 maidag/lmtp.c              |   19 +------------------
 maidag/maidag.c            |   15 ++++++++++++++-
 5 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c
index 04fe4d5..d05c862 100644
--- a/imap4d/imap4d.c
+++ b/imap4d/imap4d.c
@@ -15,9 +15,7 @@
    along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. */
 
 #include "imap4d.h"
-#ifdef WITH_GSASL
-# include <mailutils/gsasl.h>
-#endif
+#include <mailutils/gsasl.h>
 #include "mailutils/libargp.h"
 #include "tcpwrap.h"
 
diff --git a/include/mailutils/server.h b/include/mailutils/server.h
index cd87609..dd50f95 100644
--- a/include/mailutils/server.h
+++ b/include/mailutils/server.h
@@ -119,6 +119,11 @@ void mu_m_server_set_strexit (mu_m_server_t srv, const 
char *(*fun) (int));
 void mu_m_server_set_app_data_size (mu_m_server_t srv, size_t size);
 int mu_m_server_set_config_size (mu_m_server_t srv, size_t size);
 
+struct mu_srv_config *mu_m_server_listen (mu_m_server_t msrv,
+                                         struct mu_sockaddr *s, int type);
+int mu_m_server_parse_url (mu_m_server_t msrv, const char *arg,
+                          struct mu_sockaddr **psa);
+
 int mu_m_server_mode (mu_m_server_t srv);
 int mu_m_server_foreground (mu_m_server_t srv);
 time_t mu_m_server_timeout (mu_m_server_t srv);
diff --git a/libmailutils/server/msrv.c b/libmailutils/server/msrv.c
index a8080da..6f848f9 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;
diff --git a/maidag/lmtp.c b/maidag/lmtp.c
index 49b478f..9c8b9ea 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 a5843a0..dc86387 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"


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]