aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurfacestartup.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 12:54:30 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 12:54:30 +0900
commit177e21076b9813eefca7939cda8c3eb559a4d145 (patch)
tree7f2a56656967dda0d8f71e3db9534c980b6285ef /core/subsurfacestartup.c
parent9815eaf1ed039d7831c1de64c4f083ebcc90abe7 (diff)
downloadsubsurface-177e21076b9813eefca7939cda8c3eb559a4d145.tar.gz
Allow the user to give longer cloud timeout on the command line
When stuck in areas with really bad internet 5 seconds may not be enough, but making the timeout longer in general seems the wrong way to go. So keep the default 5 seconds but allow the user to override that with subsurface --cloud-timeout=NN Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurfacestartup.c')
-rw-r--r--core/subsurfacestartup.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index 126cc5ee1..1041e7d10 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -86,7 +86,8 @@ struct preferences default_prefs = {
.deco_mode = BUEHLMANN,
.conservatism_level = 3,
.distance_threshold = 1000,
- .time_threshold = 600
+ .time_threshold = 600,
+ .cloud_timeout = 5
};
int run_survey;
@@ -206,6 +207,13 @@ void parse_argument(const char *arg)
settings_suffix = strdup(arg + sizeof("--user=") - 1);
return;
}
+ if (strncmp(arg, "--cloud-timeout=", sizeof("--cloud-timeout=") - 1) == 0) {
+ const char *timeout = arg + sizeof("--cloud-timeout=") - 1;
+ int to = strtol(timeout, NULL, 10);
+ if (0 < to && to < 60)
+ default_prefs.cloud_timeout = to;
+ return;
+ }
if (strcmp(arg, "--help") == 0) {
print_help();
exit(0);