summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-06-20 12:20:41 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-07-08 07:08:40 (GMT)
commit5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95 (patch)
tree1d8e52cd829f3b622b54734e17366d7e72d8bdba /Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
parent67fef39ed463533157e66a72c17f31f9d078d5a2 (diff)
downloadswift-5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95.zip
swift-5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95.tar.bz2
Show canceled file-transfer by other party as canceled and not failed
Test-Information: Added unit test that checks for the expected behavior. Change-Id: I4079bdc1182af466eedd2496b9837e024f14acb2
Diffstat (limited to 'Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp')
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
index 5c18b13..f9441cd 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
@@ -134,13 +134,16 @@ void OutgoingJingleFileTransfer::handleSessionTerminateReceived(boost::optional<
134 waitForRemoteTermination->stop(); 134 waitForRemoteTermination->stop();
135 } 135 }
136 if (reason && reason->type == JinglePayload::Reason::Cancel) { 136 if (reason && reason->type == JinglePayload::Reason::Cancel) {
137 setFinishedState(FileTransfer::State::Canceled, FileTransferError(FileTransferError::PeerError)); 137 setFinishedState(FileTransfer::State::Canceled, FileTransferError(FileTransferError::PeerError));
138 } 138 }
139 else if (reason && reason->type == JinglePayload::Reason::Decline) {
140 setFinishedState(FileTransfer::State::Canceled, boost::optional<FileTransferError>());
141 }
139 else if (reason && reason->type == JinglePayload::Reason::Success) { 142 else if (reason && reason->type == JinglePayload::Reason::Success) {
140 setFinishedState(FileTransfer::State::Finished, boost::optional<FileTransferError>()); 143 setFinishedState(FileTransfer::State::Finished, boost::optional<FileTransferError>());
141 } 144 }
142 else { 145 else {
143 setFinishedState(FileTransfer::State::Failed, FileTransferError(FileTransferError::PeerError)); 146 setFinishedState(FileTransfer::State::Failed, FileTransferError(FileTransferError::PeerError));
144 } 147 }
145} 148}
146 149
@@ -188,10 +191,11 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
188 transport->setSessionID(s5bSessionID); 191 transport->setSessionID(s5bSessionID);
189 transport->setMode(JingleS5BTransportPayload::TCPMode); 192 transport->setMode(JingleS5BTransportPayload::TCPMode);
190 transport->setDstAddr(dstAddr); 193 transport->setDstAddr(dstAddr);
191 foreach(JingleS5BTransportPayload::Candidate candidate, candidates) { 194 foreach(JingleS5BTransportPayload::Candidate candidate, candidates) {
192 transport->addCandidate(candidate); 195 transport->addCandidate(candidate);
196 SWIFT_LOG(debug) << "\t" << "S5B candidate: " << candidate.hostPort.toString() << std::endl;
193 } 197 }
194 setState(WaitingForAccept); 198 setState(WaitingForAccept);
195 session->sendInitiate(contentID, description, transport); 199 session->sendInitiate(contentID, description, transport);
196} 200}
197 201