Martin, try the enclosed patch (against the latest - Sunday night -
source).

Martin Kraemer wrote:
> 
> >Number:         314
> >Category:       mod_proxy
> >Synopsis:       Truncated (short/invalid) files are proxy-cached. Ought to 
> >be invalidated.
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       medium
> >Responsible:    apache (Apache HTTP Project)
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   apache
> >Arrival-Date:   Fri Apr  4 07:10:01 1997
> >Originator:     [EMAIL PROTECTED]
> >Organization:
> apache
> >Release:        1.2b8-dev
> >Environment:
> SVR4 on MIPS and intel
> >Description:
> When a transmission via an intranet apache proxy (which forwards via
> ProxyRemote * http://firewall) receives a "short" file
> (i.e., transmission stops before Content-Length bytes have arrived),
> the short file is put into the cache nonetheless.
> 
> IMHO, this is the easiest situation to decide that the file should be 
> invalidated (removed),
> instead of happily re-serving the truncated file on a reload (if the reload
> sends no no-cache header, as Mosaic does by default).
> >How-To-Repeat:
> Hmmm... can you force a truncated transmission? Should be possible via a
> nph-Script with a Content-Length that is too big.
> >Fix:
> Remove temp file instead of putting it in cache hierarchy if it is too short
> >Audit-Trail:
> >Unformatted:

-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
[EMAIL PROTECTED]
*** proxy_ftp.c.orig    Sun Apr  6 22:26:39 1997
--- proxy_ftp.c Sun Apr  6 22:28:53 1997
***************
*** 324,334 ****
              o+=w;
          }
      }
!     ap_snprintf(buf, sizeof(buf), "</PRE><HR><I><A 
HREF=\"http://www.apache.org\";>%s</A></I></BODY></HTML>", SERVER_VERSION);
!     bwrite(con->client, buf, strlen(buf));
!     if (f2 != NULL) bwrite(f2, buf, strlen(buf));
!     total_bytes_sent+=strlen(buf);
!     bflush(con->client);
      
      return total_bytes_sent;
  }
--- 324,337 ----
              o+=w;
          }
      }
!     if (!r->connection->aborted) {
!         ap_snprintf(buf, sizeof(buf), "</PRE><HR><I><A 
HREF=\"http://www.apache.org\";>%s</A></I></BODY></HTML>", SERVER_VERSION);
!         bwrite(con->client, buf, strlen(buf));
!         if (f2 != NULL) bwrite(f2, buf, strlen(buf));
!         total_bytes_sent+=strlen(buf);
!         bflush(con->client);
!     } else
!         f2 = proxy_cache_error(c);
      
      return total_bytes_sent;
  }
*** proxy_util.c.orig   Sun Apr  6 22:22:29 1997
--- proxy_util.c        Sun Apr  6 22:23:59 1997
***************
*** 425,430 ****
--- 425,432 ----
      }
      if (!con->aborted)
          bflush(con->client);
+     else
+       f2 = proxy_cache_error(c);
      
      kill_timeout(r);
      return total_bytes_sent;

Reply via email to