summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Network/BOSHConnectionPool.cpp3
-rw-r--r--Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp7
2 files changed, 4 insertions, 6 deletions
diff --git a/Swiften/Network/BOSHConnectionPool.cpp b/Swiften/Network/BOSHConnectionPool.cpp
index 7d43f42..bb24aa5 100644
--- a/Swiften/Network/BOSHConnectionPool.cpp
+++ b/Swiften/Network/BOSHConnectionPool.cpp
@@ -143,7 +143,6 @@ void BOSHConnectionPool::tryToSendQueuedData() {
}
BOSHConnection::ref suitableConnection = getSuitableConnection();
- bool sent = false;
bool toSend = !dataQueue.empty();
if (suitableConnection) {
if (toSend) {
@@ -154,14 +153,12 @@ void BOSHConnectionPool::tryToSendQueuedData() {
data.insert(data.end(), datum.begin(), datum.end());
}
suitableConnection->write(data);
- sent = true;
dataQueue.clear();
}
else if (pendingTerminate) {
rid++;
suitableConnection->setRID(rid);
suitableConnection->terminateStream();
- sent = true;
onSessionTerminated(boost::shared_ptr<BOSHError>());
}
}
diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
index 023f11a..c16a2e4 100644
--- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
@@ -37,9 +37,10 @@ std::string JinglePayloadSerializer::serializePayload(boost::shared_ptr<JinglePa
jinglePayload.setAttribute("action", actionToString(payload->getAction()));
jinglePayload.setAttribute("initiator", payload->getInitiator());
jinglePayload.setAttribute("sid", payload->getSessionID());
-
- if (!payload->getPayloads().empty()) {
- foreach(boost::shared_ptr<Payload> subPayload, payload->getPayloads()) {
+
+ std::vector<boost::shared_ptr<Payload> > payloads = payload->getPayloads();
+ if (!payloads.empty()) {
+ foreach(boost::shared_ptr<Payload> subPayload, payloads) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(subPayload);
if (serializer) {
jinglePayload.addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(serializer->serialize(subPayload))));