summaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-11-20 08:13:47 +0100
committerMarc Hoersken <info@marc-hoersken.de>2020-11-20 12:50:57 +0100
commitc353207057b45c0e814823b5fe5eabeb4cc2d707 (patch)
tree67865c71e7a923c41326fd06cbe407ed5e6ae1e2 /tests/server
parentd18e9c580fc83896810f3402652a7489f2707c3d (diff)
downloadcurl-c353207057b45c0e814823b5fe5eabeb4cc2d707.tar.gz
tests/server/tftpd.c: close upload file right after transfer
Make sure uploaded file is no longer locked after the transfer while waiting for the final ACK to be handled. Assisted-by: Daniel Stenberg Bug: #6058 Closes #6209
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/tftpd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index 4215bfe4a..fdd6e061e 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -821,11 +821,6 @@ int main(int argc, char **argv)
sclose(peer);
peer = CURL_SOCKET_BAD;
- if(test.ofile > 0) {
- close(test.ofile);
- test.ofile = 0;
- }
-
if(got_exit_signal)
break;
@@ -1304,6 +1299,10 @@ send_ack:
}
} while(size == SEGSIZE);
write_behind(test, pf->f_convert);
+ if(test->ofile > 0) {
+ close(test->ofile);
+ test->ofile = 0;
+ }
rap->th_opcode = htons((unsigned short)opcode_ACK); /* send the "final"
ack */