Changeset 2053
- Timestamp:
- 01/18/2008 09:21:07 AM (9 months ago)
- Location:
- branches/lighttpd-1.4.x
- Files:
-
- 2 modified
-
NEWS (modified) (1 diff)
-
src/mod_ssi.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.4.x/NEWS
r2052 r2053 19 19 * open log immediately after daemonizing, fixes SIGPIPEs on startup (#165) 20 20 * HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499) 21 * generate ETag and Last-Modified headers for mod_ssi based on newest modified include (#1491) 21 22 22 23 - 1.4.18 - 2007-09-09 -
branches/lighttpd-1.4.x/src/mod_ssi.c
r1951 r2053 36 36 #include <sys/filio.h> 37 37 #endif 38 39 #include "etag.h" 40 41 /* The newest modified time of included files for include statement */ 42 static volatile time_t include_file_last_mtime = 0; 38 43 39 44 /* init the plugin data */ … … 576 581 case SSI_INCLUDE: 577 582 chunkqueue_append_file(con->write_queue, p->stat_fn, 0, st.st_size); 583 584 /* Keep the newest mtime of included files */ 585 if (st.st_mtime > include_file_last_mtime) 586 include_file_last_mtime = st.st_mtime; 587 578 588 break; 579 589 } … … 912 922 build_ssi_cgi_vars(srv, con, p); 913 923 p->if_is_false = 0; 924 925 /* Reset the modified time of included files */ 926 include_file_last_mtime = 0; 914 927 915 928 if (-1 == stream_open(&s, con->physical.path)) { … … 1011 1024 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html")); 1012 1025 1026 { 1027 /* Generate "ETag" & "Last-Modified" headers */ 1028 1029 stat_cache_entry *sce = NULL; 1030 time_t lm_time = 0; 1031 buffer *mtime = NULL; 1032 1033 stat_cache_get_entry(srv, con, con->physical.path, &sce); 1034 1035 etag_mutate(con->physical.etag, sce->etag); 1036 response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); 1037 1038 if (sce->st.st_mtime > include_file_last_mtime) 1039 lm_time = sce->st.st_mtime; 1040 else 1041 lm_time = include_file_last_mtime; 1042 1043 mtime = strftime_cache_get(srv, lm_time); 1044 response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); 1045 } 1046 1047 /* Reset the modified time of included files */ 1048 include_file_last_mtime = 0; 1049 1013 1050 /* reset physical.path */ 1014 1051 buffer_reset(con->physical.path);

