int one_file_system=0;
int remote_version=0;
int sparse_files=0;
+int do_compression=0;
+
extern int csum_length;
int am_server = 0;
{
int pid;
int status=0;
+ int recv_pipe[2];
if (preserve_hard_links)
init_hard_links(flist);
+ if (pipe(recv_pipe) < 0) {
+ fprintf(FERROR,"pipe failed in do_recv\n");
+ exit(1);
+ }
+
+
if ((pid=fork()) == 0) {
- recv_files(f_in,flist,local_name);
+ recv_files(f_in,flist,local_name,recv_pipe[1]);
if (preserve_hard_links)
do_hard_links(flist);
if (verbose > 2)
exit_cleanup(0);
}
- generate_files(f_out,flist,local_name);
+ generate_files(f_out,flist,local_name,recv_pipe[0]);
waitpid(pid, &status, 0);
verbose = MAX(verbose,1);
if (am_server) {
- remote_version = read_int(STDIN_FILENO);
- if (remote_version < MIN_PROTOCOL_VERSION ||
- remote_version > MAX_PROTOCOL_VERSION) {
- fprintf(FERROR,"protocol version mismatch - is your shell clean?\n");
- exit_cleanup(1);
- }
- write_int(STDOUT_FILENO,PROTOCOL_VERSION);
- write_flush(STDOUT_FILENO);
-
- setup_protocol();
+ setup_protocol(STDOUT_FILENO,STDIN_FILENO);
if (sender) {
recv_exclude_list(STDIN_FILENO);
pid = do_cmd(shell_cmd,shell_machine,shell_user,shell_path,&f_in,&f_out);
- write_int(f_out,PROTOCOL_VERSION);
- write_flush(f_out);
- {
- remote_version = read_int(f_in);
- if (remote_version < MIN_PROTOCOL_VERSION ||
- remote_version > MAX_PROTOCOL_VERSION) {
- fprintf(FERROR,"protocol version mismatch - is your shell clean?\n");
- exit_cleanup(1);
- }
- }
-
- setup_protocol();
+ setup_protocol(f_out,f_in);
if (verbose > 3)
fprintf(FERROR,"parent=%d child=%d sender=%d recurse=%d\n",