gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]