summaryrefslogtreecommitdiff
path: root/indra/llmessage/net.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-08-09 17:11:19 -0700
committerRichard Linden <none@none>2013-08-09 17:11:19 -0700
commite340009fc59d59e59b2e8d903a884acb76b178eb (patch)
tree6c42d6e0031ef1dbe841fd05cd5d62d5b6b48525 /indra/llmessage/net.cpp
parent8d3daa141e9ea14f533559843d77ab5c0f715421 (diff)
second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
Diffstat (limited to 'indra/llmessage/net.cpp')
-rwxr-xr-xindra/llmessage/net.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index 1c9508214c..523bcbb60d 100755
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -173,7 +173,7 @@ U32 ip_string_to_u32(const char* ip_string)
if (ip == INADDR_NONE
&& strncmp(ip_string, BROADCAST_ADDRESS_STRING, MAXADDRSTR) != 0)
{
- llwarns << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << llendl;
+ LL_WARNS() << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << LL_ENDL;
return INVALID_HOST_IP_ADDRESS;
}
return ip;
@@ -332,7 +332,7 @@ S32 receive_packet(int hSocket, char * receiveBuffer)
return 0;
if (WSAECONNRESET == WSAGetLastError())
return 0;
- llinfos << "receivePacket() failed, Error: " << WSAGetLastError() << llendl;
+ LL_INFOS() << "receivePacket() failed, Error: " << WSAGetLastError() << LL_ENDL;
}
return nRet;
@@ -366,8 +366,8 @@ BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, i
{
return TRUE;
}
- llinfos << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort
- << ", Error " << last_error << llendl;
+ LL_INFOS() << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort
+ << ", Error " << last_error << LL_ENDL;
}
}
} while ( (nRet == SOCKET_ERROR)
@@ -395,7 +395,7 @@ S32 start_net(S32& socket_out, int& nPort)
hSocket = socket(AF_INET, SOCK_DGRAM, 0);
if (hSocket < 0)
{
- llwarns << "socket() failed" << llendl;
+ LL_WARNS() << "socket() failed" << LL_ENDL;
return 1;
}
@@ -406,21 +406,21 @@ S32 start_net(S32& socket_out, int& nPort)
stLclAddr.sin_family = AF_INET;
stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
stLclAddr.sin_port = htons(0);
- llinfos << "attempting to connect on OS assigned port" << llendl;
+ LL_INFOS() << "attempting to connect on OS assigned port" << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (nRet < 0)
{
- llwarns << "Failed to bind on an OS assigned port error: "
- << nRet << llendl;
+ LL_WARNS() << "Failed to bind on an OS assigned port error: "
+ << nRet << LL_ENDL;
}
else
{
sockaddr_in socket_info;
socklen_t len = sizeof(sockaddr_in);
int err = getsockname(hSocket, (sockaddr*)&socket_info, &len);
- llinfos << "Get socket returned: " << err << " length " << len << llendl;
+ LL_INFOS() << "Get socket returned: " << err << " length " << len << LL_ENDL;
nPort = ntohs(socket_info.sin_port);
- llinfos << "Assigned port: " << nPort << llendl;
+ LL_INFOS() << "Assigned port: " << nPort << LL_ENDL;
}
}
@@ -431,7 +431,7 @@ S32 start_net(S32& socket_out, int& nPort)
stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
stLclAddr.sin_port = htons(nPort);
U32 attempt_port = nPort;
- llinfos << "attempting to connect on port " << attempt_port << llendl;
+ LL_INFOS() << "attempting to connect on port " << attempt_port << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (nRet < 0)
@@ -445,7 +445,7 @@ S32 start_net(S32& socket_out, int& nPort)
attempt_port++)
{
stLclAddr.sin_port = htons(attempt_port);
- llinfos << "trying port " << attempt_port << llendl;
+ LL_INFOS() << "trying port " << attempt_port << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (!((nRet < 0) && (errno == EADDRINUSE)))
{
@@ -454,7 +454,7 @@ S32 start_net(S32& socket_out, int& nPort)
}
if (nRet < 0)
{
- llwarns << "startNet() : Couldn't find available network port." << llendl;
+ LL_WARNS() << "startNet() : Couldn't find available network port." << LL_ENDL;
// Fail gracefully in release.
return 3;
}
@@ -462,12 +462,12 @@ S32 start_net(S32& socket_out, int& nPort)
// Some other socket error
else
{
- llwarns << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << llendl;
+ LL_WARNS() << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << LL_ENDL;
// Fail gracefully in release.
return 4;
}
}
- llinfos << "connected on port " << attempt_port << llendl;
+ LL_INFOS() << "connected on port " << attempt_port << LL_ENDL;
nPort = attempt_port;
}
// Set socket to be non-blocking
@@ -476,18 +476,18 @@ S32 start_net(S32& socket_out, int& nPort)
nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size);
if (nRet)
{
- llinfos << "Can't set receive size!" << llendl;
+ LL_INFOS() << "Can't set receive size!" << LL_ENDL;
}
nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size);
if (nRet)
{
- llinfos << "Can't set send size!" << llendl;
+ LL_INFOS() << "Can't set send size!" << LL_ENDL;
}
getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size);
getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size);
- llinfos << "startNet - receive buffer size : " << rec_size << llendl;
- llinfos << "startNet - send buffer size : " << snd_size << llendl;
+ LL_INFOS() << "startNet - receive buffer size : " << rec_size << LL_ENDL;
+ LL_INFOS() << "startNet - send buffer size : " << snd_size << LL_ENDL;
#if LL_LINUX
// Turn on recipient address tracking
@@ -495,11 +495,11 @@ S32 start_net(S32& socket_out, int& nPort)
int use_pktinfo = 1;
if( setsockopt( hSocket, SOL_IP, IP_PKTINFO, &use_pktinfo, sizeof(use_pktinfo) ) == -1 )
{
- llwarns << "No IP_PKTINFO available" << llendl;
+ LL_WARNS() << "No IP_PKTINFO available" << LL_ENDL;
}
else
{
- llinfos << "IP_PKKTINFO enabled" << llendl;
+ LL_INFOS() << "IP_PKKTINFO enabled" << LL_ENDL;
}
}
#endif
@@ -593,7 +593,7 @@ int receive_packet(int hSocket, char * receiveBuffer)
}
// Uncomment for testing if/when implementing for Mac or Windows:
- // llinfos << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << llendl;
+ // LL_INFOS() << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << LL_ENDL;
return nRet;
}
@@ -627,22 +627,22 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (errno == EAGAIN)
{
// say nothing, just repeat send
- llinfos << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = TRUE;
}
else if (errno == ECONNREFUSED)
{
// response to ICMP connection refused message on earlier send
- llinfos << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = TRUE;
}
else
{
// some other error
- llinfos << "sendto() failed: " << errno << ", " << strerror(errno) << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() failed: " << errno << ", " << strerror(errno) << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = FALSE;
}
}
@@ -651,7 +651,7 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (send_attempts >= 3)
{
- llinfos << "sendPacket() bailed out of send!" << llendl;
+ LL_INFOS() << "sendPacket() bailed out of send!" << LL_ENDL;
return FALSE;
}