From 0c6200e299017ba3ceaef4aa7b09d9fe02591c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Wed, 19 Apr 2017 15:26:30 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@407 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/io/pibasetransfer.cpp | 4 +++- src_main/io/pifiletransfer.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src_main/io/pibasetransfer.cpp b/src_main/io/pibasetransfer.cpp index 4be6a66b..d96a0390 100644 --- a/src_main/io/pibasetransfer.cpp +++ b/src_main/io/pibasetransfer.cpp @@ -255,7 +255,9 @@ bool PIBaseTransfer::send_process() { mutex_header.lock(); sendReply(pt_Pause); mutex_header.unlock(); - if (pause_tm.elapsed_s() > timeout())return finish_send(false); + if (pause_tm.elapsed_s() > timeout()) { + return finish_send(false); + } } mutex_send.lock(); if (send_tm.elapsed_s() > timeout_) { diff --git a/src_main/io/pifiletransfer.cpp b/src_main/io/pifiletransfer.cpp index dbc22275..78192d92 100644 --- a/src_main/io/pifiletransfer.cpp +++ b/src_main/io/pifiletransfer.cpp @@ -89,6 +89,7 @@ bool PIFileTransfer::sendFiles(const PIVector &files) { cur_file_string = ""; if (!send_process()) { sendFilesFinished(false); + started_ = false; return false; } pftheader.step = pft_Data; @@ -99,6 +100,7 @@ bool PIFileTransfer::sendFiles(const PIVector &files) { buildSession(pts); bool ok = send_process(); sendFilesFinished(ok); + started_ = false; return ok; } @@ -285,16 +287,16 @@ void PIFileTransfer::receive_finished(bool ok) { } if (!ok || !user_ok) { pftheader.session_id--; - started_ = false; piCoutObj << "file cancel"; receiveFilesFinished(false); + started_ = false; } else resume(); } if (pftheader.step == pft_Data) { //piCoutObj << "file close"; work_file.close(); - started_ = false; receiveFilesFinished(ok); + started_ = false; } } @@ -303,6 +305,5 @@ void PIFileTransfer::send_finished(bool ok) { // piCoutObj << "file close"; if (pftheader.step == pft_Data) { work_file.close(); - started_ = false; } }