summaryrefslogtreecommitdiff
path: root/indra/llmessage/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/net.cpp')
-rw-r--r--indra/llmessage/net.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index c8552b3fb4..1c49f9be36 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -77,7 +77,7 @@ const char* LOOPBACK_ADDRESS_STRING = "127.0.0.1";
const char* BROADCAST_ADDRESS_STRING = "255.255.255.255";
#if LL_DARWIN
- // Mac OS X returns an error when trying to set these to 400000. Smaller values succeed.
+ // macOS returns an error when trying to set these to 400000. Smaller values succeed.
const int SEND_BUFFER_SIZE = 200000;
const int RECEIVE_BUFFER_SIZE = 200000;
#else // LL_DARWIN
@@ -338,8 +338,8 @@ S32 receive_packet(int hSocket, char * receiveBuffer)
return nRet;
}
-// Returns TRUE on success.
-BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, int nPort)
+// Returns true on success.
+bool send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, int nPort)
{
// Sends a packet to the address set in initNet
//
@@ -364,7 +364,7 @@ BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, i
// assume it is. JNC 2002.01.18
if (WSAECONNRESET == WSAGetLastError())
{
- return TRUE;
+ return true;
}
LL_INFOS() << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort
<< ", Error " << last_error << LL_ENDL;
@@ -598,11 +598,11 @@ int receive_packet(int hSocket, char * receiveBuffer)
return nRet;
}
-BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, int nPort)
+bool send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, int nPort)
{
int ret;
- BOOL success;
- BOOL resend;
+ bool success;
+ bool resend;
S32 send_attempts = 0;
stDstAddr.sin_addr.s_addr = recipient;
@@ -616,34 +616,34 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (ret >= 0)
{
// successful send
- success = TRUE;
- resend = FALSE;
+ success = true;
+ resend = false;
}
else
{
// send failed, check to see if we should resend
- success = FALSE;
+ success = false;
if (errno == EAGAIN)
{
// say nothing, just repeat send
LL_INFOS() << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << LL_ENDL;
LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
- resend = TRUE;
+ resend = true;
}
else if (errno == ECONNREFUSED)
{
// response to ICMP connection refused message on earlier send
LL_INFOS() << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << LL_ENDL;
LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
- resend = TRUE;
+ resend = true;
}
else
{
// some other error
LL_INFOS() << "sendto() failed: " << errno << ", " << strerror(errno) << LL_ENDL;
LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
- resend = FALSE;
+ resend = false;
}
}
}
@@ -652,7 +652,7 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (send_attempts >= 3)
{
LL_INFOS() << "sendPacket() bailed out of send!" << LL_ENDL;
- return FALSE;
+ return false;
}
return success;