faubackup2/src/rsync rsync++_calls.cpp,1.7,1.8 rsync.cpp,1.12,1.13

Erik Merkel <[email protected]> Thu, 22 Sep 2005 16:43:26 +0000
Newsgroups gmane.comp.sysutils.backup.faubackup.cvs
Message-ID <[email protected]>
Update of /cvsroot/faubackup/faubackup2/src/rsync
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22237/rsync

Modified Files:
	rsync++_calls.cpp rsync.cpp 
Log Message:
removed buffering from rsync module + minor changes in other files


Index: rsync.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/rsync/rsync.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rsync.cpp	26 Jun 2005 23:02:10 -0000	1.12
--- rsync.cpp	22 Sep 2005 16:43:24 -0000	1.13
***************
*** 11,15 ****
  
  #define STAT_CHAR_ARRAY_SIZE 200
! #define MIN_RSYNC_BLOCKSIZE 1024
  
  extern "C"
--- 11,15 ----
  
  #define STAT_CHAR_ARRAY_SIZE 200
! #define MIN_RSYNC_BLOCKSIZE 512
  
  extern "C"

Index: rsync++_calls.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/rsync/rsync++_calls.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rsync++_calls.cpp	26 Jun 2005 23:02:10 -0000	1.7
--- rsync++_calls.cpp	22 Sep 2005 16:43:24 -0000	1.8
***************
*** 7,12 ****
  
  
- #define R_BUFSIZE 16384
- 
  using namespace faubackup;
  void getPackage(char * location, int * size, int * eof, void * NetCommunicationPointer)
--- 7,10 ----
***************
*** 26,57 ****
  void putPackage(char * location, int length, int eof, void * NetCommunicationPointer)
  {
! 	//static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(location, length, eof);
! 	static size_t bufsize = 0;
! 	static char buf[R_BUFSIZE] = {
! 					     0,0,
! 				     };
! 
! 	if(NetCommunicationPointer) {
! 		if((location == NULL) || (length == 0)) {
! 			if(bufsize)
! 				static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(buf, bufsize, eof);
! 			bufsize = 0;
  			return;
  		}
! 		if((bufsize + length) > R_BUFSIZE) { //does not fit in current buffer
! 			static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(buf, bufsize, false);
! 			bufsize = 0;
! 		}
! 		if(length > R_BUFSIZE)
! 			static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(location, length, eof);
! 		else {
! 			memcpy(buf + bufsize, location, length);
! 			bufsize += length;
! 			if(eof) {
! 				static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(buf, bufsize, eof);
! 				bufsize = 0;
! 			}
! 		}
! 	}
  }
  
--- 24,31 ----
  void putPackage(char * location, int length, int eof, void * NetCommunicationPointer)
  {
! 	if((location == NULL) || (length == 0)) {
  			return;
  		}
! 	static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendPackage(location, length, eof);
  }
  
***************
*** 66,70 ****
  {
  	if(NetCommunicationPointer) {
! 		putPackage(NULL, 0, false, NetCommunicationPointer);
  		return static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendEOF();
  	}
--- 40,44 ----
  {
  	if(NetCommunicationPointer) {
! 		//putPackage(NULL, 0, false, NetCommunicationPointer);
  		return static_cast<faubackup::NetCommunication *>(NetCommunicationPointer)->sendEOF();
  	}



-------------------------------------------------------
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