* 20110724.2 (2.3.15-dev) retries and retry_delay in util_ldap_state_t
* 20110724.3 (2.3.15-dev) add util_varbuf.h / ap_varbuf API
* 20110724.4 (2.3.15-dev) add max_ranges to core_dir_config
+ * 20110724.5 (2.3.15-dev) add ap_set_accept_ranges()
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110724
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 4 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 5 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct);
+/**
+ * Set the Accept-Ranges header for this respons
+ * @param r The current request
+ */
+AP_DECLARE(void) ap_set_accept_ranges(request_rec *r);
+
+
/* Hmmm... could macrofy these for now, and maybe forever, though the
* definitions of the macros would get a whole lot hairier.
*/
ap_set_etag(r);
/* we accept byte-ranges */
- apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
+ ap_set_accept_ranges(r);
/* set up the Content-Length header */
ap_set_content_length(r, resource->info->finfo.size);
ap_update_mtime(r, apr_time_now());
ap_set_last_modified(r);
}
- apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
+ ap_set_accept_ranges(r);
/* reflect the content length, if present */
if ((content_length = apr_table_get(r->headers_in, "Content-Length"))) {
}
}
+AP_DECLARE(void) ap_set_accept_ranges(request_rec *r)
+{
+ core_dir_config *d = ap_get_core_module_config(r->per_dir_config);
+ apr_table_setn(r->headers_out, "Accept-Ranges",
+ (d->max_ranges == AP_MAXRANGES_NORANGES) ? "none"
+ : "bytes");
+}
static const char *add_optional_notes(request_rec *r,
const char *prefix,
const char *key,
* ap_set_last_modified(r);
* ap_set_etag(r);
*/
- apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
+ ap_set_accept_ranges(r);
ap_set_content_length(r, best->bytes);
/* set MIME type and charset as negotiated */
ap_update_mtime(r, r->finfo.mtime);
ap_set_last_modified(r);
ap_set_etag(r);
- apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
+ ap_set_accept_ranges(r);
ap_set_content_length(r, r->finfo.size);
status = ap_meets_conditions(r);
ap_update_mtime(r, r->finfo.mtime);
ap_set_last_modified(r);
ap_set_etag(r);
- apr_table_setn(r->headers_out, "Accept-Ranges",
- (d->max_ranges == AP_MAXRANGES_NORANGES) ? "none"
- : "bytes");
+ ap_set_accept_ranges(r);
ap_set_content_length(r, r->finfo.size);
if (bld_content_md5) {
apr_table_setn(r->headers_out, "Content-MD5",