[exim-cvs] tidying

Inizio della pagina
Delete this message
Reply to this message
Autore: Exim Git Commits Mailing List
Data:  
To: exim-cvs
Oggetto: [exim-cvs] tidying
Gitweb: https://git.exim.org/exim.git/commitdiff/48e32fe6695541cccec39bb48cebf023f447e462
Commit:     48e32fe6695541cccec39bb48cebf023f447e462
Parent:     b3ce3e5440ea0ce5e3580aa9a0fa18c88214a286
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Mar 14 12:54:11 2021 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Apr 25 21:45:13 2021 +0100


    tidying
---
 src/src/dbstuff.h         |  2 +-
 src/src/deliver.c         |  2 --
 src/src/expand.c          | 11 ++++-------
 src/src/string.c          |  7 +++++--
 src/src/transports/smtp.c |  7 ++-----
 5 files changed, 12 insertions(+), 17 deletions(-)


diff --git a/src/src/dbstuff.h b/src/src/dbstuff.h
index 8993415..8a8a5fb 100644
--- a/src/src/dbstuff.h
+++ b/src/src/dbstuff.h
@@ -75,7 +75,7 @@ free() must not die when passed NULL */
         key.dptr != NULL)


/* EXIM_DBDELETE_CURSOR - terminate scanning operation. */
-#define EXIM_DBDELETE_CURSOR(cursor) free(cursor)
+#define EXIM_DBDELETE_CURSOR(cursor) store_free(cursor)

 /* EXIM_DBCLOSE */
 #define EXIM_DBCLOSE__(db)        tdb_close(db)
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 9ebd281..f2187e2 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -2884,10 +2884,8 @@ while (addr_local)
   deliveries (e.g. to pipes) can take a substantial time. */


   if (!(dbm_file = dbfn_open(US"retry", O_RDONLY, &dbblock, FALSE, TRUE)))
-    {
     DEBUG(D_deliver|D_retry|D_hints_lookup)
       debug_printf("no retry data available\n");
-    }


   addr2 = addr;
   addr3 = NULL;
diff --git a/src/src/expand.c b/src/src/expand.c
index bce3356..989e97b 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -6431,13 +6431,10 @@ while (*s)
       condition for real. For EITEM_MAP and EITEM_REDUCE, do the same, using
       the normal internal expansion function. */


-      if (item_type == EITEM_FILTER)
-        {
-        if ((temp = eval_condition(expr, &resetok, NULL)))
-      s = temp;
-        }
-      else
+      if (item_type != EITEM_FILTER)
         temp = expand_string_internal(s, TRUE, &s, TRUE, TRUE, &resetok);
+      else
+        if ((temp = eval_condition(expr, &resetok, NULL))) s = temp;


       if (!temp)
         {
@@ -6446,7 +6443,7 @@ while (*s)
         goto EXPAND_FAILED;
         }


-      Uskip_whitespace(&s);
+      Uskip_whitespace(&s);                /*{*/
       if (*s++ != '}')
         {                        /*{*/
         expand_string_message = string_sprintf("missing } at end of condition "
diff --git a/src/src/string.c b/src/src/string.c
index afdb517..fbb1953 100644
--- a/src/src/string.c
+++ b/src/src/string.c
@@ -952,12 +952,15 @@ else
     s = ss;
     if (!*s || *++s != sep || sep_is_special) break;
     }
+
+  /* Trim trailing spaces from the returned string */
+
   /* while (g->ptr > 0 && isspace(g->s[g->ptr-1])) g->ptr--; */
   while (  g->ptr > 0 && isspace(g->s[g->ptr-1])
     && (g->ptr == 1 || g->s[g->ptr-2] != '\\') )
     g->ptr--;
   buffer = string_from_gstring(g);
-  gstring_release_unused(g);
+  gstring_release_unused_trc(g, func, line);
   }


 /* Update the current pointer and return the new string */
@@ -1143,7 +1146,7 @@ BOOL srctaint = is_tainted(s);
 if (!g)
   {
   unsigned inc = count < 4096 ? 127 : 1023;
-  unsigned size = ((count + inc) &  ~inc) + 1;
+  unsigned size = ((count + inc) &  ~inc) + 1;    /* round up requested count */
   g = string_get_tainted(size, srctaint);
   }
 else if (srctaint && !is_tainted(g->s))
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 5294057..e7e0321 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -3607,13 +3607,12 @@ for (int fd_bits = 3; fd_bits; )
       timeout = 5;
       }
     else
-      {
       for (int nbytes = 0; rc - nbytes > 0; nbytes += i)
     if ((i = write(pfd[0], buf + nbytes, rc - nbytes)) < 0) goto done;
-      }


   /* Handle outbound data.  We cannot combine payload and the TLS-close
-  due to the limitations of the (pipe) channel feeding us. */
+  due to the limitations of the (pipe) channel feeding us.  Maybe use a unix-domain
+  socket? */
   if (FD_ISSET(pfd[0], &rfds))
     if ((rc = read(pfd[0], buf, bsize)) <= 0)
       {
@@ -3628,11 +3627,9 @@ for (int fd_bits = 3; fd_bits; )
       shutdown(tls_out.active.sock, SHUT_WR);
       }
     else
-      {
       for (int nbytes = 0; rc - nbytes > 0; nbytes += i)
     if ((i = tls_write(ct_ctx, buf + nbytes, rc - nbytes, FALSE)) < 0)
       goto done;
-      }


if (fd_bits & 1) FD_SET(tls_out.active.sock, &rfds);
if (fd_bits & 2) FD_SET(pfd[0], &rfds);