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
Status: RESOLVED FIXED
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
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2012-08-19 22:02 UTC by Christophe JAILLET
Modified: 2013-04-05 20:26 UTC (History)
0 users



Attachments
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

Hi,

'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_brigade_puts'
        apr_size_t bytes_avail = h->alloc_len - bkt->length;
'apr_brigade_write'
        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
r1402870
Comment 2 Stefan Fritsch 2013-04-05 20:26:18 UTC
fixed in 1.5.2