jwoolley 02/05/23 14:34:28
Modified: buckets apr_brigade.c
include apr_buckets.h
Log:
Resolve veto.
Submitted by: Greg Stein
Revision Changes Path
1.40 +12 -13 apr-util/buckets/apr_brigade.c
Index: apr_brigade.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_brigade.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -u -r1.39 -r1.40
--- apr_brigade.c 12 May 2002 21:45:27 -0000 1.39
+++ apr_brigade.c 23 May 2002 21:34:27 -0000 1.40
@@ -448,36 +448,35 @@
return APR_SUCCESS;
}
-APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *b,
+APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
apr_brigade_flush flush, void
*ctx,
const char *str)
{
- apr_bucket *e = APR_BRIGADE_LAST(b);
- if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) {
+ apr_bucket *bkt = APR_BRIGADE_LAST(bb);
+ if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) {
/* If there is some space available in a heap bucket
* at the end of the brigade, start copying the string
*/
- apr_bucket_heap *h = e->data;
- char *buf = h->base + e->start + e->length;
- apr_size_t bytes_avail = h->alloc_len - e->length;
- const char *s = str;
+ apr_bucket_heap *h = bkt->data;
+ char *buf = h->base + bkt->start + bkt->length;
+ apr_size_t bytes_avail = h->alloc_len - bkt->length;
+ const char *saved_start = str;
- while (bytes_avail && *s) {
- *buf++ = *s++;
+ while (bytes_avail && *str) {
+ *buf++ = *str++;
bytes_avail--;
}
- e->length += (s - str);
- if (!*s) {
+ bkt->length += (str - saved_start);
+ if (!*str) {
return APR_SUCCESS;
}
- str = s;
}
/* If the string has not been copied completely to the brigade,
* delegate the remaining work to apr_brigade_write(), which
* knows how to grow the brigade
*/
- return apr_brigade_write(b, flush, ctx, str, strlen(str));
+ return apr_brigade_write(bb, flush, ctx, str, strlen(str));
}
APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
1.138 +2 -2 apr-util/include/apr_buckets.h
Index: apr_buckets.h
===================================================================
RCS file: /home/cvs/apr-util/include/apr_buckets.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -u -r1.137 -r1.138
--- apr_buckets.h 14 May 2002 20:49:40 -0000 1.137
+++ apr_buckets.h 23 May 2002 21:34:27 -0000 1.138
@@ -793,13 +793,13 @@
/**
* This function writes an string into a bucket brigade.
- * @param b The bucket brigade to add to
+ * @param bb The bucket brigade to add to
* @param flush The flush function to use if the brigade is full
* @param ctx The structure to pass to the flush function
* @param str The string to add
* @return APR_SUCCESS or error code
*/
-APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *b,
+APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
apr_brigade_flush flush, void
*ctx,
const char *str);