This is a minor patch which improves diskcache behavior in Windows
since you need to close a file prior to unlinking it. I verified that
this works in scenarios that previously left the file on the disk. A
further improvement would be to close the file first and then unlink
the first time, but this was the easiest modification without changing
the code too much.


destroyDiskEntry(ObjectPtr object, int d)
{
     int dt = 0;


...



    if(d) {
        entry->object->flags &= ~OBJECT_DISK_ENTRY_COMPLETE;
        if(entry->filename) {
            urc = unlink(entry->filename);
            if(urc < 0) {
                dt = 1;
                do_log_error(L_WARN, errno,
                             "Couldn't unlink %s, will try again.",
scrub(entry->filename));
            }
        }

...


 again:
    rc = close(entry->fd);
    if(rc < 0 && errno == EINTR)
        goto again;

    if((entry->filename) && dt) {
            urc = unlink(entry->filename);
            if(urc < 0)
                do_log_error(L_WARN, errno,
                             "Really couldn't unlink %s",
scrub(entry->filename));
    }

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Polipo-users mailing list
Polipo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to