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)
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;
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)
{
goto EXPAND_FAILED;
}
- Uskip_whitespace(&s);
+ Uskip_whitespace(&s); /*{*/
if (*s++ != '}')
{ /*{*/
expand_string_message = string_sprintf("missing } at end of condition "
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 */
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))
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)
{
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);