Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. void virtwav_read(void *buf, ssize_t bufsz, uint32_t virtofs);
  2.  
  3. LoadModule virtwav_module modules/mod_virtwav.so
  4. AddHandler virtwav-handler .wav
  5.  
  6. #include "apr_hash.h"
  7. #include "ap_config.h"
  8. #include "ap_provider.h"
  9. #include "httpd.h"
  10. #include "http_core.h"
  11. #include "http_config.h"
  12. #include "http_log.h"
  13. #include "http_protocol.h"
  14. #include "http_request.h"
  15.  
  16. #include <unistd.h> /* for sleep() */
  17.  
  18. static int example_handler(request_rec *r)
  19. {
  20. if (!r->handler || strcmp(r->handler, "virtwav-handler")) return (DECLINED);
  21.  
  22. //r->clength = 42;
  23. //r->mtime = apr_time_now();
  24. ap_rprintf(r, "clength: %" APR_INT64_T_FMT "n", (apr_int64_t)r->clength);
  25. ap_rprintf(r, "mtime: %" APR_INT64_T_FMT "n", (apr_int64_t)r->mtime);
  26. ap_rwrite("dummy", 5, r);
  27. ap_rflush(r);
  28. sleep(50);
  29.  
  30. return OK;
  31. }
  32.  
  33. static void register_hooks(apr_pool_t *pool)
  34. {
  35. /* Create a hook in the request handler, so we get called when a request arrives */
  36. ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST);
  37.  
  38. // ap_hook_dirwalk_stat ?
  39. // This hook allows modules to handle/emulate the apr_stat()
  40.  
  41. // ap_hook_map_to_storage ?
  42. // This hook allow modules to set the per_dir_config based on their own
  43. }
  44.  
  45. module AP_MODULE_DECLARE_DATA virtwav_module =
  46. {
  47. STANDARD20_MODULE_STUFF,
  48. NULL,
  49. NULL,
  50. NULL,
  51. NULL,
  52. NULL,
  53. register_hooks /* Our hook registering function */
  54. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement