19#include "private/qiodevice_p.h"
20#include "private/qringbuffer_p.h"
24#include <QtCore/qpointer.h>
31using namespace std::chrono_literals;
37#define MAX_DATA_DUMP 256
40#define Q_INIT_CHECK(returnValue) do { \
45#define S5_VERSION_5 0x05
46#define S5_CONNECT 0x01
48#define S5_UDP_ASSOCIATE 0x03
50#define S5_DOMAINNAME 0x03
52#define S5_SUCCESS 0x00
53#define S5_R_ERROR_SOCKS_FAILURE 0x01
54#define S5_R_ERROR_CON_NOT_ALLOWED 0x02
55#define S5_R_ERROR_NET_UNREACH 0x03
56#define S5_R_ERROR_HOST_UNREACH 0x04
57#define S5_R_ERROR_CONN_REFUSED 0x05
58#define S5_R_ERROR_TTL 0x06
59#define S5_R_ERROR_CMD_NOT_SUPPORTED 0x07
60#define S5_R_ERROR_ADD_TYPE_NOT_SUPORTED 0x08
62#define S5_AUTHMETHOD_NONE 0x00
63#define S5_AUTHMETHOD_PASSWORD 0x02
64#define S5_AUTHMETHOD_NOTACCEPTABLE 0xFF
66#define S5_PASSWORDAUTH_VERSION 0x01
68#ifdef QSOCKS5SOCKETLAYER_DEBUG
69# define QSOCKS5_Q_DEBUG qDebug() << this
70# define QSOCKS5_D_DEBUG qDebug() << q_ptr
71# define QSOCKS5_DEBUG qDebug() << "[QSocks5]"
90 return "unknown state"_L1;
109# define QSOCKS5_DEBUG if (0) qDebug()
110# define QSOCKS5_Q_DEBUG if (0) qDebug()
111# define QSOCKS5_D_DEBUG if (0) qDebug()
134 data.ipv4 = qToBigEndian<quint32>(
address.toIPv4Address());
146 data.port = qToBigEndian<quint16>(
port);
161 if (encodedHostName.size() > 255)
173 data.port = qToBigEndian<quint16>(
port);
189 const unsigned char *pBuf =
reinterpret_cast<const unsigned char*
>(
buf.constData());
193 if (
buf.size() -
pos < 1) {
199 if (
buf.size() -
pos < 4) {
203 address.setAddress(qFromBigEndian<quint32>(&pBuf[
pos]));
208 if (
buf.size() -
pos < 16) {
213 for (
int i = 0;
i < 16; ++
i)
228 if (
buf.size() -
pos < 2) {
232 port = qFromBigEndian<quint16>(&pBuf[
pos]);
273#ifndef QT_NO_UDPSOCKET
300 QHash<qintptr, QSocks5BindData *>
store;
346 qWarning(
"Cannot access socks5 bind data from different thread");
366 if (
it.value()->timeStamp.hasExpired(350000)) {
417 return unSeal(sealedSocket->readAll(),
buf);
422 this->userName = userName;
423 this->password = password;
437 char *
buf = dataBuf.data();
443 buf[
pos++] = passwd.size();
444 memcpy(&
buf[
pos], passwd.data(), passwd.size());
468 return "Socks5 user name or password incorrect"_L1;
475 , readNotificationEnabled(
false)
476 , writeNotificationEnabled(
false)
477 , exceptNotificationEnabled(
false)
478 , socketDescriptor(-1)
481#ifndef QT_NO_UDPSOCKET
485 , readNotificationActivated(
false)
486 , writeNotificationActivated(
false)
487 , readNotificationPending(
false)
488 , writeNotificationPending(
false)
489 , connectionNotificationPending(
false)
506#ifndef QT_NO_UDPSOCKET
566 switch (controlSocketError) {
569 QSocks5SocketEngine::tr(
"Connection to proxy refused"));
573 QSocks5SocketEngine::tr(
"Connection to proxy closed prematurely"));
577 QSocks5SocketEngine::tr(
"Proxy host not found"));
582 QSocks5SocketEngine::tr(
"Connection to proxy timed out"));
587 q->setError(controlSocketError,
data->controlSocket->errorString());
591 q->setError(controlSocketError,
data->controlSocket->errorString());
598 extraMessage.isEmpty() ?
599 QSocks5SocketEngine::tr(
"Proxy authentication failed") :
600 QSocks5SocketEngine::tr(
"Proxy authentication failed: %1").arg(extraMessage));
609 QSocks5SocketEngine::tr(
"SOCKS version 5 protocol error"));
614 QAbstractSocket::tr(
"Host not found"));
625 switch (socks5error) {
628 QSocks5SocketEngine::tr(
"General SOCKSv5 server failure"));
632 QSocks5SocketEngine::tr(
"Connection not allowed by SOCKSv5 server"));
636 QAbstractSocket::tr(
"Network unreachable"));
640 QAbstractSocket::tr(
"Host not found"));
644 QAbstractSocket::tr(
"Connection refused"));
648 QSocks5SocketEngine::tr(
"TTL expired"));
652 QSocks5SocketEngine::tr(
"SOCKSv5 command not supported"));
656 QSocks5SocketEngine::tr(
"Address type not supported"));
661 QSocks5SocketEngine::tr(
"Unknown SOCKSv5 proxy error code 0x%1").
arg(
int(socks5error), 16));
674 q->proxyAuthenticationRequired(
proxyInfo, &auth);
676 if (!auth.user().isEmpty() || !auth.password().isEmpty()) {
678 QSOCKS5_DEBUG <<
"authentication failure: retrying connection";
681 delete data->authenticator;
688 data->controlSocket->abort();
695 data->controlSocket->close();
703 if (
data->controlSocket->bytesAvailable() < 2)
710 data->controlSocket->close();
715 bool authComplete =
false;
721 }
else if (
buf.at(1) !=
data->authenticator->methodId()
722 || !
data->authenticator->beginAuthenticate(
data->controlSocket, &authComplete)) {
737 bool authComplete =
false;
738 if (!
data->authenticator->continueAuthenticate(
data->controlSocket, &authComplete)) {
760#ifndef QT_NO_UDPSOCKET
783 if (!
data->authenticator->seal(
buf, &sealedBuf)) {
786 data->controlSocket->write(sealedBuf);
787 data->controlSocket->flush();
797 if (!
data->authenticator->unSeal(
data->controlSocket, &inBuf)) {
806 if (inBuf.size() < 3) {
807 QSOCKS5_DEBUG <<
"need more data for request reply header .. put this data somewhere";
815 if (inBuf.at(0) !=
S5_VERSION_5 || inBuf.at(2) != 0x00) {
835 }
else if (err == 0) {
841 for (
int i = inBuf.size() - 1;
i >= 0 ; --
i)
842 data->controlSocket->ungetChar(inBuf.at(
i));
871 data->controlSocket->close();
882 QPointer<QSocks5SocketEngine> qq =
q;
883 q->readNotification();
912 q->writeNotification();
932 q->connectionNotification();
953 delete d->data->authenticator;
954 delete d->data->controlSocket;
957 delete d->connectData;
958#ifndef QT_NO_UDPSOCKET
960 delete d->udpData->udpSocket;
980 d->socketType =
type;
1005 d->data =
d->connectData;
1010 d->socketProtocol =
d->data->controlSocket->localAddress().protocol();
1017 d->inboundStreamCount =
d->outboundStreamCount = 1;
1036 if (
d->data->controlSocket->bytesAvailable() != 0)
1037 d->_q_controlSocketReadNotification();
1046 d->proxyInfo = networkProxy;
1052 return d->socketDescriptor;
1072#ifndef QT_NO_UDPSOCKET
1083 qFatal(
"QSocks5SocketEngine::connectToHost: in QTcpServer mode");
1094 d->data->controlSocket->setReadBufferSize(65536);
1097 d->data->controlSocket->connectToHost(
d->proxyInfo.hostName(),
d->proxyInfo.port());
1110 d->peerName.clear();
1121 d->peerName = hostname;
1132 buf[2] =
data->authenticator->methodId();
1133 data->controlSocket->write(
buf);
1140 <<
"bytes available" <<
data->controlSocket->bytesAvailable();
1142 if (
data->controlSocket->bytesAvailable() == 0) {
1143 QSOCKS5_D_DEBUG <<
"########## bogus read why do we get these ... on windows only";
1161 if (!
data->authenticator->unSeal(
data->controlSocket, &
buf)) {
1180 qWarning(
"QSocks5SocketEnginePrivate::_q_controlSocketReadNotification: "
1181 "Unexpectedly received data while in state=%d and mode=%d",
1193 &&
data->controlSocket->bytesToWrite()))
1215 data->controlSocket->close();
1223 data->controlSocket->close();
1226 q_func()->setError(
data->controlSocket->error(),
data->controlSocket->errorString());
1242#ifndef QT_NO_UDPSOCKET
1258 if (!
data->authenticator->unSeal(sealedBuf, &inBuf)) {
1264 const char *
buf = inBuf.constData();
1265 if (inBuf.size() < 4) {
1304#ifndef QT_NO_UDPSOCKET
1314#ifndef QT_NO_UDPSOCKET
1318 setError(
d->udpData->udpSocket->error(),
d->udpData->udpSocket->errorString());
1321 d->localAddress =
d->udpData->udpSocket->localAddress();
1322 d->localPort =
d->udpData->udpSocket->localPort();
1327 d->localPort =
port;
1333 d->data->controlSocket->connectToHost(
d->proxyInfo.hostName(),
d->proxyInfo.port());
1334 if (!
d->waitForConnected(
QDeadlineTimer{Socks5BlockingBindTimeout},
nullptr) ||
1337 QSOCKS5_Q_DEBUG <<
"waitForConnected to proxy server" <<
d->data->controlSocket->errorString();
1343#ifndef QT_NO_UDPSOCKET
1346 d->udpData->associateAddress =
d->localAddress;
1348 d->udpData->associatePort =
d->localPort;
1377 d->emitReadNotification();
1392 switch (
d->socks5State) {
1394 QSOCKS5_Q_DEBUG <<
"BindSuccess adding" <<
d->socketDescriptor <<
"to the bind store";
1395 d->data->controlSocket->disconnect();
1396 d->data->controlSocket->setParent(
nullptr);
1397 d->bindData->localAddress =
d->localAddress;
1398 d->bindData->localPort =
d->localPort;
1399 sd =
d->socketDescriptor;
1400 socks5BindStore()->add(sd,
d->bindData);
1402 d->bindData =
nullptr;
1403 d->socketDescriptor = 0;
1423 if (
d->data &&
d->data->controlSocket) {
1426 while (!
d->data->controlSocket->bytesToWrite()) {
1431 d->data->controlSocket->close();
1433 d->inboundStreamCount =
d->outboundStreamCount = 0;
1434#ifndef QT_NO_UDPSOCKET
1435 if (
d->udpData &&
d->udpData->udpSocket)
1436 d->udpData->udpSocket->close();
1444 return d->connectData->readBuffer.size();
1445#ifndef QT_NO_UDPSOCKET
1447 && !
d->udpData->pendingDatagrams.isEmpty())
1448 return d->udpData->pendingDatagrams.constFirst().data.size();
1458 if (
d->connectData->readBuffer.isEmpty()) {
1463 "Remote host closed connection"_L1);
1473#ifndef QT_NO_UDPSOCKET
1494 if (!
d->data->authenticator->seal(
buf, &sealedBuf)) {
1501 qint64 written =
d->
data->controlSocket->write(sealedBuf.constData(), sealedBuf.size());
1507 d->data->controlSocket->waitForBytesWritten(0);
1510#ifndef QT_NO_UDPSOCKET
1520#ifndef QT_NO_UDPSOCKET
1521#ifndef QT_NO_NETWORKINTERFACE
1526 "Operation on socket is not supported"_L1);
1534 "Operation on socket is not supported"_L1);
1547 "Operation on socket is not supported"_L1);
1557 return !
d->udpData->pendingDatagrams.isEmpty();
1564 if (!
d->udpData->pendingDatagrams.isEmpty())
1565 return d->udpData->pendingDatagrams.head().data.size();
1572#ifndef QT_NO_UDPSOCKET
1575 if (
d->udpData->pendingDatagrams.isEmpty())
1579 int copyLen = qMin<int>(maxlen, datagram.data.size());
1580 memcpy(
data, datagram.data.constData(), copyLen);
1582 header->senderAddress = datagram.address;
1583 header->senderPort = datagram.port;
1596#ifndef QT_NO_UDPSOCKET
1611 outBuf.append(3,
'\0');
1614 <<
header.destinationPort;
1621 if (!
d->data->authenticator->seal(outBuf, &sealedBuf)) {
1626 if (
d->udpData->udpSocket->writeDatagram(sealedBuf,
d->udpData->associateAddress,
d->udpData->associatePort) != sealedBuf.size()) {
1629 setError(
d->udpData->udpSocket->error(),
d->udpData->udpSocket->errorString());
1646 if (
d->data &&
d->data->controlSocket) {
1647 return d->data->controlSocket->bytesToWrite();
1656 if (
d->data &&
d->data->controlSocket) {
1669 if (
d->data &&
d->data->controlSocket) {
1710 d->readNotificationActivated =
false;
1713 if (!
d->waitForConnected(
deadline, timedOut))
1726 while (!
d->readNotificationActivated) {
1731 setError(
d->data->controlSocket->error(),
d->data->controlSocket->errorString());
1737#ifndef QT_NO_UDPSOCKET
1739 while (!
d->readNotificationActivated) {
1741 setError(
d->udpData->udpSocket->error(),
d->udpData->udpSocket->errorString());
1751 bool ret =
d->readNotificationActivated;
1752 d->readNotificationActivated =
false;
1765 if (!
d->waitForConnected(
deadline, timedOut))
1773 if (
d->data->controlSocket->bytesToWrite())
1776 auto shouldWriteBytes = [&]() {
1783 d->data->controlSocket->waitForBytesWritten(remainingTime);
1788 bool checkRead,
bool checkWrite,
1795 *readyToRead = canRead;
1801 *readyToWrite = canWrite;
1808 return d->readNotificationEnabled;
1817 bool emitSignal =
false;
1818 if (!
d->readNotificationEnabled
1821 emitSignal = !
d->connectData->readBuffer.isEmpty();
1822#ifndef QT_NO_UDPSOCKET
1824 emitSignal = !
d->udpData->pendingDatagrams.isEmpty();
1832 d->readNotificationEnabled =
enable;
1835 d->emitReadNotification();
1841 return d->writeNotificationEnabled;
1847 d->writeNotificationEnabled =
enable;
1851 d->emitWriteNotification();
1852 d->writeNotificationActivated =
false;
1859 return d->exceptNotificationEnabled;
1865 d->exceptNotificationEnabled =
enable;
1879 auto engine = std::make_unique<QSocks5SocketEngine>(parent);
1887 if (socks5BindStore()->
contains(socketDescriptor)) {
1896#include "moc_qsocks5socketengine_p.cpp"
QHostAddress localAddress
QAbstractSocket::SocketError socketError
QAbstractSocket::NetworkLayerProtocol protocol() const
void setPeerPort(quint16 port)
void setPeerAddress(const QHostAddress &address)
void setState(QAbstractSocket::SocketState state)
QAbstractSocket::SocketType socketType() const
void setError(QAbstractSocket::SocketError error, const QString &errorString) const
SocketState
This enum describes the different states in which a socket can be.
static constexpr auto IPv4Protocol
qint64 bytesAvailable() const override
Returns the number of incoming bytes that are waiting to be read.
void setProxy(const QNetworkProxy &networkProxy)
static constexpr auto AnyIPProtocol
void close() override
Closes the I/O device for the socket and calls disconnectFromHost() to close the socket's connection.
SocketError
This enum describes the socket errors that can occur.
@ ProxyConnectionClosedError
@ ProxyConnectionRefusedError
@ ProxyConnectionTimeoutError
@ UnsupportedSocketOperationError
@ UnfinishedSocketOperationError
@ ProxyAuthenticationRequiredError
static constexpr auto IPv6Protocol
SocketType
This enum describes the transport layer protocol.
The QAuthenticator class provides an authentication object.
T fetchAndAddRelaxed(T valueToAdd) noexcept
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
void clear()
Clears the contents of the byte array and makes it null.
QByteArray & remove(qsizetype index, qsizetype len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
qint64 remainingTime() const noexcept
Returns the remaining time in this QDeadlineTimer object in milliseconds.
std::chrono::nanoseconds remainingTimeAsDuration() const noexcept
Returns the time remaining before the deadline.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
const_iterator constFind(const Key &key) const noexcept
iterator erase(const_iterator it)
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator cend() const noexcept
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
The QHostAddress class provides an IP address.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
The QNetworkInterface class provides a listing of the host's IP addresses and network interfaces.
The QNetworkProxy class provides a network layer proxy.
QString user() const
Returns the user name used for authentication.
void setUser(const QString &userName)
Sets the user name for proxy authentication to be user.
QNetworkProxy::ProxyType type() const
Returns the proxy type for this instance.
QString password() const
Returns the password used for authentication.
QString hostName() const
Returns the host name of the proxy host.
void setPassword(const QString &password)
Sets the password for proxy authentication to be password.
quint16 port() const
Returns the port of the proxy host.
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setParent(QObject *parent)
Makes the object a child of parent.
QThread * thread() const
Returns the thread in which the object lives.
void killTimer(int id)
Kills the timer with timer identifier, id.
void enqueue(const T &t)
Adds value t to the tail of the queue.
Q_CORE_EXPORT void append(const char *data, qint64 size)
Q_CORE_EXPORT void clear()
Exception-safe wrapper around QObject::blockSignals().
virtual bool beginAuthenticate(QTcpSocket *socket, bool *completed)
virtual bool continueAuthenticate(QTcpSocket *socket, bool *completed)
bool seal(const QByteArray &buf, QByteArray *sealedBuf)
virtual ~QSocks5Authenticator()
bool unSeal(const QByteArray &sealedBuf, QByteArray *buf)
void add(qintptr socketDescriptor, QSocks5BindData *bindData)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QSocks5BindData * retrieve(qintptr socketDescriptor)
bool contains(qintptr socketDescriptor)
QHash< qintptr, QSocks5BindData * > store
bool beginAuthenticate(QTcpSocket *socket, bool *completed) override
bool continueAuthenticate(QTcpSocket *socket, bool *completed) override
QSocks5PasswordAuthenticator(const QString &userName, const QString &password)
QString errorString() override
virtual QAbstractSocketEngine * createSocketEngine(QAbstractSocket::SocketType socketType, const QNetworkProxy &, QObject *parent) override
QSocks5UdpAssociateData * udpData
void parseRequestMethodReply()
void _q_controlSocketReadNotification()
void setErrorState(Socks5State state, const QString &extraMessage=QString())
void _q_controlSocketStateChanged(QAbstractSocket::SocketState)
bool readNotificationActivated
@ AddressTypeNotSupported
bool writeNotificationEnabled
void _q_controlSocketDisconnected()
void emitReadNotification()
void _q_emitPendingReadNotification()
@ AuthenticationMethodsSent
void _q_emitPendingWriteNotification()
~QSocks5SocketEnginePrivate()
QSocks5ConnectData * connectData
void parseAuthenticatingReply()
void _q_controlSocketErrorOccurred(QAbstractSocket::SocketError)
bool readNotificationEnabled
QSocks5SocketEnginePrivate()
bool connectionNotificationPending
bool writeNotificationActivated
QByteArray receivedHeaderFragment
QSocks5BindData * bindData
bool readNotificationPending
void _q_controlSocketConnected()
bool writeNotificationPending
void emitConnectionNotification()
void emitWriteNotification()
bool waitForConnected(QDeadlineTimer deadline, bool *timedOut)
void _q_emitPendingConnectionNotification()
void parseAuthenticationMethodReply()
void _q_controlSocketBytesWritten()
void _q_udpSocketReadNotification()
void initialize(Socks5Mode socks5Mode)
bool waitForWrite(QDeadlineTimer deadline=QDeadlineTimer{DefaultTimeout}, bool *timedOut=nullptr) override
qint64 pendingDatagramSize() const override
bool isExceptionNotificationEnabled() const override
void setExceptionNotificationEnabled(bool enable) override
bool setOption(SocketOption option, int value) override
bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface) override
bool listen(int backlog) override
bool isReadNotificationEnabled() const override
qintptr socketDescriptor() const override
qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *=nullptr, PacketHeaderOptions=WantNone) override
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite, bool checkRead, bool checkWrite, QDeadlineTimer deadline=QDeadlineTimer{DefaultTimeout}, bool *timedOut=nullptr) override
bool isWriteNotificationEnabled() const override
qintptr accept() override
void setProxy(const QNetworkProxy &networkProxy)
bool isValid() const override
bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface) override
bool connectToHostByName(const QString &name, quint16 port) override
QNetworkInterface multicastInterface() const override
int option(SocketOption option) const override
qint64 bytesToWrite() const override
bool hasPendingDatagrams() const override
qint64 bytesAvailable() const override
QSocks5SocketEngine(QObject *parent=nullptr)
void setReadNotificationEnabled(bool enable) override
qint64 read(char *data, qint64 maxlen) override
bool setMulticastInterface(const QNetworkInterface &iface) override
bool connectToHost(const QHostAddress &address, quint16 port) override
qint64 write(const char *data, qint64 len) override
bool bind(const QHostAddress &address, quint16 port) override
bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol=QAbstractSocket::IPv4Protocol) override
bool waitForRead(QDeadlineTimer deadline=QDeadlineTimer{DefaultTimeout}, bool *timedOut=nullptr) override
void setWriteNotificationEnabled(bool enable) override
qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QTcpSocket class provides a TCP socket.
static QThread * currentThread()
bool hasPendingDatagrams() const
Returns true if at least one datagram is waiting to be read; otherwise returns false.
qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host=nullptr, quint16 *port=nullptr)
Receives a datagram no larger than maxSize bytes and stores it in data.
qint64 pendingDatagramSize() const
Returns the size of the first pending UDP datagram.
static QByteArray toAce(const QString &domain, AceProcessingOptions options={})
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
DBusConnection const char DBusError * error
static QString header(const QString &name)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QT_BEGIN_NAMESPACE const char * socketType(QSocketNotifier::Type type)
constexpr int Uninitialized
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static ControlElement< T > * ptr(QWidget *widget)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLenum GLsizei GLuint GLint * bytesWritten
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
static int qt_socks5_get_host_address_and_port(const QByteArray &buf, QHostAddress *pAddress, quint16 *pPort, int *pPos)
#define S5_AUTHMETHOD_NONE
static bool qt_socks5_set_host_address_and_port(const QHostAddress &address, quint16 port, QByteArray *pBuf)
static QString s5StateToString(QSocks5SocketEnginePrivate::Socks5State)
static QString dump(const QByteArray &)
#define S5_PASSWORDAUTH_VERSION
#define Q_INIT_CHECK(returnValue)
#define S5_AUTHMETHOD_NOTACCEPTABLE
static const int MaxWriteBufferSize
static int nextDescriptor()
static bool qt_socks5_set_host_name_and_port(const QString &hostname, quint16 port, QByteArray *pBuf)
static constexpr auto Socks5BlockingBindTimeout
#define QT_TRANSLATE_NOOP(scope, x)
QDeadlineTimer deadline(30s)
myObject moveToThread(QApplication::instance() ->thread())
[6]
QApplication app(argc, argv)
[0]
socketLayer waitForWrite()
QHostAddress localAddress
QTcpSocket * controlSocket
QSocks5Authenticator * authenticator
QHostAddress associateAddress
QQueue< QSocks5RevivedDatagram > pendingDatagrams