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
}
} 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;
(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;
}