MCPcopy Create free account
hub / github.com/apache/httpd / isapi_cmd_cachefile

Function isapi_cmd_cachefile

modules/arch/win32/mod_isapi.c:121–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static 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
166static const command_rec isapi_cmds[] = {
167 AP_INIT_TAKE1("ISAPIReadAheadBuffer", ap_set_int_slot,

Callers

nothing calls this directly

Calls 3

ap_server_root_relativeFunction · 0.85
isapi_lookupFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected