added timeout option to pilerimport (30s by default)

This commit is contained in:
SJ
2015-07-31 12:06:19 +02:00
parent eb0c63e60a
commit 84587c2b04
5 changed files with 20 additions and 13 deletions

View File

@@ -500,6 +500,7 @@ int main(int argc, char **argv){
import.extra_recipient = NULL;
import.start_position = 1;
import.download_only = 0;
import.timeout = 30;
data.import = &import;
@@ -527,6 +528,7 @@ int main(int argc, char **argv){
{"folder_imap", required_argument, 0, 'f' },
{"add-recipient",required_argument, 0, 'a' },
{"batch-limit", required_argument, 0, 'b' },
{"timeout", required_argument, 0, 't' },
{"start-position",required_argument, 0, 's' },
{"quiet", no_argument, 0, 'q' },
{"recursive", required_argument, 0, 'R' },
@@ -540,9 +542,9 @@ int main(int argc, char **argv){
int option_index = 0;
c = getopt_long(argc, argv, "c:m:M:e:d:i:K:u:p:P:x:F:f:a:b:s:GDRroqh?", long_options, &option_index);
c = getopt_long(argc, argv, "c:m:M:e:d:i:K:u:p:P:x:F:f:a:b:t:s:GDRroqh?", long_options, &option_index);
#else
c = getopt(argc, argv, "c:m:M:e:d:i:K:u:p:P:x:F:f:a:b:s:GDRroqh?");
c = getopt(argc, argv, "c:m:M:e:d:i:K:u:p:P:x:F:f:a:b:t:s:GDRroqh?");
#endif
if(c == -1) break;
@@ -624,6 +626,10 @@ int main(int argc, char **argv){
data.import->batch_processing_limit = atoi(optarg);
break;
case 't' :
data.import->timeout = atoi(optarg);
break;
case 's' :
if(atoi(optarg) < 1){
printf("invalid start position: %s\n", optarg);