summaryrefslogtreecommitdiffstats
path: root/src/kvirc/kernel/kvi_ircsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvirc/kernel/kvi_ircsocket.cpp')
-rw-r--r--src/kvirc/kernel/kvi_ircsocket.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/src/kvirc/kernel/kvi_ircsocket.cpp b/src/kvirc/kernel/kvi_ircsocket.cpp
index 45df5617..45852760 100644
--- a/src/kvirc/kernel/kvi_ircsocket.cpp
+++ b/src/kvirc/kernel/kvi_ircsocket.cpp
@@ -47,8 +47,8 @@
#include "kvi_sslmaster.h"
#endif
-#include <qtimer.h>
-#include <qsocketnotifier.h>
+#include <tqtimer.h>
+#include <tqsocketnotifier.h>
#ifndef COMPILE_ON_WINDOWS
#include <unistd.h> //for gettimeofday()
@@ -63,7 +63,7 @@ unsigned int g_uNextIrcLinkId = 1;
KviIrcSocket::KviIrcSocket(KviIrcLink * pLink)
-: QObject()
+: TQObject()
{
m_uId = g_uNextIrcLinkId;
g_uNextIrcLinkId++;
@@ -103,8 +103,8 @@ KviIrcSocket::KviIrcSocket(KviIrcLink * pLink)
m_bInProcessData = false;
- m_pFlushTimer = new QTimer(); // queue flush timer
- connect(m_pFlushTimer,SIGNAL(timeout()),this,SLOT(flushSendQueue()));
+ m_pFlushTimer = new TQTimer(); // queue flush timer
+ connect(m_pFlushTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(flushSendQueue()));
}
KviIrcSocket::~KviIrcSocket()
@@ -171,49 +171,49 @@ void KviIrcSocket::reset()
setState(Idle);
}
-void KviIrcSocket::outputSSLMessage(const QString &szMsg)
+void KviIrcSocket::outputSSLMessage(const TQString &szMsg)
{
m_pConsole->output(KVI_OUT_SSL,__tr2qs("[SSL]: %Q"),&szMsg);
}
-void KviIrcSocket::outputSSLError(const QString &szMsg)
+void KviIrcSocket::outputSSLError(const TQString &szMsg)
{
m_pConsole->output(KVI_OUT_SSL,__tr2qs("[SSL ERROR]: %Q"),&szMsg);
}
-void KviIrcSocket::outputProxyMessage(const QString &szMsg)
+void KviIrcSocket::outputProxyMessage(const TQString &szMsg)
{
- QStringList list=QStringList::split("\n",szMsg);
- for(QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+ TQStringList list=TQStringList::split("\n",szMsg);
+ for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it)
{
- QString szTemporary = (*it).stripWhiteSpace();
+ TQString szTemporary = (*it).stripWhiteSpace();
m_pConsole->output(KVI_OUT_SOCKETMESSAGE,__tr2qs("[PROXY]: %Q"),&(szTemporary));
}
}
-void KviIrcSocket::outputProxyError(const QString &szMsg)
+void KviIrcSocket::outputProxyError(const TQString &szMsg)
{
- QStringList list=QStringList::split("\n",szMsg);
- for(QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+ TQStringList list=TQStringList::split("\n",szMsg);
+ for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it)
{
- QString szTemporary = (*it).stripWhiteSpace();
+ TQString szTemporary = (*it).stripWhiteSpace();
m_pConsole->output(KVI_OUT_SOCKETERROR,__tr2qs("[PROXY ERROR]: %Q"),&(szTemporary));
}
}
-void KviIrcSocket::outputSocketMessage(const QString &szMsg)
+void KviIrcSocket::outputSocketMessage(const TQString &szMsg)
{
m_pConsole->output(KVI_OUT_SOCKETMESSAGE,__tr2qs("[SOCKET]: %Q"),&szMsg);
}
-void KviIrcSocket::outputSocketError(const QString &szMsg)
+void KviIrcSocket::outputSocketError(const TQString &szMsg)
{
m_pConsole->output(KVI_OUT_SOCKETERROR,__tr2qs("[SOCKET ERROR]: %Q"),&szMsg);
}
-void KviIrcSocket::outputSocketWarning(const QString &szMsg)
+void KviIrcSocket::outputSocketWarning(const TQString &szMsg)
{
m_pConsole->output(KVI_OUT_SOCKETWARNING,__tr2qs("[SOCKET WARNING]: %Q"),&szMsg);
}
@@ -273,7 +273,7 @@ int KviIrcSocket::startConnection(KviIrcServer *srv,KviProxy * prx,const char *
// check the proxy IP address
if(m_pProxy->isIpV6())
{
- // IpV6 proxy :) (STILL QUITE UNTESTED ?)
+ // IpV6 proxy :) (STILL TQUITE UNTESTED ?)
#ifdef COMPILE_IPV6_SUPPORT
bTargetIpV6 = true;
if(!kvi_isValidStringIp_V6(m_pProxy->ip()))return KviError_invalidProxyAddress;
@@ -330,15 +330,15 @@ int KviIrcSocket::startConnection(KviIrcServer *srv,KviProxy * prx,const char *
bBindOk = kvi_socket_bind(m_sock,localSa.socketAddress(),((int)(localSa.addressLength())));
}
- QString tmp;
+ TQString tmp;
if(bBindOk)
{
if(_OUTPUT_VERBOSE)
- KviQString::sprintf(tmp,__tr2qs("Binding to local address %s"),bindAddress);
+ KviTQString::sprintf(tmp,__tr2qs("Binding to local address %s"),bindAddress);
outputSocketMessage(tmp);
} else {
if(_OUTPUT_VERBOSE)
- KviQString::sprintf(tmp,__tr2qs("Binding to local address %s failed: the kernel will choose the correct interface"),bindAddress);
+ KviTQString::sprintf(tmp,__tr2qs("Binding to local address %s failed: the kernel will choose the correct interface"),bindAddress);
outputSocketWarning(tmp);
}
}
@@ -374,14 +374,14 @@ int KviIrcSocket::startConnection(KviIrcServer *srv,KviProxy * prx,const char *
}
// and setup the WRITE notifier...
- m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write);
- QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(writeNotifierFired(int)));
+ m_pWsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Write);
+ TQObject::connect(m_pWsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(writeNotifierFired(int)));
m_pWsn->setEnabled(true);
// set the timer
if(KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) < 5)KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) = 5;
- m_pTimeoutTimer = new QTimer();
- QObject::connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut()));
+ m_pTimeoutTimer = new TQTimer();
+ TQObject::connect(m_pTimeoutTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(connectionTimedOut()));
m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) * 1000,true);
// and wait for connect
@@ -456,9 +456,9 @@ void KviIrcSocket::connectedToProxy()
m_pRsn = 0;
}
- m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read);
+ m_pRsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Read);
- QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readProxyData(int)));
+ TQObject::connect(m_pRsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(readProxyData(int)));
switch(m_pProxy->protocol())
{
@@ -696,7 +696,7 @@ void KviIrcSocket::proxyLoginV4()
char *bufToSend = new char[iLen];
bufToSend[0]=(unsigned char)4; //Version 4
bufToSend[1]=(unsigned char)1; //Connect
- Q_UINT16 port=(Q_UINT16)htons(m_pIrcServer->port());
+ TQ_UINT16 port=(TQ_UINT16)htons(m_pIrcServer->port());
kvi_memmove((void *)(bufToSend+2),(void *)&port,2);
struct in_addr ircInAddr;
@@ -704,7 +704,7 @@ void KviIrcSocket::proxyLoginV4()
if(!kvi_stringIpToBinaryIp(m_pIrcServer->ip(),&ircInAddr))
debug("SOCKET INTERNAL ERROR IN IPV4 (SOCKS4) ADDR CONVERSION");
- Q_UINT32 host=(Q_UINT32)ircInAddr.s_addr;
+ TQ_UINT32 host=(TQ_UINT32)ircInAddr.s_addr;
kvi_memmove((void *)(bufToSend+4),(void *)&host,4);
kvi_memmove((void *)(bufToSend+8),(void *)(szUserAndPass.ptr()),szUserAndPass.len());
// send it into hyperspace...
@@ -741,9 +741,9 @@ void KviIrcSocket::proxyLoginV5()
// The VER field is set to X'05' for this version of the protocol. The
// NMETHODS field contains the number of method identifier octets that
// appear in the METHODS field.
- // The values currently defined for METHOD are:
+ // The values currently defined for TQT_METHOD are:
//
- // o X'00' NO AUTHENTICATION REQUIRED
+ // o X'00' NO AUTHENTICATION RETQUIRED
// o X'01' GSSAPI
// o X'02' USERNAME/PASSWORD
// o X'03' CHAP
@@ -908,7 +908,7 @@ void KviIrcSocket::proxySendTargetDataV5()
kvi_memmove((void *)(bufToSend + 5),
(void *)(m_pIrcServer->hostName().utf8().data()),
m_pIrcServer->hostName().utf8().length());
- Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port());
+ TQ_UINT16 port = (TQ_UINT16)htons(m_pIrcServer->port());
kvi_memmove((void *)(bufToSend + 4 + 1 + m_pIrcServer->hostName().utf8().length()),(void *)&port,2);
} else if(m_pIrcServer->isIpV6()) {
#ifdef COMPILE_IPV6_SUPPORT
@@ -916,16 +916,16 @@ void KviIrcSocket::proxySendTargetDataV5()
if(!kvi_stringIpToBinaryIp_V6(m_pIrcServer->ip(),&ircInAddr))debug("SOCKET INTERNAL ERROR IN IPV6 ADDR CONVERSION");
kvi_memmove((void *)(bufToSend + 4),(void *)(&ircInAddr),4);
- Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port());
+ TQ_UINT16 port = (TQ_UINT16)htons(m_pIrcServer->port());
kvi_memmove((void *)(bufToSend + 20),(void *)&port,2);
#endif
} else {
struct in_addr ircInAddr;
if(!kvi_stringIpToBinaryIp(m_pIrcServer->ip(),&ircInAddr))debug("SOCKET INTERNAL ERROR IN IPV4 ADDR CONVERSION");
- Q_UINT32 host = (Q_UINT32)ircInAddr.s_addr;
+ TQ_UINT32 host = (TQ_UINT32)ircInAddr.s_addr;
kvi_memmove((void *)(bufToSend + 4),(void *)&host,4);
- Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port());
+ TQ_UINT16 port = (TQ_UINT16)htons(m_pIrcServer->port());
kvi_memmove((void *)(bufToSend + 8),(void *)&port,2);
}
@@ -966,20 +966,20 @@ void KviIrcSocket::proxyHandleV5AuthReply(unsigned char reply)
void KviIrcSocket::proxyHandleV5MethodReply(unsigned char reply)
{
// The server selects from one of the methods given in METHODS, and
- // sends a METHOD selection message:
+ // sends a TQT_METHOD selection message:
//
// +----+--------+
- // |VER | METHOD |
+ // |VER | TQT_METHOD |
// +----+--------+
// | 1 | 1 |
// +----+--------+
//
- // If the selected METHOD is X'FF', none of the methods listed by the
+ // If the selected TQT_METHOD is X'FF', none of the methods listed by the
// client are acceptable, and the client MUST close the connection.
//
- // The values currently defined for METHOD are:
+ // The values currently defined for TQT_METHOD are:
//
- // o X'00' NO AUTHENTICATION REQUIRED
+ // o X'00' NO AUTHENTICATION RETQUIRED
// o X'01' GSSAPI
// o X'02' USERNAME/PASSWORD
// o X'03' CHAP
@@ -1150,7 +1150,7 @@ void KviIrcSocket::proxyHandleHttpFinalReply(const char * buffer,int bufLen)
{
if(idx == tmp.findFirstIdx(' '))
{
- QString msg = __tr2qs("Proxy response: ");
+ TQString msg = __tr2qs("Proxy response: ");
msg += tmp.ptr();
if(_OUTPUT_VERBOSE)
outputProxyMessage(msg);
@@ -1178,8 +1178,8 @@ void KviIrcSocket::proxyHandleHttpFinalReply(const char * buffer,int bufLen)
m_pRsn = 0;
}
- m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read);
- QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readHttpProxyErrorData(int)));
+ m_pRsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Read);
+ TQObject::connect(m_pRsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(readHttpProxyErrorData(int)));
m_pRsn->setEnabled(true);
setState(ProxyHttpError);
@@ -1268,13 +1268,13 @@ void KviIrcSocket::doSSLHandshake(int)
linkUp();
break;
case KviSSL::WantRead:
- m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read);
- QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pRsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Read);
+ TQObject::connect(m_pRsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pRsn->setEnabled(true);
break;
case KviSSL::WantWrite:
- m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write);
- QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pWsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Write);
+ TQObject::connect(m_pWsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pWsn->setEnabled(true);
break;
case KviSSL::RemoteEndClosedConnection:
@@ -1296,8 +1296,8 @@ void KviIrcSocket::doSSLHandshake(int)
raiseError((err ? KviError::translateSystemError(err) : KviError_unknownError));
} else {
// can recover ? (EAGAIN , EINTR ?)
- m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write);
- QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pWsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Write);
+ TQObject::connect(m_pWsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pWsn->setEnabled(true);
return;
}
@@ -1340,8 +1340,8 @@ void KviIrcSocket::linkUp()
m_pRsn = 0;
}
- m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read);
- QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readData(int)));
+ m_pRsn = new TQSocketNotifier((int)m_sock,TQSocketNotifier::Read);
+ TQObject::connect(m_pRsn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(readData(int)));
m_pRsn->setEnabled(true);
// yahoo!
@@ -1505,7 +1505,7 @@ void KviIrcSocket::processData(char * buffer,int)
// handler event that disconnects explicitly)
//
// We handle it by simply returning control to readData() which
- // will return immediately (and safely) control to Qt
+ // will return immediately (and safely) control to TQt
kvi_free(messageBuffer);
m_bInProcessData = false;
return;
@@ -1647,7 +1647,7 @@ void KviIrcSocket::queue_removeAllMessages()
//
// Attempts to send as much as possible to the server
// If fails (happens only on really lagged servers)
-// calls itself with a QTimer shot after KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout) ms
+// calls itself with a TQTimer shot after KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout) ms
// to retry again...
//
void KviIrcSocket::flushSendQueue()
@@ -1800,7 +1800,7 @@ handle_system_error:
//flushed completely ...
}
-bool KviIrcSocket::getLocalHostIp(QString &szIp,bool bIpV6)
+bool KviIrcSocket::getLocalHostIp(TQString &szIp,bool bIpV6)
{
if(m_state != Connected)return false;