httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rahul <Rahul.G.N...@Sun.COM>
Subject Re: [Bug 43386] - Default handler produces wrong content length when replacing file
Date Tue, 18 Sep 2007 09:19:50 GMT
Hello,
| ------- Additional Comments From wrowe@apache.org  2007-09-17 04:36 -------
| rahul, the httpd project has acknowledged the race for the past seven or more
| years, but there is simply nothing to be done about it.

| We are likely to move to, as you suggest, stat'ing the fd and not trusting
| the resource-by-name in the next iteration of httpd (e.g. 2.4 or 3.0).  But
| there will *still* be a race if the file is truncated during the send.

| As Joe suggests, if you are modifying your content on the fly, you will
| encounter side effects (always).  The only issue are the specific side effects
| based on how you are manipulating that content and how many extra steps httpd
| performs to work around you.

My contention is that there are two separately addressable issues here.

1) Where the user is directly modifying the file in question. Since
there is nothing that we can do about this, This is discouraged, and a
race will always be there if the user does this.

2) Where the user is trying to replace a particular file in his doc-root
with out taking down the httpd process. (This is in-fact the solution
suggested by Joe: ("write content to temporary file; rename file into place")

The race is in the solution and the bug reported is exactly that, (and it is an
avoidable condition as the patch shows - though not efficient). More over, it
is some thing that can happen often as there is no other way to replace a file
with another with out taking down the process.

Note that we are not 'modifying the content on the fly' since no
modification of the said file content has happened.

I will close the bug if you still think that it is invalid, but I think
it ought to be in 'later' with PatchAvailable.


(ps: this is a resend since the earlier mail seems not to have made it.)

                                    rahul
--
1. e4 _

Mime
View raw message