| 119 | } |
| 120 | |
| 121 | static const char *isapi_cmd_cachefile(cmd_parms *cmd, void *dummy, |
| 122 | const char *filename) |
| 123 | { |
| 124 | isapi_loaded *isa; |
| 125 | apr_finfo_t tmp; |
| 126 | apr_status_t rv; |
| 127 | char *fspec; |
| 128 | |
| 129 | /* ### Just an observation ... it would be terribly cool to be |
| 130 | * able to use this per-dir, relative to the directory block being |
| 131 | * defined. The hash result remains global, but shorthand of |
| 132 | * <Directory "c:/webapps/isapi"> |
| 133 | * ISAPICacheFile myapp.dll anotherapp.dll thirdapp.dll |
| 134 | * </Directory> |
| 135 | * would be very convienent. |
| 136 | */ |
| 137 | fspec = ap_server_root_relative(cmd->pool, filename); |
| 138 | if (!fspec) { |
| 139 | ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server, APLOGNO(02103) |
| 140 | "invalid module path, skipping %s", filename); |
| 141 | return NULL; |
| 142 | } |
| 143 | if ((rv = apr_stat(&tmp, fspec, APR_FINFO_TYPE, |
| 144 | cmd->temp_pool)) != APR_SUCCESS) { |
| 145 | ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server, APLOGNO(02104) |
| 146 | "unable to stat, skipping %s", fspec); |
| 147 | return NULL; |
| 148 | } |
| 149 | if (tmp.filetype != APR_REG) { |
| 150 | ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(02105) |
| 151 | "not a regular file, skipping %s", fspec); |
| 152 | return NULL; |
| 153 | } |
| 154 | |
| 155 | /* Load the extension as cached (with null request_rec) */ |
| 156 | rv = isapi_lookup(cmd->pool, cmd->server, NULL, fspec, &isa); |
| 157 | if (rv != APR_SUCCESS) { |
| 158 | ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server, APLOGNO(02106) |
| 159 | "unable to cache, skipping %s", fspec); |
| 160 | return NULL; |
| 161 | } |
| 162 | |
| 163 | return NULL; |
| 164 | } |
| 165 | |
| 166 | static const command_rec isapi_cmds[] = { |
| 167 | AP_INIT_TAKE1("ISAPIReadAheadBuffer", ap_set_int_slot, |
nothing calls this directly
no test coverage detected