summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qsocks5socketengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qsocks5socketengine.cpp')
-rw-r--r--src/network/socket/qsocks5socketengine.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index 18b3ce9db2..8a030601dc 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -322,8 +322,8 @@ public:
protected:
void timerEvent(QTimerEvent * event) override;
- QMutex mutex;
- int sweepTimerId;
+ QRecursiveMutex mutex;
+ int sweepTimerId = -1;
//socket descriptor, data, timestamp
QHash<int, QSocks5BindData *> store;
};
@@ -331,8 +331,6 @@ protected:
Q_GLOBAL_STATIC(QSocks5BindStore, socks5BindStore)
QSocks5BindStore::QSocks5BindStore()
- : mutex(QMutex::Recursive)
- , sweepTimerId(-1)
{
QCoreApplication *app = QCoreApplication::instance();
if (app && app->thread() != thread())
@@ -801,9 +799,9 @@ void QSocks5SocketEnginePrivate::sendRequestMethod()
QByteArray buf;
buf.reserve(270); // big enough for domain name;
- buf[0] = S5_VERSION_5;
- buf[1] = command;
- buf[2] = 0x00;
+ buf.append(char(S5_VERSION_5));
+ buf.append(command);
+ buf.append('\0');
if (peerName.isEmpty() && !qt_socks5_set_host_address_and_port(address, port, &buf)) {
QSOCKS5_DEBUG << "error setting address" << address << " : " << port;
//### set error code ....