aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-06 19:29:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-06 19:29:03 +0200
commitd2ef3a8d0ee8005b200fa238ab3cfc8eb09f783a (patch)
tree09fdc67c6e28caae68096a4f4b9d277ba88b6546
parentb0cfa2cf7956827447685c2b044556c1ca8dc5c4 (diff)
Try to fortify agent against interrupted uploads
-rw-r--r--bbot/agent/agent.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx
index c0849c6..d345472 100644
--- a/bbot/agent/agent.cxx
+++ b/bbot/agent/agent.cxx
@@ -238,7 +238,13 @@ bootstrap_machine (const dir_path& md,
for (to = bootstrap_to; to != 0; tftpd.serve (to, 2))
{
if (file_not_empty (mf))
- break;
+ {
+ // Wait for 5 seconds of inactivity. This is our desperate attempt
+ // at handling interrupted uploads.
+ //
+ if (!tftpd.serve (to, 5))
+ break;
+ }
}
if (to == 0)
@@ -729,7 +735,10 @@ try
for (to = build_to; to != 0; tftpd.serve (to, 2))
{
if (file_not_empty (rf))
- break;
+ {
+ if (!tftpd.serve (to, 5))
+ break;
+ }
}
if (to == 0)