- ff_forward_fd = fd;
- if (protocol_version < 31) {
- int save_fd = iobuf.out_fd;
- /* Older protocols send the files-from data w/o packaging it in
- * multiplexed I/O packets. To match this, we temporarily turn
- * off the multiplexing of our output w/o disabling buffering. */
- assert(OUT_MULTIPLEXED);
- /* Be extra, extra sure no messages go out before files-from data. */
- iobuf.msg.pos = iobuf.msg.len = 0;
- io_end_multiplex_out(False);
- iobuf.out_fd = save_fd;
+ if (protocol_version < 31 && OUT_MULTIPLEXED) {
+ /* Older protocols send the files-from data w/o packaging
+ * it in multiplexed I/O packets, so temporarily switch
+ * to buffered I/O to match this behavior. */
+ iobuf.msg.pos = iobuf.msg.len = 0; /* Be extra sure no messages go out. */
+ ff_reenable_multiplex = io_end_multiplex_out(MPLX_TO_BUFFERED);