Changes with Apache 2.0.18-dev
+ *) Add ap_set_int_slot() function
+ [John K. Sterling <sterling@covalent.net>]
+
*) Under certain circumstances, Apache did not supply the
right response headers when requiring authentication.
[Gertjan van Wingerde <Gertjan.van.Wingerde@cmg.nl>] PR#7114
AP_DECLARE_NONSTD(const char *) ap_set_string_slot(cmd_parms *cmd, void *struct_ptr,
const char *arg);
+/**
+ * Generic command handling function for integers
+ * @param cmd The command parameters for this directive
+ * @param struct_ptr pointer into a given type
+ * @param arg The argument to the directive
+ * @return An error string or NULL on success
+ * @deffunc const char *ap_set_int_slot(cmd_parms *cmd, void *struct_ptr, const char *arg)
+ */
+AP_DECLARE_NONSTD(const char *) ap_set_int_slot(cmd_parms *cmd,
+ void *struct_ptr,
+ const char *arg);
+
/**
* Return true if the specified method is limited by being listed in
* a <Limit> container, or by *not* being listed in a <LimiteExcept>
return NULL;
}
+AP_DECLARE_NONSTD(const char *) ap_set_int_slot(cmd_parms *cmd,
+ void *struct_ptr,
+ const char *arg)
+{
+ char *endptr;
+ char *error_str = NULL;
+ int offset = (int) (long) cmd->info;
+
+ *(int *) (struct_ptr + offset) = strtol(arg, &endptr, 10);
+
+ if ((*arg == '\0') || (*endptr != '\0')) {
+ error_str = apr_psprintf(cmd->pool,
+ "Invalid value for directive %s, expected integer",
+ cmd->directive->directive);
+ }
+
+ return error_str;
+}
+
AP_DECLARE_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd,
void *struct_ptr,
const char *arg_)
ap_set_etag
ap_set_file_slot
ap_set_flag_slot
+ap_set_int_slot
ap_set_keepalive
ap_set_last_modified
ap_set_listenbacklog