From d2ef3a8d0ee8005b200fa238ab3cfc8eb09f783a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 6 Aug 2017 19:29:03 +0200 Subject: Try to fortify agent against interrupted uploads --- bbot/agent/agent.cxx | 13 +++++++++++-- 1 file 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) -- cgit v1.1