Re: apreqXXXXXX temp files remain after processing uploads greater than 256kb. Further large upload fails

Joe Schaefer <[email protected]>
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
Joe Schaefer <[email protected]> writes:

> "Vinay Y S" <[email protected]> writes:
>
>> There is a problem with apreq temp file cleanup on win32. For each
>> POST request with POST body greater than 256KB, TWO temp files of
>> exact same size get created in temp directory and they are not deleted
>> even after the request is handled. They get deleted when apache server
>> is stopped.
>
> Thanks for the detailed report and patch!
> What version of apr are you using?  The reason I ask is 
> because whenever you open a file, normally a pool cleanup hook is
> registered to close it.

Ah, I see now. I should have looked at the source before opening
my mouth ;-):

    flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
    /* Win32 needs the following to remove temp files.
     * XXX: figure out why the APR_SHARELOCK flag works;
     * a grep through the httpd sources seems to indicate
     * it's only used in sdbm files??
    */
#ifdef WIN32
    flag |= APR_FILE_NOCLEANUP | APR_SHARELOCK;
#endif
    rc = apr_file_mktemp(fp, tmpl, flag, pool);

Randy, do you know why we use the APR_FILE_NOCLEANUP flag?  Maybe
we should just remove that and see if it fixes the problem Vinay
is seeing.

-- 
Joe Schaefer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.