[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 381/411: tests/server/tftpd.c: close upload file in case of abor
From: |
gnunet |
Subject: |
[gnurl] 381/411: tests/server/tftpd.c: close upload file in case of abort |
Date: |
Wed, 13 Jan 2021 01:23:16 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 227daceabe7a8acd411cb8220d1b67d0d920bfc6
Author: Marc Hoersken <info@marc-hoersken.de>
AuthorDate: Tue Nov 24 20:49:09 2020 +0100
tests/server/tftpd.c: close upload file in case of abort
Commit c353207 removed the closing right after do_tftp
which covered the case of abort. This handles that case.
Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Follow up to #6209
Closes #6234
---
tests/server/tftpd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index fdd6e061e..92d584918 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -1299,6 +1299,7 @@ send_ack:
}
} while(size == SEGSIZE);
write_behind(test, pf->f_convert);
+ /* close the output file as early as possible after upload completion */
if(test->ofile > 0) {
close(test->ofile);
test->ofile = 0;
@@ -1325,6 +1326,11 @@ send_ack:
(void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */
}
abort:
+ /* make sure the output file is closed in case of abort */
+ if(test->ofile > 0) {
+ close(test->ofile);
+ test->ofile = 0;
+ }
return;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 405/411: urldata: restore comment on ssl_connect_data.use, (continued)
- [gnurl] 405/411: urldata: restore comment on ssl_connect_data.use, gnunet, 2021/01/12
- [gnurl] 396/411: scripts/completion.pl: parse all opts, gnunet, 2021/01/12
- [gnurl] 388/411: cmake: check for linux/tcp.h, gnunet, 2021/01/12
- [gnurl] 401/411: ftp: make wc_statemach loop instead of recurse, gnunet, 2021/01/12
- [gnurl] 395/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 390/411: quiche: close the connection, gnunet, 2021/01/12
- [gnurl] 404/411: VERSIONS: refreshed, gnunet, 2021/01/12
- [gnurl] 402/411: openssl: make the OCSP verification verify the certificate id, gnunet, 2021/01/12
- [gnurl] 400/411: ftp: CURLOPT_FTP_SKIP_PASV_IP by default, gnunet, 2021/01/12
- [gnurl] 407/411: Merge tag 'curl-7_74_0', gnunet, 2021/01/12
- [gnurl] 381/411: tests/server/tftpd.c: close upload file in case of abort,
gnunet <=
- [gnurl] 389/411: ngtcp2: Fix build error due to symbol name change, gnunet, 2021/01/12
- [gnurl] 281/411: curl.1: add an "OUTPUT" section at the top of the manpage, gnunet, 2021/01/12