version 1.1, 2013/10/14 10:32:48
|
version 1.1.1.2, 2014/06/15 20:20:06
|
Line 108 SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
|
Line 108 SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
|
|
|
if (!p) return HANDLER_ERROR; |
if (!p) return HANDLER_ERROR; |
|
|
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); | p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *)); |
|
|
for (i = 0; i < srv->config_context->used; i++) { |
for (i = 0; i < srv->config_context->used; i++) { |
plugin_config *s; |
plugin_config *s; |
Line 319 static int build_ssi_cgi_vars(server *srv, connection
|
Line 319 static int build_ssi_cgi_vars(server *srv, connection
|
return 0; |
return 0; |
} |
} |
|
|
static int process_ssi_stmt(server *srv, connection *con, plugin_data *p, | static int process_ssi_stmt(server *srv, connection *con, plugin_data *p, const char **l, size_t n, stat_cache_entry *sce) { |
const char **l, size_t n) { | |
size_t i, ssicmd = 0; |
size_t i, ssicmd = 0; |
char buf[255]; |
char buf[255]; |
buffer *b = NULL; |
buffer *b = NULL; |
Line 360 static int process_ssi_stmt(server *srv, connection *c
|
Line 359 static int process_ssi_stmt(server *srv, connection *c
|
int var = 0; |
int var = 0; |
/* int enc = 0; */ |
/* int enc = 0; */ |
const char *var_val = NULL; |
const char *var_val = NULL; |
stat_cache_entry *sce = NULL; |
|
|
|
struct { |
struct { |
const char *var; |
const char *var; |
Line 429 static int process_ssi_stmt(server *srv, connection *c
|
Line 427 static int process_ssi_stmt(server *srv, connection *c
|
break; |
break; |
} |
} |
|
|
stat_cache_get_entry(srv, con, con->physical.path, &sce); |
|
|
|
switch(var) { |
switch(var) { |
case SSI_ECHO_USER_NAME: { |
case SSI_ECHO_USER_NAME: { |
struct passwd *pw; |
struct passwd *pw; |
Line 958 static int mod_ssi_handle_request(server *srv, connect
|
Line 954 static int mod_ssi_handle_request(server *srv, connect
|
int ovec[N * 3]; |
int ovec[N * 3]; |
#endif |
#endif |
|
|
|
stat_cache_entry *sce = NULL; |
|
|
|
|
/* get a stream to the file */ |
/* get a stream to the file */ |
|
|
array_reset(p->ssi_vars); |
array_reset(p->ssi_vars); |
Line 970 static int mod_ssi_handle_request(server *srv, connect
|
Line 969 static int mod_ssi_handle_request(server *srv, connect
|
/* Reset the modified time of included files */ |
/* Reset the modified time of included files */ |
include_file_last_mtime = 0; |
include_file_last_mtime = 0; |
|
|
|
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) { |
|
log_error_write(srv, __FILE__, __LINE__, "SB", "stat_cache_get_entry failed: ", con->physical.path); |
|
return -1; |
|
} |
|
|
if (-1 == stream_open(&s, con->physical.path)) { |
if (-1 == stream_open(&s, con->physical.path)) { |
log_error_write(srv, __FILE__, __LINE__, "sb", |
log_error_write(srv, __FILE__, __LINE__, "sb", |
"stream-open: ", con->physical.path); |
"stream-open: ", con->physical.path); |
Line 1043 static int mod_ssi_handle_request(server *srv, connect
|
Line 1047 static int mod_ssi_handle_request(server *srv, connect
|
if (!p->if_is_false) chunkqueue_append_file(con->write_queue, con->physical.path, i, ovec[0] - i); |
if (!p->if_is_false) chunkqueue_append_file(con->write_queue, con->physical.path, i, ovec[0] - i); |
|
|
pcre_get_substring_list(s.start, ovec, n, &l); |
pcre_get_substring_list(s.start, ovec, n, &l); |
process_ssi_stmt(srv, con, p, l, n); | process_ssi_stmt(srv, con, p, l, n, sce); |
pcre_free_substring_list(l); |
pcre_free_substring_list(l); |
} |
} |
|
|
Line 1074 static int mod_ssi_handle_request(server *srv, connect
|
Line 1078 static int mod_ssi_handle_request(server *srv, connect
|
} |
} |
|
|
{ |
{ |
/* Generate "ETag" & "Last-Modified" headers */ | /* Generate "ETag" & "Last-Modified" headers */ |
| |
stat_cache_entry *sce = NULL; | |
time_t lm_time = 0; |
time_t lm_time = 0; |
buffer *mtime = NULL; |
buffer *mtime = NULL; |
|
|
stat_cache_get_entry(srv, con, con->physical.path, &sce); |
|
|
|
etag_mutate(con->physical.etag, sce->etag); |
etag_mutate(con->physical.etag, sce->etag); |
response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); |
response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); |