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

Function cache_quick_handler

modules/cache/mod_cache.c:83–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 */
82
83static int cache_quick_handler(request_rec *r, int lookup)
84{
85 apr_status_t rv;
86 const char *auth;
87 cache_provider_list *providers;
88 cache_request_rec *cache;
89 apr_bucket_brigade *out;
90 apr_bucket *e;
91 ap_filter_t *next;
92 ap_filter_rec_t *cache_out_handle;
93 cache_server_conf *conf;
94
95 conf = (cache_server_conf *) ap_get_module_config(r->server->module_config,
96 &cache_module);
97
98 /* only run if the quick handler is enabled */
99 if (!conf->quick) {
100 return DECLINED;
101 }
102
103 /*
104 * Which cache module (if any) should handle this request?
105 */
106 if (!(providers = cache_get_providers(r, conf))) {
107 return DECLINED;
108 }
109
110 /* make space for the per request config */
111 cache = apr_pcalloc(r->pool, sizeof(cache_request_rec));
112 cache->size = -1;
113 cache->out = apr_brigade_create(r->pool, r->connection->bucket_alloc);
114
115 /* save away the possible providers */
116 cache->providers = providers;
117
118 /*
119 * Are we allowed to serve cached info at all?
120 */
121 if (!ap_cache_check_no_store(cache, r)) {
122 return DECLINED;
123 }
124
125 /* find certain cache controlling headers */
126 auth = apr_table_get(r->headers_in, "Authorization");
127
128 /* First things first - does the request allow us to return
129 * cached information at all? If not, just decline the request.
130 */
131 if (auth) {
132 return DECLINED;
133 }
134
135 /* Are we PUT/POST/DELETE? If so, prepare to invalidate the cached entities.
136 */
137 switch (r->method_number) {
138 case M_PUT:
139 case M_POST:
140 case M_DELETE:

Callers

nothing calls this directly

Calls 9

ap_get_module_configFunction · 0.85
cache_get_providersFunction · 0.85
ap_cache_check_no_storeFunction · 0.85
cache_selectFunction · 0.85
cache_try_lockFunction · 0.85
ap_meets_conditionsFunction · 0.85
ap_remove_output_filterFunction · 0.85
ap_pass_brigade_fchkFunction · 0.85

Tested by

no test coverage detected