Remove CR from configuration, source and xml files.
This commit is contained in:
@@ -334,14 +334,14 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id,
|
||||
{
|
||||
if (add_to_cache)
|
||||
{
|
||||
// sCache[agent_id] = av_name;
|
||||
// [SL:KB] - Patch: Agent-DisplayNames | Checked: 2010-12-28 (Catznip-2.4.0h) | Added: Catznip-2.4.0h
|
||||
// Don't replace existing entries with dummies
|
||||
cache_t::iterator itName = (av_name.mIsDummy) ? sCache.find(agent_id) : sCache.end();
|
||||
if (sCache.end() != itName)
|
||||
itName->second.mExpires = av_name.mExpires;
|
||||
else
|
||||
sCache[agent_id] = av_name;
|
||||
// sCache[agent_id] = av_name;
|
||||
// [SL:KB] - Patch: Agent-DisplayNames | Checked: 2010-12-28 (Catznip-2.4.0h) | Added: Catznip-2.4.0h
|
||||
// Don't replace existing entries with dummies
|
||||
cache_t::iterator itName = (av_name.mIsDummy) ? sCache.find(agent_id) : sCache.end();
|
||||
if (sCache.end() != itName)
|
||||
itName->second.mExpires = av_name.mExpires;
|
||||
else
|
||||
sCache[agent_id] = av_name;
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
|
||||
@@ -1,149 +1,149 @@
|
||||
// <edit>
|
||||
#include "llnetcanary.h"
|
||||
// <edit>
|
||||
#include "llnetcanary.h"
|
||||
#include "linden_common.h"
|
||||
#include "llerror.h"
|
||||
#ifdef _MSC_VER
|
||||
#include <winsock2.h>
|
||||
static WSADATA trapWSAData;
|
||||
#define socklen_t int
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#if LL_DARWIN
|
||||
#ifndef _SOCKLEN_T
|
||||
#define _SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int errno; //error number
|
||||
#define SOCKADDR_IN struct sockaddr_in
|
||||
#define SOCKADDR struct sockaddr
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET -1
|
||||
#define SOCKET_ERROR -1
|
||||
#define SD_BOTH 2
|
||||
#define closesocket close
|
||||
#endif
|
||||
SOCKADDR_IN trapLclAddr;
|
||||
LLNetCanary::LLNetCanary(int requested_port)
|
||||
{
|
||||
mGood = TRUE;
|
||||
int nRet;
|
||||
int hSocket;
|
||||
int snd_size = 400000;
|
||||
int rec_size = 400000;
|
||||
int buff_size = 4;
|
||||
#ifdef _MSC_VER
|
||||
if(WSAStartup(0x0202, &trapWSAData))
|
||||
{
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
llwarns << "WSAStartup() failure: " << err << llendl;
|
||||
mGood = FALSE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// Get a datagram socket
|
||||
hSocket = (int)socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (hSocket == INVALID_SOCKET)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "socket() failure: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Name the socket (assign the local port number to receive on)
|
||||
trapLclAddr.sin_family = AF_INET;
|
||||
trapLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
trapLclAddr.sin_port = htons(requested_port);
|
||||
//llinfos << "bind() port: " << requested_port << llendl;
|
||||
nRet = bind(hSocket, (struct sockaddr*) &trapLclAddr, sizeof(trapLclAddr));
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "bind() failed: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find out what address we got
|
||||
SOCKADDR_IN socket_address;
|
||||
socklen_t socket_address_size = sizeof(socket_address);
|
||||
getsockname(hSocket, (SOCKADDR*) &socket_address, &socket_address_size);
|
||||
mPort = ntohs(socket_address.sin_port);
|
||||
//llinfos << "got port " << mPort << llendl;
|
||||
|
||||
// Set socket to be non-blocking
|
||||
#ifdef _MSC_VER
|
||||
unsigned long argp = 1;
|
||||
nRet = ioctlsocket (hSocket, FIONBIO, &argp);
|
||||
#else
|
||||
nRet = fcntl(hSocket, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "Failed to set socket non-blocking, Err: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// set a large receive buffer
|
||||
nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size);
|
||||
if (nRet)
|
||||
{
|
||||
llinfos << "Can't set receive buffer size!" << llendl;
|
||||
}
|
||||
// set a large send buffer
|
||||
nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size);
|
||||
if (nRet)
|
||||
{
|
||||
llinfos << "Can't set send buffer size!" << llendl;
|
||||
}
|
||||
//getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size);
|
||||
//getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size);
|
||||
//LL_DEBUGS("AppInit") << "startNet - receive buffer size : " << rec_size << LL_ENDL;
|
||||
//LL_DEBUGS("AppInit") << "startNet - send buffer size : " << snd_size << LL_ENDL;
|
||||
|
||||
mSocket = hSocket;
|
||||
}
|
||||
LLNetCanary::~LLNetCanary()
|
||||
{
|
||||
if(mGood)
|
||||
{
|
||||
if(mSocket)
|
||||
{
|
||||
shutdown(mSocket, SD_BOTH);
|
||||
closesocket(mSocket);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
WSACleanup();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// </edit>
|
||||
#include "llerror.h"
|
||||
#ifdef _MSC_VER
|
||||
#include <winsock2.h>
|
||||
static WSADATA trapWSAData;
|
||||
#define socklen_t int
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#if LL_DARWIN
|
||||
#ifndef _SOCKLEN_T
|
||||
#define _SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int errno; //error number
|
||||
#define SOCKADDR_IN struct sockaddr_in
|
||||
#define SOCKADDR struct sockaddr
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET -1
|
||||
#define SOCKET_ERROR -1
|
||||
#define SD_BOTH 2
|
||||
#define closesocket close
|
||||
#endif
|
||||
SOCKADDR_IN trapLclAddr;
|
||||
LLNetCanary::LLNetCanary(int requested_port)
|
||||
{
|
||||
mGood = TRUE;
|
||||
int nRet;
|
||||
int hSocket;
|
||||
int snd_size = 400000;
|
||||
int rec_size = 400000;
|
||||
int buff_size = 4;
|
||||
#ifdef _MSC_VER
|
||||
if(WSAStartup(0x0202, &trapWSAData))
|
||||
{
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
llwarns << "WSAStartup() failure: " << err << llendl;
|
||||
mGood = FALSE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// Get a datagram socket
|
||||
hSocket = (int)socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (hSocket == INVALID_SOCKET)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "socket() failure: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Name the socket (assign the local port number to receive on)
|
||||
trapLclAddr.sin_family = AF_INET;
|
||||
trapLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
trapLclAddr.sin_port = htons(requested_port);
|
||||
//llinfos << "bind() port: " << requested_port << llendl;
|
||||
nRet = bind(hSocket, (struct sockaddr*) &trapLclAddr, sizeof(trapLclAddr));
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "bind() failed: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find out what address we got
|
||||
SOCKADDR_IN socket_address;
|
||||
socklen_t socket_address_size = sizeof(socket_address);
|
||||
getsockname(hSocket, (SOCKADDR*) &socket_address, &socket_address_size);
|
||||
mPort = ntohs(socket_address.sin_port);
|
||||
//llinfos << "got port " << mPort << llendl;
|
||||
|
||||
// Set socket to be non-blocking
|
||||
#ifdef _MSC_VER
|
||||
unsigned long argp = 1;
|
||||
nRet = ioctlsocket (hSocket, FIONBIO, &argp);
|
||||
#else
|
||||
nRet = fcntl(hSocket, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
S32 err = WSAGetLastError();
|
||||
WSACleanup();
|
||||
#else
|
||||
S32 err = errno;
|
||||
#endif
|
||||
mGood = FALSE;
|
||||
llwarns << "Failed to set socket non-blocking, Err: " << err << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// set a large receive buffer
|
||||
nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size);
|
||||
if (nRet)
|
||||
{
|
||||
llinfos << "Can't set receive buffer size!" << llendl;
|
||||
}
|
||||
// set a large send buffer
|
||||
nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size);
|
||||
if (nRet)
|
||||
{
|
||||
llinfos << "Can't set send buffer size!" << llendl;
|
||||
}
|
||||
//getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size);
|
||||
//getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size);
|
||||
//LL_DEBUGS("AppInit") << "startNet - receive buffer size : " << rec_size << LL_ENDL;
|
||||
//LL_DEBUGS("AppInit") << "startNet - send buffer size : " << snd_size << LL_ENDL;
|
||||
|
||||
mSocket = hSocket;
|
||||
}
|
||||
LLNetCanary::~LLNetCanary()
|
||||
{
|
||||
if(mGood)
|
||||
{
|
||||
if(mSocket)
|
||||
{
|
||||
shutdown(mSocket, SD_BOTH);
|
||||
closesocket(mSocket);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
WSACleanup();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// </edit>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
// <edit>
|
||||
#ifndef LL_LLNETCANARY_H
|
||||
#define LL_LLNETCANARY_H
|
||||
#include "stdtypes.h"
|
||||
#include <string>
|
||||
class LLNetCanary
|
||||
{
|
||||
public:
|
||||
LLNetCanary(int requested_port);
|
||||
~LLNetCanary();
|
||||
BOOL mGood;
|
||||
S32 mSocket;
|
||||
U16 mPort;
|
||||
U8 mBuffer[8192];
|
||||
typedef struct
|
||||
{
|
||||
F64 time; // LLTimer::getElapsedSeconds();
|
||||
//U8 message[4];
|
||||
U32 message;
|
||||
U32 points;
|
||||
std::string name;
|
||||
} entry;
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
// <edit>
|
||||
#ifndef LL_LLNETCANARY_H
|
||||
#define LL_LLNETCANARY_H
|
||||
#include "stdtypes.h"
|
||||
#include <string>
|
||||
class LLNetCanary
|
||||
{
|
||||
public:
|
||||
LLNetCanary(int requested_port);
|
||||
~LLNetCanary();
|
||||
BOOL mGood;
|
||||
S32 mSocket;
|
||||
U16 mPort;
|
||||
U8 mBuffer[8192];
|
||||
typedef struct
|
||||
{
|
||||
F64 time; // LLTimer::getElapsedSeconds();
|
||||
//U8 message[4];
|
||||
U32 message;
|
||||
U32 points;
|
||||
std::string name;
|
||||
} entry;
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
|
||||
Reference in New Issue
Block a user