You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/01/12 12:50:08 UTC
svn commit: r1896959 - in /apr/apr-util/branches/1.7.x: ./ buckets/apr_buckets_file.c
Author: ylavic
Date: Wed Jan 12 12:50:08 2022
New Revision: 1896959
URL: http://svn.apache.org/viewvc?rev=1896959&view=rev
Log:
Merge r1896812 from trunk:
apr_buckets_file: Always use the given pool for FILE buckets set aside.
Using an ancestor pool might race if the bucket is reopened (XTHREAD) or
mmap()ed later in file_bucket_read(), while there is nothing wrong with
both the bucket and the file having the given/same lifetime.
Submitted by: ylavic
Modified:
apr/apr-util/branches/1.7.x/ (props changed)
apr/apr-util/branches/1.7.x/buckets/apr_buckets_file.c
Propchange: apr/apr-util/branches/1.7.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1896812
Modified: apr/apr-util/branches/1.7.x/buckets/apr_buckets_file.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/buckets/apr_buckets_file.c?rev=1896959&r1=1896958&r2=1896959&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/buckets/apr_buckets_file.c (original)
+++ apr/apr-util/branches/1.7.x/buckets/apr_buckets_file.c Wed Jan 12 12:50:08 2022
@@ -239,18 +239,15 @@ static apr_status_t file_bucket_setaside
new = apr_bucket_alloc(sizeof(*new), b->list);
memcpy(new, a, sizeof(*new));
new->refcount.refcount = 1;
- new->readpool = reqpool;
a->refcount.refcount--;
a = b->data = new;
}
else {
apr_file_setaside(&fd, f, reqpool);
- if (!apr_pool_is_ancestor(a->readpool, reqpool)) {
- a->readpool = reqpool;
- }
}
a->fd = fd;
+ a->readpool = reqpool;
return APR_SUCCESS;
}