faubackup2/src/common backup_control.cpp,1.19,1.20 backup_control.hpp,1.4,1.5
Erik Merkel <[email protected]> Thu, 22 Sep 2005 15:49:00 +0000
| Newsgroups | gmane.comp.sysutils.backup.faubackup.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/faubackup/faubackup2/src/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12163/common
Modified Files:
backup_control.cpp backup_control.hpp
Log Message:
changes to work with streams instead of simple file descriptors
Index: backup_control.hpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/common/backup_control.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** backup_control.hpp 14 Jun 2005 20:45:35 -0000 1.4
--- backup_control.hpp 22 Sep 2005 15:48:57 -0000 1.5
***************
*** 3,11 ****
---------------------------------------------------------------------------
Set of functions that manages the call of the sender and receiver classes.
!
$Id$
!
Author: Erik Merkel <[email protected]>
!
******************************************************************************/
#ifndef __Backup_Cntrl_h_include__
--- 3,11 ----
---------------------------------------------------------------------------
Set of functions that manages the call of the sender and receiver classes.
!
$Id$
!
Author: Erik Merkel <[email protected]>
!
******************************************************************************/
#ifndef __Backup_Cntrl_h_include__
***************
*** 26,30 ****
\param fd_in file descriptor, the server reads its input from
\param fd_out file descriptor, the server writes its input to **/
! void server(string destdir, int fd_in, int fd_out);
/** This is the fuction to start the backup client (where the original files are
--- 26,30 ----
\param fd_in file descriptor, the server reads its input from
\param fd_out file descriptor, the server writes its input to **/
! void server(string destdir, FILE *fd_in, FILE *fd_out);
/** This is the fuction to start the backup client (where the original files are
***************
*** 34,38 ****
\param fd_in file descriptor, the client reads its input from
\param fd_out file descriptor, the client writes its input to **/
! void client(string source, int fd_in, int fd_out);
/** start client-server connection if both locations are on remote machines
--- 34,38 ----
\param fd_in file descriptor, the client reads its input from
\param fd_out file descriptor, the client writes its input to **/
! void client(string source, FILE *fd_in, FILE *fd_out);
/** start client-server connection if both locations are on remote machines
Index: backup_control.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/common/backup_control.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** backup_control.cpp 3 Jul 2005 19:08:46 -0000 1.19
--- backup_control.cpp 22 Sep 2005 15:48:57 -0000 1.20
***************
*** 101,105 ****
if(pid == 0) {
//sleep(1);
! server(destination, STDIN_FILENO, STDOUT_FILENO);
setIntHandler();
exit(0);
--- 101,105 ----
if(pid == 0) {
//sleep(1);
! server(destination, stdin, stdout);
setIntHandler();
exit(0);
***************
*** 107,111 ****
bigBrother.register_ssh(pid);
//create InfoSender
! client(source, fd_in_remote, fd_out_remote);
//bigBrother.waitforssh();
exit(0);
--- 107,111 ----
bigBrother.register_ssh(pid);
//create InfoSender
! client(source, fdopen(fd_in_remote, "rb"), fdopen(fd_out_remote, "wb"));
//bigBrother.waitforssh();
exit(0);
***************
*** 153,157 ****
//create InfoSender
! client(source.directory, fd_in_remote, fd_out_remote);
bigBrother.waitforssh();
output.information("done", DEBUG_OUTPUT);
--- 153,157 ----
//create InfoSender
! client(source.directory, fdopen(fd_in_remote, "rb"), fdopen(fd_out_remote, "wb"));
bigBrother.waitforssh();
output.information("done", DEBUG_OUTPUT);
***************
*** 195,199 ****
fd_in_remote, fd_out_remote);
bigBrother.register_ssh(pid);
! server(destination.directory, fd_in_remote, fd_out_remote);
}
--- 195,199 ----
fd_in_remote, fd_out_remote);
bigBrother.register_ssh(pid);
! server(destination.directory, fdopen(fd_in_remote, "rb"), fdopen(fd_out_remote, "wb"));
}
***************
*** 204,208 ****
}
! void server(string destdir, int fd_in, int fd_out)
{
--- 204,208 ----
}
! void server(string destdir, FILE *fd_in, FILE *fd_out)
{
***************
*** 250,258 ****
dir_finalize(tempdir, destdir);
output.information("Server finished", DEBUG_OUTPUT);
! close(fd_in);
! close(fd_out);
}
! void client(string sourcedir, int fd_in, int fd_out)
{
instance_name = "client";
--- 250,258 ----
dir_finalize(tempdir, destdir);
output.information("Server finished", DEBUG_OUTPUT);
! //fclose(fd_in);
! //close(fd_out);
}
! void client(string sourcedir, FILE *fd_in, FILE *fd_out)
{
instance_name = "client";
***************
*** 300,305 ****
receiver.wait_for_finish();
output.information("Client finished", DEBUG_OUTPUT);
! close(fd_in);
! close(fd_out);
}
--- 300,305 ----
receiver.wait_for_finish();
output.information("Client finished", DEBUG_OUTPUT);
! //fclose(fd_in);
! //close(fd_out);
}
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php