faubackup2/src/copier distributor.cpp,1.11,1.12 filesender.cpp,1.7,1.8 filesender.hpp,1.4,1.5 local_sender.cpp,1.5,1.6
Erik Merkel <[email protected]> Sun, 10 Jul 2005 16:33:25 +0000
| Newsgroups | gmane.comp.sysutils.backup.faubackup.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/faubackup/faubackup2/src/copier
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7750/copier
Modified Files:
distributor.cpp filesender.cpp filesender.hpp local_sender.cpp
Log Message:
using references instead of byval
Index: filesender.hpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/copier/filesender.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** filesender.hpp 3 Jul 2005 18:37:15 -0000 1.4
--- filesender.hpp 10 Jul 2005 16:33:23 -0000 1.5
***************
*** 43,57 ****
string currentWorkDir;
NetCommunication *network;
! list<struct dir_item> dir_list;
! void special_file(string name);
! void symlink_file(string name);
! void reg_file_copy(string name);
! void reg_file_link(string name);
! void rdiff_file(string name);
! void sendInode(string name);
void sendInode(struct stat &st);
! void reg_file_hardlink(string name);
void send_dirs();
--- 43,57 ----
string currentWorkDir;
NetCommunication *network;
! list<struct dir_item *> dir_list;
! void special_file(string &name);
! void symlink_file(string &name);
! void reg_file_copy(string &name);
! void reg_file_link(string &name);
! void rdiff_file(string &name);
! void sendInode(string &name);
void sendInode(struct stat &st);
! void reg_file_hardlink(string &name);
void send_dirs();
Index: local_sender.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/copier/local_sender.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** local_sender.cpp 22 Jun 2005 23:56:22 -0000 1.5
--- local_sender.cpp 10 Jul 2005 16:33:23 -0000 1.6
***************
*** 110,114 ****
string LocalSender::resolv_hardlink_file(string name)
{
! struct stat st = getStat(name.c_str());
multimap<ino_t , string>::iterator i, j;
pair<multimap<ino_t , string>::iterator , multimap<ino_t , string>::iterator>result;
--- 110,115 ----
string LocalSender::resolv_hardlink_file(string name)
{
! struct stat st;
! getStat(name.c_str(), st);
multimap<ino_t , string>::iterator i, j;
pair<multimap<ino_t , string>::iterator , multimap<ino_t , string>::iterator>result;
***************
*** 118,122 ****
if(i != HardlinkMap.end())
do {
! struct stat st2 = getStat((i->second).c_str());
if(st.st_dev == st2.st_dev) //make sure file is one the same dev
return i->second;
--- 119,124 ----
if(i != HardlinkMap.end())
do {
! struct stat st2;
! getStat((i->second).c_str(), st2);
if(st.st_dev == st2.st_dev) //make sure file is one the same dev
return i->second;
Index: filesender.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/copier/filesender.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** filesender.cpp 3 Jul 2005 19:06:55 -0000 1.7
--- filesender.cpp 10 Jul 2005 16:33:23 -0000 1.8
***************
*** 17,39 ****
{
while(dir_list.size()) {
! network->sendByte(CopySpecial);
! network->sendString(dir_list.front().dirname);
! sendInode(dir_list.front().st);
dir_list.pop_front();
}
}
! void FileSender::special_file(string name)
{
! struct stat st = getStat((currentWorkDir + name).c_str());
! if(whatType(st) == Dir) {
! struct dir_item item;
! item.st = st;
! item.dirname= name;
dir_list.push_back(item);
} else {
network->sendByte(CopySpecial);
network->sendString(name);
! sendInode(name);
}
--- 17,41 ----
{
while(dir_list.size()) {
! struct dir_item *item = dir_list.front();
dir_list.pop_front();
+ network->sendByte(CopySpecial);
+ network->sendString(item->dirname);
+ sendInode(item->st);
+ delete item;
}
}
! void FileSender::special_file(string &name)
{
! struct dir_item *item = new struct dir_item;
! getStat((currentWorkDir + name).c_str(), item->st);
! if(whatType(item->st) == Dir) {
! item->dirname=name;
dir_list.push_back(item);
} else {
network->sendByte(CopySpecial);
network->sendString(name);
! sendInode(item->st);
! delete item;
}
***************
*** 42,46 ****
}
! void FileSender::symlink_file(string name)
{
output.information("symlink file!", DEBUG_OUTPUT);
--- 44,48 ----
}
! void FileSender::symlink_file(string &name)
{
output.information("symlink file!", DEBUG_OUTPUT);
***************
*** 48,52 ****
}
! void FileSender::reg_file_copy(string name)
{
output.information("reg file copy!", DEBUG_OUTPUT);
--- 50,54 ----
}
! void FileSender::reg_file_copy(string &name)
{
output.information("reg file copy!", DEBUG_OUTPUT);
***************
*** 65,69 ****
}
! void FileSender::reg_file_hardlink(string name)
{
output.information("Hardlink file!", DEBUG_OUTPUT);
--- 67,71 ----
}
! void FileSender::reg_file_hardlink(string &name)
{
output.information("Hardlink file!", DEBUG_OUTPUT);
***************
*** 71,75 ****
}
! void FileSender::reg_file_link(string name)
{
output.information("reg file link!", DEBUG_OUTPUT);
--- 73,77 ----
}
! void FileSender::reg_file_link(string &name)
{
output.information("reg file link!", DEBUG_OUTPUT);
***************
*** 77,81 ****
}
! void FileSender::rdiff_file(string name)
{
if(!existFile(currentWorkDir + name)) {
--- 79,83 ----
}
! void FileSender::rdiff_file(string &name)
{
if(!existFile(currentWorkDir + name)) {
***************
*** 96,104 ****
}
! void FileSender::sendInode(string name)
{
output.information("sende inode!", DEBUG_OUTPUT);
int size;
! struct stat st = getStat((currentWorkDir + name).c_str());
char *pointer = getRawInode(st, size);
--- 98,107 ----
}
! void FileSender::sendInode(string &name)
{
output.information("sende inode!", DEBUG_OUTPUT);
int size;
! struct stat st;
! getStat((currentWorkDir + name).c_str(), st);
char *pointer = getRawInode(st, size);
Index: distributor.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/copier/distributor.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** distributor.cpp 3 Jul 2005 18:37:15 -0000 1.11
--- distributor.cpp 10 Jul 2005 16:33:23 -0000 1.12
***************
*** 22,26 ****
return;
}
! struct stat st = getStat(old_dir + file.getFilename());
if((st.st_size > MIN_RSYNC_SIZE) &&
(file.getFileSize() > MIN_RSYNC_SIZE) &&
--- 22,27 ----
return;
}
! struct stat st;
! getStat(old_dir + file.getFilename(), st);
if((st.st_size > MIN_RSYNC_SIZE) &&
(file.getFileSize() > MIN_RSYNC_SIZE) &&
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar