Bug 53740 - Code clean up - remove duplicated logic in buckets/apr_brigade.c
Summary: Code clean up - remove duplicated logic in buckets/apr_brigade.c
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
Keywords: FixedInTrunk
Depends on:
Reported: 2012-08-19 22:02 UTC by Christophe JAILLET
Modified: 2013-04-05 20:26 UTC (History)
0 users

Proposed patch (1.34 KB, patch)
2012-08-19 22:02 UTC, Christophe JAILLET
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe JAILLET 2012-08-19 22:02:24 UTC
Created attachment 29252 [details]
Proposed patch


'apr_brigade_puts' has some logic to put by itself data in heap bucket at the end of the brigade or call 'apr_brigade_write' in all other cases.

AFAIK, all this logic is already part of 'apr_brigade_write'.

This only difference I see is in computation of the remaining space :
        apr_size_t bytes_avail = h->alloc_len - bkt->length;
        remaining = h->alloc_len - (e->length + (apr_size_t)e->start);

I don't really understand why it is different and what the 'e->start' stands for.

Anyway, I think it is safe to simplify 'apr_brigade_puts'.

Best regards.
Comment 1 Stefan Fritsch 2012-10-27 21:22:31 UTC
Comment 2 Stefan Fritsch 2013-04-05 20:26:18 UTC
fixed in 1.5.2