Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void virtwav_read(void *buf, ssize_t bufsz, uint32_t virtofs);
- LoadModule virtwav_module modules/mod_virtwav.so
- AddHandler virtwav-handler .wav
- #include "apr_hash.h"
- #include "ap_config.h"
- #include "ap_provider.h"
- #include "httpd.h"
- #include "http_core.h"
- #include "http_config.h"
- #include "http_log.h"
- #include "http_protocol.h"
- #include "http_request.h"
- #include <unistd.h> /* for sleep() */
- static int example_handler(request_rec *r)
- {
- if (!r->handler || strcmp(r->handler, "virtwav-handler")) return (DECLINED);
- //r->clength = 42;
- //r->mtime = apr_time_now();
- ap_rprintf(r, "clength: %" APR_INT64_T_FMT "n", (apr_int64_t)r->clength);
- ap_rprintf(r, "mtime: %" APR_INT64_T_FMT "n", (apr_int64_t)r->mtime);
- ap_rwrite("dummy", 5, r);
- ap_rflush(r);
- sleep(50);
- return OK;
- }
- static void register_hooks(apr_pool_t *pool)
- {
- /* Create a hook in the request handler, so we get called when a request arrives */
- ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST);
- // ap_hook_dirwalk_stat ?
- // This hook allows modules to handle/emulate the apr_stat()
- // ap_hook_map_to_storage ?
- // This hook allow modules to set the per_dir_config based on their own
- }
- module AP_MODULE_DECLARE_DATA virtwav_module =
- {
- STANDARD20_MODULE_STUFF,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- register_hooks /* Our hook registering function */
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement