diff options
Diffstat (limited to 'src/tunnel.c')
-rw-r--r-- | src/tunnel.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/tunnel.c b/src/tunnel.c index 71495cc..299c254 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -4,3 +4,3 @@ This file is part of GNU Anubis. - Copyright (C) 2001-2014 The Anubis Team. + Copyright (C) 2001-2024 The Anubis Team. @@ -23,6 +23,2 @@ -#define obstack_chunk_alloc malloc -#define obstack_chunk_free free -#include <obstack.h> - static int transfer_command (MESSAGE); @@ -42,4 +38,2 @@ get_ehlo_domain (void) } - - @@ -212,3 +206,3 @@ collect_body (MESSAGE msg) size_t size = 0; - struct obstack stk; + struct stringbuf sb = STRINGBUF_INITIALIZER; int state = 0; @@ -219,3 +213,2 @@ collect_body (MESSAGE msg) len = strlen (boundary); - obstack_init (&stk); while (state != ST_DONE @@ -249,4 +242,4 @@ collect_body (MESSAGE msg) { - obstack_grow (&stk, buf, strlen (buf)); - obstack_1grow (&stk, '\n'); + stringbuf_add_string (&sb, buf); + stringbuf_add_char (&sb, '\n'); } @@ -256,4 +249,4 @@ collect_body (MESSAGE msg) { - obstack_grow (&stk, buf, strlen (buf)); - obstack_1grow (&stk, '\n'); + stringbuf_add_string (&sb, buf); + stringbuf_add_char (&sb, '\n'); } @@ -261,6 +254,4 @@ collect_body (MESSAGE msg) free (buf); - obstack_1grow (&stk, 0); /* FIXME: Use message_proc_body to avoid spurious reallocations */ - message_replace_body (msg, xstrdup (obstack_finish (&stk))); - obstack_free (&stk, NULL); + message_replace_body (msg, stringbuf_finish (&sb)); } |