diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:44 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:44 +0100 |
commit | c99b717062c6228c4ac6df3831702f81c9806df4 (patch) | |
tree | 8cc83ebb36aa5b7f8691152db83071784fbfc1c7 /src/data_string.c | |
parent | 1b24d86e6b2179692e60091dec59f797cd308b9e (diff) | |
download | lighttpd-c99b717062c6228c4ac6df3831702f81c9806df4.tar.gz |
Imported Upstream version 1.4.13~r1370upstream/1.4.13_r1370
Diffstat (limited to 'src/data_string.c')
-rw-r--r-- | src/data_string.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/data_string.c b/src/data_string.c index e7aab1a..391af9e 100644 --- a/src/data_string.c +++ b/src/data_string.c @@ -17,16 +17,16 @@ static data_unset *data_string_copy(const data_unset *s) { static void data_string_free(data_unset *d) { data_string *ds = (data_string *)d; - + buffer_free(ds->key); buffer_free(ds->value); - + free(d); } static void data_string_reset(data_unset *d) { data_string *ds = (data_string *)d; - + /* reused array elements */ buffer_reset(ds->key); buffer_reset(ds->value); @@ -35,23 +35,23 @@ static void data_string_reset(data_unset *d) { static int data_string_insert_dup(data_unset *dst, data_unset *src) { data_string *ds_dst = (data_string *)dst; data_string *ds_src = (data_string *)src; - + if (ds_dst->value->used) { buffer_append_string(ds_dst->value, ", "); buffer_append_string_buffer(ds_dst->value, ds_src->value); } else { buffer_copy_string_buffer(ds_dst->value, ds_src->value); } - + src->free(src); - + return 0; } static int data_response_insert_dup(data_unset *dst, data_unset *src) { data_string *ds_dst = (data_string *)dst; data_string *ds_src = (data_string *)src; - + if (ds_dst->value->used) { buffer_append_string(ds_dst->value, "\r\n"); buffer_append_string_buffer(ds_dst->value, ds_dst->key); @@ -60,9 +60,9 @@ static int data_response_insert_dup(data_unset *dst, data_unset *src) { } else { buffer_copy_string_buffer(ds_dst->value, ds_src->value); } - + src->free(src); - + return 0; } @@ -77,28 +77,28 @@ static void data_string_print(const data_unset *d, int depth) { data_string *data_string_init(void) { data_string *ds; - + ds = calloc(1, sizeof(*ds)); assert(ds); - + ds->key = buffer_init(); ds->value = buffer_init(); - + ds->copy = data_string_copy; ds->free = data_string_free; ds->reset = data_string_reset; ds->insert_dup = data_string_insert_dup; ds->print = data_string_print; ds->type = TYPE_STRING; - + return ds; } data_string *data_response_init(void) { data_string *ds; - + ds = data_string_init(); ds->insert_dup = data_response_insert_dup; - + return ds; } |