summaryrefslogtreecommitdiff
path: root/indra/llmessage/lliosocket.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-07-23 19:21:30 +0000
committerDave Houlton <euclid@lindenlab.com>2020-07-23 19:21:30 +0000
commit6fbf39f9b319106e39f80b8641acaba122d02e0a (patch)
treee47af1ff1bd1db52fd93c11d857b11387bacf01a /indra/llmessage/lliosocket.cpp
parent05200cf827d9a6263adc4905bf41a4905bce2659 (diff)
parent64a9ad0f5f52dac633a76e39335a7def2573b82e (diff)
Merged in lmr4-merge-6.4.6 (pull request #213)
Merge master v6.4.6 into DRTVWR-497 (VS2017)
Diffstat (limited to 'indra/llmessage/lliosocket.cpp')
-rw-r--r--indra/llmessage/lliosocket.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp
index 7caf0766b7..a9cc71c365 100644
--- a/indra/llmessage/lliosocket.cpp
+++ b/indra/llmessage/lliosocket.cpp
@@ -62,9 +62,9 @@ bool is_addr_in_use(apr_status_t status)
#endif
}
-#if LL_LINUX
+#if ! LL_WINDOWS
// Define this to see the actual file descriptors being tossed around.
-//#define LL_DEBUG_SOCKET_FILE_DESCRIPTORS 1
+#define LL_DEBUG_SOCKET_FILE_DESCRIPTORS 1
#if LL_DEBUG_SOCKET_FILE_DESCRIPTORS
#include "apr_portable.h"
#endif
@@ -77,7 +77,7 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock)
#if LL_DEBUG_SOCKET_FILE_DESCRIPTORS
if(!apr_sock)
{
- LL_DEBUGS() << "Socket -- " << (msg?msg:"") << ": no socket." << LL_ENDL;
+ LL_DEBUGS("Socket") << "Socket -- " << (msg?msg:"") << ": no socket." << LL_ENDL;
return;
}
// *TODO: Why doesn't this work?
@@ -85,12 +85,12 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock)
int os_sock;
if(APR_SUCCESS == apr_os_sock_get(&os_sock, apr_sock))
{
- LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " on fd " << os_sock
+ LL_DEBUGS("Socket") << "Socket -- " << (msg?msg:"") << " on fd " << os_sock
<< " at " << apr_sock << LL_ENDL;
}
else
{
- LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " no fd "
+ LL_DEBUGS("Socket") << "Socket -- " << (msg?msg:"") << " no fd "
<< " at " << apr_sock << LL_ENDL;
}
#endif
@@ -144,6 +144,9 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port, const c
if(new_pool) apr_pool_destroy(new_pool);
return rv;
}
+ // At this point, the new LLSocket instance takes ownership of new_pool,
+ // which is why no early return below this call explicitly destroys it: it
+ // is instead cleaned up by ~LLSocket().
rv = ptr_t(new LLSocket(socket, new_pool));
if(port > 0)
{
@@ -186,7 +189,7 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port, const c
}
}
}
- else
+ else // port <= 0
{
// we need to indicate that we have an ephemeral port if the
// previous calls were successful. It will