TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@72 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -82,9 +82,8 @@ bool PIFileTransfer::sendFiles(const PIVector<PFTFileInfo> &files) {
|
||||
if (!send_process()) return false;
|
||||
pftheader.step = pft_Data;
|
||||
PIVector<Part> pts;
|
||||
for (int i=0; i<files_.size_s(); i++) {
|
||||
for (int i=0; i<files_.size_s(); i++)
|
||||
pts << Part(i+1, files_[i].size);
|
||||
}
|
||||
buildSession(pts);
|
||||
bool ok = send_process();
|
||||
return ok;
|
||||
@@ -114,7 +113,7 @@ void PIFileTransfer::processFile(int id, ullong start, PIByteArray & data) {
|
||||
work_file.close();
|
||||
if (!work_file.open(path, PIIODevice::ReadWrite)) {
|
||||
cur_file_string = "ERROR! while open file " + path;
|
||||
piCoutObj << cur_file_string;
|
||||
piCoutObj << cur_file_string << "," << errorString();
|
||||
stopReceive();
|
||||
return;
|
||||
}
|
||||
@@ -172,7 +171,7 @@ PIByteArray PIFileTransfer::buildPacket(Part p) {
|
||||
if (!work_file.open(path, PIIODevice::ReadOnly)) {
|
||||
break_ = true;
|
||||
cur_file_string = "ERROR! while open file " + fi.path;
|
||||
piCoutObj << cur_file_string;
|
||||
piCoutObj << cur_file_string << "," << errorString();
|
||||
stopSend();
|
||||
return PIByteArray();
|
||||
}
|
||||
@@ -180,6 +179,7 @@ PIByteArray PIFileTransfer::buildPacket(Part p) {
|
||||
work_file.seek(p.start);
|
||||
ba.resize(p.size);
|
||||
int rs = work_file.read(ba.data(), ba.size());
|
||||
piCout << rs << p.size;
|
||||
if ((llong)rs != (llong)p.size) {
|
||||
break_ = true;
|
||||
cur_file_string = "ERROR! while read file " + fi.path + " (must " + PIString::fromNumber(p.size) + ", but read " + PIString::fromNumber(rs) + ")";
|
||||
@@ -255,7 +255,7 @@ void PIFileTransfer::receive_finished(bool ok) {
|
||||
desc >> files_;
|
||||
PIStringList files;
|
||||
piForeachC(PFTFileInfo &fi, files_) files << fi.dest_path;
|
||||
// piCout << files;
|
||||
//piCout << files;
|
||||
receiveFilesRequest(files, bytesAll(), &user_ok);
|
||||
}
|
||||
if (!ok || !user_ok) {
|
||||
|
||||
Reference in New Issue
Block a user