Bug 53740

Summary: Code clean up - remove duplicated logic in buckets/apr_brigade.c
Product: APR Reporter: Christophe JAILLET <christophe.jaillet>
Component: APRAssignee: Apache Portable Runtime bugs mailinglist <bugs>
Severity: minor Keywords: FixedInTrunk
Priority: P2    
Version: HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Proposed patch

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