Changeset 6411 for trunk/licq/src/socket.cpp
- Timestamp:
- 07/04/08 03:27:41 (5 months ago)
- Files:
-
- 1 modified
-
trunk/licq/src/socket.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/licq/src/socket.cpp
r6347 r6411 179 179 } 180 180 181 //-----INetSocket::SetOwner---------------------------------------------------182 void INetSocket::SetOwner(unsigned long _nOwner)183 {184 m_nOwner = _nOwner;185 if (_nOwner)186 {187 char szUin[24];188 sprintf(szUin, "%lu", _nOwner);189 m_szOwnerId = strdup(szUin);190 m_nOwnerPPID = LICQ_PPID;191 }192 else193 {194 m_szOwnerId = 0;195 m_nOwnerPPID = 0;196 }197 }198 199 181 void INetSocket::SetOwner(const char *_szOwnerId, unsigned long _nOwnerPPID) 200 182 { 201 183 m_szOwnerId = strdup(_szOwnerId); 202 184 m_nOwnerPPID = _nOwnerPPID; 203 if (m_nOwnerPPID == LICQ_PPID)204 m_nOwner = strtoul(_szOwnerId, (char **)NULL, 10);205 else206 m_nOwner = 0;207 185 } 208 186 … … 266 244 267 245 268 //-----INetSocket::constructor--------------------------------------------------269 INetSocket::INetSocket(unsigned long _nOwner)270 {271 m_nDescriptor = -1;272 SetOwner(_nOwner);273 274 m_nVersion = 0;275 m_nErrorType = SOCK_ERROR_none;276 memset(&m_sRemoteAddr, 0, sizeof(struct sockaddr_in));277 memset(&m_sLocalAddr, 0, sizeof(struct sockaddr_in));278 m_szRemoteName = NULL;279 m_xProxy = NULL;280 m_nChannel = ICQ_CHNxNONE;281 282 // Initialise the mutex283 pthread_mutex_init(&mutex, NULL);284 }285 286 246 INetSocket::INetSocket(const char *_szOwnerId, unsigned long _nOwnerPPID) 287 247 { … … 292 252 m_szOwnerId = 0; 293 253 m_nOwnerPPID = _nOwnerPPID; 294 if (m_nOwnerPPID == LICQ_PPID)295 m_nOwner = strtoul(_szOwnerId, (char **)NULL, 10);296 else297 m_nOwner = 0;298 254 m_nVersion = 0; 299 255 m_nErrorType = SOCK_ERROR_none; … … 638 594 //=====SrvSocket=============================================================== 639 595 640 SrvSocket::SrvSocket(unsigned long _nOwner) : INetSocket(_nOwner)641 {642 strcpy(m_szID, "SRV");643 m_nSockType = SOCK_STREAM;644 }645 646 596 SrvSocket::SrvSocket(const char *s, unsigned long n) : INetSocket(s, n) 647 597 { … … 826 776 return true; 827 777 } 828 778 829 779 //=====TCPSocket=============================================================== 830 TCPSocket::TCPSocket(unsigned long _nOwner) : INetSocket(_nOwner)831 {832 strcpy(m_szID, "TCP");833 m_nSockType = SOCK_STREAM;834 m_p_SSL = NULL;835 }836 837 780 TCPSocket::TCPSocket(const char *s, unsigned long n) : INetSocket(s, n) 838 781 { … … 906 849 m_szOwnerId = 0; 907 850 m_nOwnerPPID = from.m_nOwnerPPID; 908 909 if (m_nOwnerPPID == LICQ_PPID)910 m_nOwner = from.m_nOwner;911 851 912 852 m_nVersion = from.m_nVersion; … … 1376 1316 #endif /*-----End of OpenSSL code------------------------------------------*/ 1377 1317 1378 UDPSocket::UDPSocket(unsigned long _nOwner) : INetSocket(_nOwner) 1318 UDPSocket::UDPSocket(const char* ownerId, unsigned long ownerPpid) 1319 : INetSocket(ownerId, ownerPpid) 1379 1320 { 1380 1321 strcpy(m_szID, "UDP");
