Advertisement
Guest User

mod_pr63855.c

a guest
Oct 16th, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.58 KB | None | 0 0
  1. #include "apr_strings.h"
  2. #include "apr_lib.h"
  3. #include "apr_hash.h"
  4. #include "apr_optional.h"
  5.  
  6. #define APR_WANT_STRFUNC
  7. #include "apr_want.h"
  8.  
  9. #include "ap_config.h"
  10. #include "mod_log_config.h"
  11. #include "httpd.h"
  12. #include "http_core.h"
  13. #include "http_config.h"
  14. #include "http_connection.h"
  15. #include "http_protocol.h"
  16. #include "http_request.h"
  17.  
  18. module AP_MODULE_DECLARE_DATA pr63855_module;
  19.  
  20. static const char pr63855_in_filter_name[] = "PR63855_IN";
  21.  
  22. static apr_status_t pr63855_in_filter(ap_filter_t *f,
  23.                                       apr_bucket_brigade *bb,
  24.                                       ap_input_mode_t mode,
  25.                                       apr_read_type_e block,
  26.                                       apr_off_t readbytes)
  27. {
  28.   return ap_get_brigade(f->next, bb, mode, block, readbytes);
  29. }
  30.  
  31. static void pr63855_insert_filter(request_rec * r)
  32. {
  33.     ap_add_input_filter(pr63855_in_filter_name, NULL, r, r->connection);
  34. }
  35.  
  36. static void register_hooks(apr_pool_t *p)
  37. {
  38.     ap_register_input_filter(pr63855_in_filter_name, pr63855_in_filter, NULL, AP_FTYPE_RESOURCE);
  39.     ap_hook_insert_filter(pr63855_insert_filter, NULL, NULL, APR_HOOK_LAST);
  40. }
  41.  
  42. AP_DECLARE_MODULE(pr63855) =
  43. {
  44.     STANDARD20_MODULE_STUFF,
  45.     NULL,                       /* create per-dir config */
  46.     NULL,                       /* merge per-dir config */
  47.     NULL,                       /* server config */
  48.     NULL,                       /* merge server config */
  49.     NULL,                       /* command apr_table_t */
  50.     register_hooks              /* register hooks */
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement