| 252 | } |
| 253 | |
| 254 | static apr_status_t isapi_load(apr_pool_t *p, server_rec *s, isapi_loaded *isa) |
| 255 | { |
| 256 | apr_status_t rv; |
| 257 | |
| 258 | isa->isapi_version = apr_pcalloc(p, sizeof(HSE_VERSION_INFO)); |
| 259 | |
| 260 | /* TODO: These aught to become overridable, so that we |
| 261 | * assure a given isapi can be fooled into behaving well. |
| 262 | * |
| 263 | * The tricky bit, they aren't really a per-dir sort of |
| 264 | * config, they will always be constant across every |
| 265 | * reference to the .dll no matter what context (vhost, |
| 266 | * location, etc) they apply to. |
| 267 | */ |
| 268 | isa->report_version = 0x500; /* Revision 5.0 */ |
| 269 | isa->timeout = 300 * 1000000; /* microsecs, not used */ |
| 270 | |
| 271 | rv = apr_dso_load(&isa->handle, isa->filename, p); |
| 272 | if (rv) |
| 273 | { |
| 274 | ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(02107) |
| 275 | "failed to load %s", isa->filename); |
| 276 | isa->handle = NULL; |
| 277 | return rv; |
| 278 | } |
| 279 | |
| 280 | rv = apr_dso_sym((void**)&isa->GetExtensionVersion, isa->handle, |
| 281 | "GetExtensionVersion"); |
| 282 | if (rv) |
| 283 | { |
| 284 | ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(02108) |
| 285 | "missing GetExtensionVersion() in %s", |
| 286 | isa->filename); |
| 287 | apr_dso_unload(isa->handle); |
| 288 | isa->handle = NULL; |
| 289 | return rv; |
| 290 | } |
| 291 | |
| 292 | rv = apr_dso_sym((void**)&isa->HttpExtensionProc, isa->handle, |
| 293 | "HttpExtensionProc"); |
| 294 | if (rv) |
| 295 | { |
| 296 | ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(02109) |
| 297 | "missing HttpExtensionProc() in %s", |
| 298 | isa->filename); |
| 299 | apr_dso_unload(isa->handle); |
| 300 | isa->handle = NULL; |
| 301 | return rv; |
| 302 | } |
| 303 | |
| 304 | /* TerminateExtension() is an optional interface */ |
| 305 | rv = apr_dso_sym((void**)&isa->TerminateExtension, isa->handle, |
| 306 | "TerminateExtension"); |
| 307 | apr_set_os_error(0); |
| 308 | |
| 309 | /* Run GetExtensionVersion() */ |
| 310 | if (!(isa->GetExtensionVersion)(isa->isapi_version)) { |
| 311 | apr_status_t rv = apr_get_os_error(); |
no test coverage detected