Branch: Tag:

2004-04-13

2004-04-13 18:44:11 by Martin Stjernholm <mast@lysator.liu.se>

Another fix for the ETag header.

Enabled the setting of misc->last_modified from misc->cacheable again
to avoid client-side overcaching. The Last-Modified header can always
be overridden from file->extra_heads or id->misc->moreheads.

Rev: server/base_server/prototypes.pike:1.82

6:   #include <module.h>   #include <variables.h>   #include <module_constants.h> - constant cvs_version="$Id: prototypes.pike,v 1.81 2004/04/13 18:34:02 mast Exp $"; + constant cvs_version="$Id: prototypes.pike,v 1.82 2004/04/13 18:44:11 mast Exp $";      #ifdef DAV_DEBUG   #define DAV_WERROR(X...) werror(X)
994:    heads["Expires"] = Roxen->http_date( predef::time(1)-31557600 );    } else    heads["Expires"] = Roxen->http_date( predef::time(1)+misc->cacheable ); - #if 0 +     if (misc->cacheable < INITIAL_CACHEABLE) {    // Data with expiry is assumed to have been generated at the    // same instant.    misc->last_modified = predef::time(1);    } - #endif /* 0 */ +     }       if (misc->last_modified)
1042:    //if( file->len > 0 || (file->error != 200) )    heads["Content-Length"] = (string)file->len;    +  if (misc->etag) +  heads->ETag = misc->etag; +    #ifdef RAM_CACHE -  if (!(heads->ETag = misc->etag) && file->len && +  if (!misc->etag && file->len &&    (file->data || file->file) &&    file->error == 200 && (<"HEAD", "GET">)[method] &&    (file->len < conf->datacache->max_file_size)) {