Restructure file_bcast mechanism to fork only on first block.
1) Add a new global file_bcast_list to store info on in-progress file transfers, cache FD there rather than reopening the file for every block. 2) Restructure security mechanisms. First block will fork() and open the file, and pass the FD back to the thread. Thread then registers this file transfer in the file_bcast_list. Split fork() stuff into _file_bcast_register_file to keep _rpc_file_bcast readable. 3) Successive blocks are handled within the thread. Security is handled by matching uid and file name to existing file transfer. TODO: 1) Write transfer cleanup function to remove stalled transfers. 2) Use mmap for file output. 3) Allow for parallel block transfer. Current code assumes blocks will always arrive in order. Out of order blocks will result in corrupted output. (sbcast currently prevents this by requiring each message to be ack'd before continuing, but at a likely severe performance penalty.) 4) Add stats on receive side.
Please register or sign in to comment