summaryrefslogtreecommitdiff
path: root/indra/llmessage/lliosocket.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-11 20:41:46 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-11 20:41:46 +0300
commitdde268cf852144eb641babf975a5905ca2c96a74 (patch)
tree6896b6ce31c25175adbf0b3131149c469d2093e0 /indra/llmessage/lliosocket.cpp
parente1a3ce0d7465fd1c441168b0fcf5b849f47bab4e (diff)
parent89cde15fb8c52071805af78e61848e743f2ab2f1 (diff)
Merge branch 'master' into DRTVWR-483
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