diff options
author | Colin Guthrie <pulse@colin.guthr.ie> | 2008-05-02 09:47:09 +0000 |
---|---|---|
committer | Colin Guthrie <pulse@colin.guthr.ie> | 2008-10-08 20:32:06 +0100 |
commit | 91edf9eaca3a0da83484c9c3787beff2cc7a5945 (patch) | |
tree | d8ac4cf016bcc2cc32c38fd319f72c60e4f9bb66 | |
parent | 6570620cc3717eb82acd19788538fda3786c7b99 (diff) |
Use pa_sprintf_malloc to do simple concatenation rather than using the higher overhead of pa_strbuf
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2348 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r-- | src/modules/rtp/headerlist.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/rtp/headerlist.c b/src/modules/rtp/headerlist.c index 9ea17ae3..8bdc7251 100644 --- a/src/modules/rtp/headerlist.c +++ b/src/modules/rtp/headerlist.c @@ -92,22 +92,20 @@ int pa_headerlist_puts(pa_headerlist *p, const char *key, const char *value) { int pa_headerlist_putsappend(pa_headerlist *p, const char *key, const char *value) { struct header *hdr; pa_bool_t add = FALSE; - pa_strbuf *buf; pa_assert(p); pa_assert(key); - buf = pa_strbuf_new(); if (!(hdr = pa_hashmap_get(MAKE_HASHMAP(p), key))) { hdr = pa_xnew(struct header, 1); hdr->key = pa_xstrdup(key); + hdr->value = pa_xstrdup(value); add = TRUE; } else { - pa_strbuf_puts(buf, hdr->value); + void *newval = (void*)pa_sprintf_malloc("%s%s", (char*)hdr->value, value); pa_xfree(hdr->value); + hdr->value = newval; } - pa_strbuf_puts(buf, value); - hdr->value = pa_strbuf_tostring_free(buf); hdr->nbytes = strlen(hdr->value)+1; if (add) |