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-624-g3412850


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-624-g3412850
Date: Mon, 23 Jul 2012 05:57:52 +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=34128509db514024afd85a714cb9cad1f71d2d82

The branch, master has been updated
       via  34128509db514024afd85a714cb9cad1f71d2d82 (commit)
      from  0b1e16bea8f32524dd123cc267fe1839f9bc3b0f (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 34128509db514024afd85a714cb9cad1f71d2d82
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Jul 23 08:54:38 2012 +0300

    Minor changes in SMTP and URL code.
    
    * include/mailutils/smtp.h (mu_smtp_replcode)
    (mu_smtp_sget_reply)
    (mu_smtp_capa_iterator): New protos.
    * libmailutils/url/dup.c (mu_url_dup): Bugfix. Obtain the
    name using mu_url_sget_name, which will create it if necessary.
    * libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add
    smtp_capa_itr.c
    * libproto/mailer/smtp_capa_itr.c: New file.
    * libproto/mailer/smtp_io.c (mu_smtp_response): Fix filling of
    smtp->flbuf.
    (mu_smtp_replcode,mu_smtp_sget_reply): New functions.

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

Summary of changes:
 include/mailutils/smtp.h                         |    5 +++++
 libmailutils/url/dup.c                           |    4 +++-
 libproto/mailer/Makefile.am                      |    1 +
 libproto/mailer/{smtp_capa.c => smtp_capa_itr.c} |    7 ++++---
 libproto/mailer/smtp_io.c                        |   19 ++++++++++++++++++-
 5 files changed, 31 insertions(+), 5 deletions(-)
 copy libproto/mailer/{smtp_capa.c => smtp_capa_itr.c} (88%)

diff --git a/include/mailutils/smtp.h b/include/mailutils/smtp.h
index 4ae6a33..6d8cdd9 100644
--- a/include/mailutils/smtp.h
+++ b/include/mailutils/smtp.h
@@ -45,6 +45,10 @@ int mu_smtp_open (mu_smtp_t);
 int mu_smtp_response (mu_smtp_t smtp);
 int mu_smtp_write (mu_smtp_t smtp, const char *fmt, ...) MU_PRINTFLIKE(2,3);
 
+int mu_smtp_replcode (mu_smtp_t smtp, char *buf);
+int mu_smtp_sget_reply (mu_smtp_t smtp, const char **pbuf);
+
+
 #define MU_SMTP_TRACE_CLR 0
 #define MU_SMTP_TRACE_SET 1
 #define MU_SMTP_TRACE_QRY 2
@@ -61,6 +65,7 @@ int mu_smtp_set_secret (mu_smtp_t smtp, mu_secret_t secret);
 int mu_smtp_get_secret (mu_smtp_t smtp, mu_secret_t *secret);
 
 int mu_smtp_capa_test (mu_smtp_t smtp, const char *capa, const char **pret);
+int mu_smtp_capa_iterator (mu_smtp_t smtp, mu_iterator_t *itr);
 int mu_smtp_starttls (mu_smtp_t smtp);
 
 int mu_smtp_mail_basic (mu_smtp_t smtp, const char *email,
diff --git a/libmailutils/url/dup.c b/libmailutils/url/dup.c
index 141463e..5b78d52 100644
--- a/libmailutils/url/dup.c
+++ b/libmailutils/url/dup.c
@@ -34,11 +34,13 @@ int
 mu_url_dup (mu_url_t old_url, mu_url_t *new_url)
 {
   int rc;
+  const char *s;
   mu_url_t url = calloc (1, sizeof (*url));
 
   if (!url)
     return ENOMEM;
-  url->name = strdup (old_url->name);
+  mu_url_sget_name (old_url, &s);
+  url->name = strdup (s);
   if (!url->name)
     {
       free (url);
diff --git a/libproto/mailer/Makefile.am b/libproto/mailer/Makefile.am
index 5fae967..1436804 100644
--- a/libproto/mailer/Makefile.am
+++ b/libproto/mailer/Makefile.am
@@ -32,6 +32,7 @@ libmu_mailer_la_SOURCES = \
  smtp.c\
  smtp_auth.c\
  smtp_capa.c\
+ smtp_capa_itr.c\
  smtp_carrier.c\
  smtp_create.c\
  smtp_data.c\
diff --git a/libproto/mailer/smtp_capa.c b/libproto/mailer/smtp_capa_itr.c
similarity index 88%
copy from libproto/mailer/smtp_capa.c
copy to libproto/mailer/smtp_capa_itr.c
index 07b99cf..25152fa 100644
--- a/libproto/mailer/smtp_capa.c
+++ b/libproto/mailer/smtp_capa_itr.c
@@ -22,13 +22,14 @@
 #include <stdlib.h>
 #include <mailutils/errno.h>
 #include <mailutils/list.h>
+#include <mailutils/iterator.h>
 #include <mailutils/smtp.h>
 #include <mailutils/sys/smtp.h>
 
 int
-mu_smtp_capa_test (mu_smtp_t smtp, const char *name, const char **pret)
+mu_smtp_capa_iterator (mu_smtp_t smtp, mu_iterator_t *itr)
 {
-  if (!smtp || !name)
+  if (!smtp || !itr)
     return EINVAL;
   if (MU_SMTP_FISSET (smtp, _MU_SMTP_ERR))
     return MU_ERR_FAILURE;
@@ -40,5 +41,5 @@ mu_smtp_capa_test (mu_smtp_t smtp, const char *name, const 
char **pret)
     }
   if (!MU_SMTP_FISSET (smtp, _MU_SMTP_ESMTP))
     return MU_ERR_FAILURE;
-  return mu_list_locate (smtp->capa, (void*) name, (void**)pret);
+  return mu_list_get_iterator (smtp->capa, itr);
 }
diff --git a/libproto/mailer/smtp_io.c b/libproto/mailer/smtp_io.c
index da46f77..8df32af 100644
--- a/libproto/mailer/smtp_io.c
+++ b/libproto/mailer/smtp_io.c
@@ -89,7 +89,8 @@ mu_smtp_response (mu_smtp_t smtp)
          smtp->flbuf = p;
          smtp->flsize = n;
        }
-      memcpy (smtp->flbuf, smtp->rdbuf + 4, n - 3);
+      memcpy (smtp->flbuf, smtp->rdbuf + 4, n - 1);
+      smtp->flbuf[n - 1] = 0;
       smtp->replptr = smtp->flbuf;
 
       rc = _mu_smtp_init_mlist (smtp);
@@ -125,6 +126,22 @@ mu_smtp_response (mu_smtp_t smtp)
   return 0;
 }
     
+int
+mu_smtp_replcode (mu_smtp_t smtp, char *buf)
+{
+  if (!smtp || !buf)
+    return EINVAL;
+  strcpy (buf, smtp->replcode);
+  return 0;
+}
 
+int
+mu_smtp_sget_reply (mu_smtp_t smtp, const char **pbuf)
+{
+  if (!smtp || !pbuf)
+    return EINVAL;
+  *pbuf = smtp->replptr;
+  return 0;
+}
   
   


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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