uschar *
fn_hdrs_added(void)
{
-uschar * ret = NULL;
-int size = 0;
-int ptr = 0;
+gstring * g = NULL;
header_line * h = acl_added_headers;
uschar * s;
uschar * cp;
if (cp[1] == '\0') break;
/* contains embedded newline; needs doubling */
- ret = string_catn(ret, &size, &ptr, s, cp-s+1);
- ret = string_catn(ret, &size, &ptr, US"\n", 1);
+ g = string_catn(g, s, cp-s+1);
+ g = string_catn(g, US"\n", 1);
s = cp+1;
}
/* last bit of header */
- ret = string_catn(ret, &size, &ptr, s, cp-s+1); /* newline-sep list */
+/*XXX could we use add_listele? */
+ g = string_catn(g, s, cp-s+1); /* newline-sep list */
}
while((h = h->next));
-ret[ptr-1] = '\0'; /* overwrite last newline */
-return ret;
+g->s[g->ptr - 1] = '\0'; /* overwrite last newline */
+return g->s;
}
HDEBUG(D_acl)
debug_printf_indent("udpsend [%s]:%d %s\n", h->address, portnum, arg);
+/*XXX this could better use sendto */
r = s = ip_connectedsocket(SOCK_DGRAM, h->address, portnum, portnum,
- 1, NULL, &errstr);
+ 1, NULL, &errstr, NULL);
if (r < 0) goto defer;
len = Ustrlen(arg);
r = send(s, arg, len, 0);
}
else ss = s;
-while (isspace(*ss))ss++;
+while (isspace(*ss)) ss++;
/* If we can't find a named ACL, the default is to parse it as an inline one.
(Unless it begins with a slash; non-existent files give rise to an error.) */