headers_buckets.c   headers_buckets.c 
skipping to change at line 164 skipping to change at line 164
while (found) { while (found) {
if (strcasecmp(found->header, header) == 0) { if (strcasecmp(found->header, header) == 0) {
if (val) { if (val) {
/* The header is already present. RFC 2616, section 4.2 /* The header is already present. RFC 2616, section 4.2
indicates that we should append the new value, separated by indicates that we should append the new value, separated by
a comma. Reasoning: for headers whose values are known to a comma. Reasoning: for headers whose values are known to
be comma-separated, that is clearly the correct behavior ; be comma-separated, that is clearly the correct behavior ;
for others, the correct behavior is undefined anyway. */ for others, the correct behavior is undefined anyway. */
/* The "+1" is for the comma; serf_bstrmemdup() will also a /* The "+1" is for the comma; the +1 in the alloc
dd call is for the terminating '\0' */
one slot for the terminating '\0'. */
apr_size_t new_size = found->value_size + value_size + 1; apr_size_t new_size = found->value_size + value_size + 1;
char *new_val = serf_bucket_mem_alloc(headers_bucket->alloc ator, char *new_val = serf_bucket_mem_alloc(headers_bucket->alloc ator,
new_size); new_size + 1);
memcpy(new_val, val, value_size); memcpy(new_val, val, value_size);
new_val[value_size] = ','; new_val[value_size] = ',';
memcpy(new_val + value_size + 1, found->value, memcpy(new_val + value_size + 1, found->value,
found->value_size); found->value_size);
new_val[new_size] = '\0'; new_val[new_size] = '\0';
/* Copy the new value over the already existing value. */ /* Copy the new value over the already existing value. */
if (val_alloc) if (val_alloc)
serf_bucket_mem_free(headers_bucket->allocator, (void*) val); serf_bucket_mem_free(headers_bucket->allocator, (void*) val);
val_alloc |= ALLOC_VALUE; val_alloc |= ALLOC_VALUE;
val = new_val; val = new_val;
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/