static void test_atoi64f(dAT) { AT_int_eq(apreq_atoi64f("0"), 0); AT_int_eq(apreq_atoi64f("-1"), -1); AT_int_eq(apreq_atoi64f("-"), 0); AT_int_eq(apreq_atoi64f("5"), 5); AT_int_eq(apreq_atoi64f("3.333"), 3); AT_int_eq(apreq_atoi64f("33k"), 33 * 1024); AT_int_eq(apreq_atoi64f(" +8M "), 8 * 1024 * 1024); AT_ok(apreq_atoi64f("44GB") == (apr_int64_t)44 * 1024 * 1024 * 1024, "44GB test"); AT_ok(apreq_atoi64f("0xaBcDefg") == (apr_int64_t)11259375 * 1024 * 1024 * 1024, "hex test"); }
static const char *apreq_set_brigade_limit(cmd_parms *cmd, void *data, const char *arg) { struct dir_config *conf = data; const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; conf->brigade_limit = apreq_atoi64f(arg); return NULL; }
static const char* porter_set_minimum_multipart_size(cmd_parms *cmd, void *dir, const char *argument) { porter_server_conf *config = (porter_server_conf *)ap_get_module_config(cmd->server->module_config, &porter_module); const char *error = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (error != NULL) { return error; } config->minimum_multipart_size = apreq_atoi64f(argument); return NULL; }