- **Type:** String array
- **Availability:** JSON only
-- **Default:** `[ "--recursive", "--delete", "--times", "--contimeout=20", "--timeout=15", "--max-size", "$HTTP_MAX_FILE_SIZE", "$REMOTE", "$LOCAL" ]`
+- **Default:** `[ "--recursive", "--delete", "--times", "--contimeout=20", "--timeout=15", "--max-size=20MB", "$REMOTE", "$LOCAL" ]`
Arguments needed by [`rsync.program`](#rsyncprogram) to perform a recursive rsync.
-Fort will replace `"$REMOTE"` with the remote URL it needs to download, `"$LOCAL"` with the target local directory where the file is supposed to be dropped, and `"$HTTP_MAX_FILE_SIZE"` with [`--http.max-file-size`](#--httpmax-file-size).
+Fort will replace `"$REMOTE"` with the remote URL it needs to download, and `"$LOCAL"` with the target local directory where the file is supposed to be dropped.
### rsync.arguments-flat
- **Type:** String array
- **Availability:** JSON only
-- **Default:** `[ "--times", "--contimeout=20", "--timeout=15", "--max-size", "$HTTP_MAX_FILE_SIZE", "--dirs", "$REMOTE", "$LOCAL" ]`
+- **Default:** `[ "--times", "--contimeout=20", "--timeout=15", "--max-size=20MB", "--dirs", "$REMOTE", "$LOCAL" ]`
Arguments needed by [`rsync.program`](#rsyncprogram) to perform a single-file rsync.
-Fort will replace `"$REMOTE"` with the remote URL it needs to download, `"$LOCAL"` with the target local directory where the file is supposed to be dropped, and `"$HTTP_MAX_FILE_SIZE"` with [`--http.max-file-size`](#--httpmax-file-size).
+Fort will replace `"$REMOTE"` with the remote URL it needs to download, and `"$LOCAL"` with the target local directory where the file is supposed to be dropped.
### `incidences`
"--times",
"--contimeout=20",
"--timeout=15",
- "--max-size", "$HTTP_MAX_FILE_SIZE",
+ "--max-size=20MB",
"$REMOTE",
"$LOCAL",
};
"--times",
"--contimeout=20",
"--timeout=15",
- "--max-size", "$HTTP_MAX_FILE_SIZE",
+ "--max-size=20MB",
"--dirs",
"$REMOTE",
"$LOCAL",
rpki_config.rsync.enabled = true;
rpki_config.rsync.priority = 50;
rpki_config.rsync.strategy = RSYNC_ROOT_EXCEPT_TA;
- rpki_config.rsync.retry.count = 0;
- rpki_config.rsync.retry.interval = 5;
+ rpki_config.rsync.retry.count = 1;
+ rpki_config.rsync.retry.interval = 4;
rpki_config.rsync.program = strdup("rsync");
if (rpki_config.rsync.program == NULL) {
error = pr_enomem();
/* By default, has a higher priority than rsync */
rpki_config.http.enabled = true;
rpki_config.http.priority = 60;
- rpki_config.http.retry.count = 0;
- rpki_config.http.retry.interval = 5;
+ rpki_config.http.retry.count = 1;
+ rpki_config.http.retry.interval = 4;
rpki_config.http.user_agent = strdup(PACKAGE_NAME "/" PACKAGE_VERSION);
if (rpki_config.http.user_agent == NULL) {
error = pr_enomem();
close(fds[1][0]);
}
-static int
-uint2string(unsigned int uint, char **result)
-{
- char *str;
- int str_len;
-
- str_len = snprintf(NULL, 0, "%u", uint);
- if (str_len < 0)
- return pr_val_err("Cannot compute length of '%u' string: Unknown cause", uint);
-
- str_len++; /* Null chara */
-
- str = malloc(str_len * sizeof(char));
- if (str == NULL)
- return pr_enomem();
-
- str_len = snprintf(str, str_len, "%u", uint);
- if (str_len < 0) {
- free(str);
- return pr_val_err("Cannot convert '%u' into a string: Unknown cause", uint);
- }
-
- *result = str;
- return 0;
-}
-
static void
release_args(char **args, unsigned int size)
{
struct string_array const *config_args;
char **copy_args;
unsigned int i;
- int error;
config_args = config_get_rsync_args(is_ta);
/*
copy_args[i + 1] = strdup(uri_get_global(uri));
else if (strcmp(config_args->array[i], "$LOCAL") == 0)
copy_args[i + 1] = strdup(uri_get_local(uri));
- else if (strcmp(config_args->array[i], "$HTTP_MAX_FILE_SIZE") == 0) {
- error = uint2string(config_get_http_max_file_size(),
- ©_args[i + 1]);
- if (error)
- return error;
- } else
+ else
copy_args[i + 1] = strdup(config_args->array[i]);
if (copy_args[i + 1] == NULL) {
return NULL;
}
-#define CK_STR(uint, string) \
- ck_assert_int_eq(0, uint2string(uint, &str)); \
- ck_assert_str_eq(string, str); \
- free(str);
-
-START_TEST(rsync_test_uint2string)
-{
- char *str;
-
- CK_STR(0, "0");
- CK_STR(1, "1");
- CK_STR(9, "9");
- CK_STR(10, "10");
- CK_STR(100, "100");
- CK_STR(1000, "1000");
- CK_STR(10000, "10000");
- CK_STR(100000, "100000");
- CK_STR(1000000, "1000000");
- CK_STR(10000000, "10000000");
- CK_STR(100000000, "100000000");
- CK_STR(1000000000, "1000000000");
- CK_STR(4294967295, "4294967295");
-}
-END_TEST
-
static void
assert_descendant(bool expected, char *ancestor, char *descendant)
{
Suite *rsync_load_suite(void)
{
Suite *suite;
- TCase *core, *prefix_equals, *uri_list, *test_get_prefix;
-
- core = tcase_create("Core");
- tcase_add_test(core, rsync_test_uint2string);
+ TCase *prefix_equals, *uri_list, *test_get_prefix;
prefix_equals = tcase_create("PrefixEquals");
tcase_add_test(prefix_equals, rsync_test_prefix_equals);
tcase_add_test(test_get_prefix, rsync_test_get_prefix);
suite = suite_create("rsync_test()");
- suite_add_tcase(suite, core);
suite_add_tcase(suite, prefix_equals);
suite_add_tcase(suite, uri_list);
suite_add_tcase(suite, test_get_prefix);