summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2014-05-18 09:29:04 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-05-18 15:49:08 (GMT)
commit9bba31c6ce54290011a96723f720d872ecdbabca (patch)
treeeec68d77764e85957d4c25878010e34f29ee8410
parenta507d029d8995e27adf96a46f60a8ba696667f7e (diff)
downloadswift-contrib-9bba31c6ce54290011a96723f720d872ecdbabca.zip
swift-contrib-9bba31c6ce54290011a96723f720d872ecdbabca.tar.bz2
Fix uninitialized variables
Change-Id: I95b6b67dcafe338561d3dfb28664bc3bba6d1159
-rw-r--r--Swift/Controllers/HistoryController.cpp9
-rw-r--r--Swift/Controllers/Roster/ItemOperations/SetMUC.h3
-rw-r--r--Swift/Controllers/Storages/FileStorages.cpp4
-rw-r--r--Swift/Controllers/WhiteboardManager.cpp4
-rw-r--r--Swift/QtUI/QtAvatarWidget.cpp6
-rw-r--r--Swift/QtUI/QtPlainChatView.h1
-rw-r--r--Swift/QtUI/QtRosterHeader.cpp4
-rw-r--r--Swift/QtUI/QtSystemTray.cpp4
-rw-r--r--Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp9
-rw-r--r--Swiften/Client/MemoryStorages.cpp4
-rw-r--r--Swiften/Elements/JingleContentPayload.h3
-rw-r--r--Swiften/Elements/JingleIBBTransportPayload.h5
-rw-r--r--Swiften/Elements/PubSubRetract.cpp2
-rw-r--r--Swiften/Elements/PubSubSubscribeOptions.cpp2
-rw-r--r--Swiften/Elements/StreamManagementEnabled.cpp4
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardLineElement.h9
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardRectElement.h8
-rw-r--r--Swiften/FileTransfer/FileTransfer.cpp4
-rw-r--r--Swiften/Network/BOSHConnection.cpp1
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.cpp9
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.h3
21 files changed, 71 insertions, 27 deletions
diff --git a/Swift/Controllers/HistoryController.cpp b/Swift/Controllers/HistoryController.cpp
index d730236..5732382 100644
--- a/Swift/Controllers/HistoryController.cpp
+++ b/Swift/Controllers/HistoryController.cpp
@@ -1,23 +1,30 @@
/*
* Copyright (c) 2012 Catalin Badea
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+
#include <Swift/Controllers/HistoryController.h>
#include <Swiften/History/HistoryStorage.h>
#include <Swiften/History/HistoryMessage.h>
#include <boost/date_time/c_local_time_adjustor.hpp>
namespace Swift {
-HistoryController::HistoryController(HistoryStorage* localHistoryStorage) : localHistory_(localHistoryStorage) {
+HistoryController::HistoryController(HistoryStorage* localHistoryStorage) : localHistory_(localHistoryStorage), remoteArchiveSupported_(false) {
}
HistoryController::~HistoryController() {
}
void HistoryController::addMessage(const std::string& message, const JID& fromJID, const JID& toJID, HistoryMessage::Type type, const boost::posix_time::ptime& timeStamp) {
// note: using localtime timestamps
boost::posix_time::ptime localTime = boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(timeStamp);
int offset = (localTime - timeStamp).hours();
diff --git a/Swift/Controllers/Roster/ItemOperations/SetMUC.h b/Swift/Controllers/Roster/ItemOperations/SetMUC.h
index de40e04..598e5f5 100644
--- a/Swift/Controllers/Roster/ItemOperations/SetMUC.h
+++ b/Swift/Controllers/Roster/ItemOperations/SetMUC.h
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2013 Kevin Smith and Remko Tronçon
+ * Copyright (c) 2013-2014 Kevin Smith and Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h>
@@ -25,15 +25,14 @@ class SetMUC : public RosterItemOperation {
ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item);
if (contact && contact->getJID().equals(jid_, JID::WithResource)) {
contact->setMUCRole(mucRole_);
contact->setMUCAffiliation(mucAffiliation_);
}
}
private:
JID jid_;
- bool mucParticipant_;
MUCOccupant::Role mucRole_;
MUCOccupant::Affiliation mucAffiliation_;
};
}
diff --git a/Swift/Controllers/Storages/FileStorages.cpp b/Swift/Controllers/Storages/FileStorages.cpp
index 52a5e00..e1b681f 100644
--- a/Swift/Controllers/Storages/FileStorages.cpp
+++ b/Swift/Controllers/Storages/FileStorages.cpp
@@ -16,29 +16,29 @@ namespace Swift {
FileStorages::FileStorages(const boost::filesystem::path& baseDir, const JID& jid, CryptoProvider* crypto) {
boost::filesystem::path profile = stringToPath(jid.toBare());
vcardStorage = new VCardFileStorage(baseDir / profile / "vcards", crypto);
capsStorage = new CapsFileStorage(baseDir / "caps");
avatarStorage = new AvatarFileStorage(baseDir / "avatars", baseDir / profile / "avatars", crypto);
rosterStorage = new RosterFileStorage(baseDir / profile / "roster.xml");
#ifdef SWIFT_EXPERIMENTAL_HISTORY
historyStorage = new SQLiteHistoryStorage(baseDir / "history.db");
+#else
+ historyStorage = NULL;
#endif
}
FileStorages::~FileStorages() {
delete rosterStorage;
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
-#ifdef SWIFT_EXPERIMENTAL_HISTORY
delete historyStorage;
-#endif
}
VCardStorage* FileStorages::getVCardStorage() const {
return vcardStorage;
}
CapsStorage* FileStorages::getCapsStorage() const {
return capsStorage;
}
diff --git a/Swift/Controllers/WhiteboardManager.cpp b/Swift/Controllers/WhiteboardManager.cpp
index 50aba6f..d8d89eb 100644
--- a/Swift/Controllers/WhiteboardManager.cpp
+++ b/Swift/Controllers/WhiteboardManager.cpp
@@ -119,18 +119,20 @@ namespace Swift {
onSessionTerminate(contact);
}
void WhiteboardManager::handleSessionCancel(const JID& contact) {
onSessionTerminate(contact);
}
void WhiteboardManager::handleSessionAccept(const JID& contact) {
WhiteboardWindow* window = findWhiteboardWindow(contact);
- window->show();
+ if (window != NULL) {
+ window->show();
+ }
onRequestAccepted(contact);
}
void WhiteboardManager::handleRequestReject(const JID& contact) {
onRequestRejected(contact);
}
}
diff --git a/Swift/QtUI/QtAvatarWidget.cpp b/Swift/QtUI/QtAvatarWidget.cpp
index 015c2da..fa08c27 100644
--- a/Swift/QtUI/QtAvatarWidget.cpp
+++ b/Swift/QtUI/QtAvatarWidget.cpp
@@ -1,15 +1,17 @@
/*
- * Copyright (c) 2011-2013 Remko Tronçon
+ * Copyright (c) 2011-2014 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
+
+
#include "QtAvatarWidget.h"
#include <QLabel>
#include <QVBoxLayout>
#include <QPixmap>
#include <QMenu>
#include <QAction>
#include <QMouseEvent>
#include <QFileDialog>
@@ -17,19 +19,19 @@
#include <QBuffer>
#include <QMessageBox>
#include <QPainter>
#include <QtSwiftUtil.h>
#include <Swiften/Base/Path.h>
namespace Swift {
-QtAvatarWidget::QtAvatarWidget(QWidget* parent) : QWidget(parent) {
+QtAvatarWidget::QtAvatarWidget(QWidget* parent) : QWidget(parent), editable(false) {
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(0,0,0,0);
QSizePolicy sp(QSizePolicy::Fixed, QSizePolicy::Fixed);
sp.setHorizontalStretch(0);
sp.setVerticalStretch(0);
setSizePolicy(sp);
setMinimumSize(QSize(96, 96));
setMaximumSize(QSize(96, 96));
diff --git a/Swift/QtUI/QtPlainChatView.h b/Swift/QtUI/QtPlainChatView.h
index 01b5925..cf65fb3 100644
--- a/Swift/QtUI/QtPlainChatView.h
+++ b/Swift/QtUI/QtPlainChatView.h
@@ -118,16 +118,15 @@ namespace Swift {
LogTextEdit(QWidget* parent) : QTextEdit(parent) {}
virtual ~LogTextEdit() {}
virtual void contextMenuEvent(QContextMenuEvent *event);
};
typedef std::map<std::string, FileTransfer*> FileTransferMap;
QtChatWindow* window_;
UIEventStream* eventStream_;
LogTextEdit* log_;
- QMenu* logMenu_;
FileTransferMap fileTransfers_;
std::map<std::string, boost::shared_ptr<SecurityLabel> > lastMessageLabel_;
int idGenerator_;
};
}
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp
index 44459d5..b9e7798 100644
--- a/Swift/QtUI/QtRosterHeader.cpp
+++ b/Swift/QtUI/QtRosterHeader.cpp
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2010 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "QtRosterHeader.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFileInfo>
@@ -17,19 +17,19 @@
#include <QBitmap>
#include "QtStatusWidget.h"
#include <Swift/QtUI/QtElidingLabel.h>
#include <Swift/QtUI/QtClickableLabel.h>
#include <Swift/QtUI/QtNameWidget.h>
#include "QtScaledAvatarCache.h"
namespace Swift {
-QtRosterHeader::QtRosterHeader(SettingsProvider* settings, StatusCache* statusCache, QWidget* parent) : QWidget(parent) {
+QtRosterHeader::QtRosterHeader(SettingsProvider* settings, StatusCache* statusCache, QWidget* parent) : QWidget(parent), statusEdit_(false) {
QHBoxLayout* topLayout = new QHBoxLayout();
topLayout->setSpacing(3);
topLayout->setContentsMargins(4,4,4,4);
setLayout(topLayout);
setMinimumHeight(50);
setMaximumHeight(50);
avatarLabel_ = new QtClickableLabel(this);
avatarLabel_->setMinimumSize(avatarSize_, avatarSize_);
diff --git a/Swift/QtUI/QtSystemTray.cpp b/Swift/QtUI/QtSystemTray.cpp
index 456a56f..83018b8 100644
--- a/Swift/QtUI/QtSystemTray.cpp
+++ b/Swift/QtUI/QtSystemTray.cpp
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2010 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma GCC diagnostic ignored "-Wredundant-decls"
#include "Swift/QtUI/QtSystemTray.h"
#include <QtDebug>
@@ -13,19 +13,19 @@
#include <QDBusInterface>
#endif
#include <QIcon>
#include <QPixmap>
#include <QResource>
#include <QMenu>
#include <QAction>
namespace Swift {
-QtSystemTray::QtSystemTray() : QObject(), trayMenu_(0), onlineIcon_(":icons/online.png"), awayIcon_(":icons/away.png"), dndIcon_(":icons/dnd.png"), offlineIcon_(":icons/offline.png"), newMessageIcon_(":icons/new-chat.png"), throbberMovie_(":/icons/connecting.mng"), unreadMessages_(false), connecting_(false) {
+QtSystemTray::QtSystemTray() : QObject(), statusType_(StatusShow::None), trayMenu_(0), onlineIcon_(":icons/online.png"), awayIcon_(":icons/away.png"), dndIcon_(":icons/dnd.png"), offlineIcon_(":icons/offline.png"), newMessageIcon_(":icons/new-chat.png"), throbberMovie_(":/icons/connecting.mng"), unreadMessages_(false), connecting_(false) {
trayIcon_ = new QSystemTrayIcon(offlineIcon_);
trayIcon_->setToolTip("Swift");
connect(trayIcon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(handleIconActivated(QSystemTrayIcon::ActivationReason)));
connect(&throbberMovie_, SIGNAL(frameChanged(int)), this, SLOT(handleThrobberFrameChanged(int)));
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
bool isUnity = QDBusInterface("com.canonical.Unity.Launcher", "/com/canonical/Unity/Launcher").isValid();
if (isUnity) {
// Add an activation menu, because this is the only way to get the application to the
// front on Unity. See the README for sni-qt (which handles Qt tray icons for Unity)
diff --git a/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp b/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp
index 4f1d3ab..877a598 100644
--- a/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp
@@ -1,21 +1,28 @@
/*
* Copyright (c) 2012 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+
#include "QtResizableLineEdit.h"
namespace Swift {
QtResizableLineEdit::QtResizableLineEdit(QWidget* parent) :
- QLineEdit(parent) {
+ QLineEdit(parent), editable(false) {
connect(this, SIGNAL(textChanged(QString)), SLOT(textChanged(QString)));
setMinimumWidth(30);
}
QtResizableLineEdit::~QtResizableLineEdit() {
}
bool QtResizableLineEdit::isEditable() const {
return editable;
diff --git a/Swiften/Client/MemoryStorages.cpp b/Swiften/Client/MemoryStorages.cpp
index 885d74f..850c1b2 100644
--- a/Swiften/Client/MemoryStorages.cpp
+++ b/Swiften/Client/MemoryStorages.cpp
@@ -14,29 +14,29 @@
namespace Swift {
MemoryStorages::MemoryStorages(CryptoProvider* crypto) {
vcardStorage = new VCardMemoryStorage(crypto);
capsStorage = new CapsMemoryStorage();
avatarStorage = new AvatarMemoryStorage();
rosterStorage = new RosterMemoryStorage();
#ifdef SWIFT_EXPERIMENTAL_HISTORY
historyStorage = new SQLiteHistoryStorage(":memory:");
+#else
+ historyStorage = NULL;
#endif
}
MemoryStorages::~MemoryStorages() {
delete rosterStorage;
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
-#ifdef SWIFT_EXPERIMENTAL_HISTORY
delete historyStorage;
-#endif
}
VCardStorage* MemoryStorages::getVCardStorage() const {
return vcardStorage;
}
CapsStorage* MemoryStorages::getCapsStorage() const {
return capsStorage;
}
diff --git a/Swiften/Elements/JingleContentPayload.h b/Swiften/Elements/JingleContentPayload.h
index 547fc70..ac62866 100644
--- a/Swiften/Elements/JingleContentPayload.h
+++ b/Swiften/Elements/JingleContentPayload.h
@@ -20,18 +20,21 @@ namespace Swift {
public:
typedef boost::shared_ptr<JingleContentPayload> ref;
enum Creator {
UnknownCreator,
InitiatorCreator,
ResponderCreator
};
+ JingleContentPayload() : creator(UnknownCreator) {
+ }
+
/*enum Senders {
NoSenders,
InitiatorSender,
ResponderSender,
BothSenders,
};*/
Creator getCreator() const {
return creator;
diff --git a/Swiften/Elements/JingleIBBTransportPayload.h b/Swiften/Elements/JingleIBBTransportPayload.h
index a329ff0..5704c00 100644
--- a/Swiften/Elements/JingleIBBTransportPayload.h
+++ b/Swiften/Elements/JingleIBBTransportPayload.h
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2011-2013 Remko Tronçon
+ * Copyright (c) 2011-2014 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#include <string>
@@ -16,18 +16,21 @@ namespace Swift {
class JingleIBBTransportPayload : public JingleTransportPayload {
public:
typedef boost::shared_ptr<JingleIBBTransportPayload> ref;
enum StanzaType {
IQStanza,
MessageStanza
};
+ JingleIBBTransportPayload() : stanzaType(IQStanza) {
+ }
+
void setStanzaType(StanzaType stanzaType) {
this->stanzaType = stanzaType;
}
StanzaType getStanzaType() const {
return stanzaType;
}
boost::optional<unsigned int> getBlockSize() const {
diff --git a/Swiften/Elements/PubSubRetract.cpp b/Swiften/Elements/PubSubRetract.cpp
index 7e5b720..41b9346 100644
--- a/Swiften/Elements/PubSubRetract.cpp
+++ b/Swiften/Elements/PubSubRetract.cpp
@@ -2,14 +2,14 @@
* Copyright (c) 2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Elements/PubSubRetract.h>
using namespace Swift;
-PubSubRetract::PubSubRetract() {
+PubSubRetract::PubSubRetract() : notify(false) {
}
PubSubRetract::~PubSubRetract() {
}
diff --git a/Swiften/Elements/PubSubSubscribeOptions.cpp b/Swiften/Elements/PubSubSubscribeOptions.cpp
index 3423d02..19cf084 100644
--- a/Swiften/Elements/PubSubSubscribeOptions.cpp
+++ b/Swiften/Elements/PubSubSubscribeOptions.cpp
@@ -2,14 +2,14 @@
* Copyright (c) 2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Elements/PubSubSubscribeOptions.h>
using namespace Swift;
-PubSubSubscribeOptions::PubSubSubscribeOptions() {
+PubSubSubscribeOptions::PubSubSubscribeOptions() : required(false) {
}
PubSubSubscribeOptions::~PubSubSubscribeOptions() {
}
diff --git a/Swiften/Elements/StreamManagementEnabled.cpp b/Swiften/Elements/StreamManagementEnabled.cpp
index bab7516..1f1a1f5 100644
--- a/Swiften/Elements/StreamManagementEnabled.cpp
+++ b/Swiften/Elements/StreamManagementEnabled.cpp
@@ -1,15 +1,15 @@
/*
- * Copyright (c) 2011 Remko Tronçon
+ * Copyright (c) 2011-2014 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Elements/StreamManagementEnabled.h>
using namespace Swift;
-StreamManagementEnabled::StreamManagementEnabled() {
+StreamManagementEnabled::StreamManagementEnabled() : resumeSupported(false) {
}
StreamManagementEnabled::~StreamManagementEnabled() {
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
index 3c63afc..df6e7d6 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
@@ -1,26 +1,33 @@
/*
* Copyright (c) 2012 Mateusz Piękos
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+
#pragma once
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
namespace Swift {
class WhiteboardLineElement : public WhiteboardElement {
public:
typedef boost::shared_ptr<WhiteboardLineElement> ref;
public:
- WhiteboardLineElement(int x1, int y1, int x2, int y2) {
+ WhiteboardLineElement(int x1, int y1, int x2, int y2) : penWidth_(1) {
x1_ = x1;
y1_ = y1;
x2_ = x2;
y2_ = y2;
}
int x1() const {
return x1_;
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
index 233b3fa..0fd1338 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
@@ -1,26 +1,32 @@
/*
* Copyright (c) 2012 Mateusz Piękos
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
#pragma once
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
namespace Swift {
class WhiteboardRectElement : public WhiteboardElement {
public:
typedef boost::shared_ptr<WhiteboardRectElement> ref;
public:
- WhiteboardRectElement(int x, int y, int width, int height) {
+ WhiteboardRectElement(int x, int y, int width, int height) : penWidth_(1) {
x_ = x;
y_ = y;
width_ = width;
height_ = height;
}
int getX() const {
return x_;
}
diff --git a/Swiften/FileTransfer/FileTransfer.cpp b/Swiften/FileTransfer/FileTransfer.cpp
index c11e8e4..912a78a 100644
--- a/Swiften/FileTransfer/FileTransfer.cpp
+++ b/Swiften/FileTransfer/FileTransfer.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (c) 2013 Remko Tronçon
+ * Copyright (c) 2013-2014 Remko Tronçon
* Licensed under the GNU General Public License.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/FileTransfer.h>
using namespace Swift;
-FileTransfer::FileTransfer() {
+FileTransfer::FileTransfer() : fileSizeInBytes(0) {
}
FileTransfer::~FileTransfer() {
}
void FileTransfer::setFileInfo(const std::string& name, boost::uintmax_t size) {
filename = name;
fileSizeInBytes = size;
}
diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp
index 83f12f7..bde689e 100644
--- a/Swiften/Network/BOSHConnection.cpp
+++ b/Swiften/Network/BOSHConnection.cpp
@@ -26,18 +26,19 @@
namespace Swift {
BOSHConnection::BOSHConnection(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory)
: boshURL_(boshURL),
connector_(connector),
parserFactory_(parserFactory),
sid_(),
waitingForStartResponse_(false),
+ rid_(~0ULL),
pending_(false),
connectionReady_(false)
{
}
BOSHConnection::~BOSHConnection() {
cancelConnector();
if (connection_) {
connection_->onDataRead.disconnect(boost::bind(&BOSHConnection::handleDataRead, shared_from_this(), _1));
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.cpp b/Swiften/Network/SOCKS5ProxiedConnection.cpp
index a9243d6..3fd8184 100644
--- a/Swiften/Network/SOCKS5ProxiedConnection.cpp
+++ b/Swiften/Network/SOCKS5ProxiedConnection.cpp
@@ -1,15 +1,21 @@
/*
* Copyright (c) 2010-2011 Thilo Cestonaro
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
#include <Swiften/Network/SOCKS5ProxiedConnection.h>
#include <iostream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <Swiften/Network/ConnectionFactory.h>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/String.h>
@@ -18,19 +24,20 @@
using namespace Swift;
SOCKS5ProxiedConnection::SOCKS5ProxiedConnection(
DomainNameResolver* resolver,
ConnectionFactory* connectionFactory,
TimerFactory* timerFactory,
const std::string& proxyHost,
int proxyPort) :
- ProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort) {
+ ProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort),
+ proxyState_(Initial) {
}
void SOCKS5ProxiedConnection::initializeProxy() {
proxyState_ = ProxyAuthenticating;
SafeByteArray socksConnect;
socksConnect.push_back(0x05); // VER = SOCKS5 = 0x05
socksConnect.push_back(0x01); // Number of authentication methods after this byte.
socksConnect.push_back(0x00); // 0x00 == no authentication
// buffer.push_back(0x01); // 0x01 == GSSAPI
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.h b/Swiften/Network/SOCKS5ProxiedConnection.h
index 7906879..2c93468 100644
--- a/Swiften/Network/SOCKS5ProxiedConnection.h
+++ b/Swiften/Network/SOCKS5ProxiedConnection.h
@@ -23,14 +23,15 @@ namespace Swift {
private:
SOCKS5ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort);
virtual void initializeProxy();
virtual void handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data);
private:
enum {
- ProxyAuthenticating = 0,
+ Initial = 0,
+ ProxyAuthenticating,
ProxyConnecting
} proxyState_;
};
}