diff options
author | Christopher Baines <mail@cbaines.net> | 2023-05-08 21:24:22 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-05-08 21:24:22 +0100 |
commit | 12af5c768bd461a7eda5d67258992ad29f6e19ad (patch) | |
tree | 058454963838fe4b30e623fb5d1c99e9c0104fa1 /guix-build-coordinator/agent-messaging | |
parent | 3012931835ea1f6bb3c976aed05bb8d194acd0d8 (diff) | |
download | build-coordinator-12af5c768bd461a7eda5d67258992ad29f6e19ad.tar build-coordinator-12af5c768bd461a7eda5d67258992ad29f6e19ad.tar.gz |
Specifically handle empty partial uploads
This will happen when the upload process is interupted after the data has been
received, but before the hash has been computed, perhaps by the coordinator
restarting.
Diffstat (limited to 'guix-build-coordinator/agent-messaging')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http/server.scm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm index 747d437..2c744a8 100644 --- a/guix-build-coordinator/agent-messaging/http/server.scm +++ b/guix-build-coordinator/agent-messaging/http/server.scm @@ -627,9 +627,12 @@ port. Also, the port used can be changed by passing the --port option.\n" (receive-file body (request-content-length request) tmp-output-file-name))) - (receive-file body - (request-content-length request) - tmp-output-file-name)) + (let ((content-length + (request-content-length request))) + (when (> content-length 0) + (receive-file body + content-length + tmp-output-file-name)))) (list (build-response |