diff options
Diffstat (limited to 'indra/llmessage/lliosocket.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/llmessage/lliosocket.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index d5b4d45821..2043bae5e7 100644..100755 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -33,7 +33,6 @@ #include "llbuffer.h" #include "llhost.h" -#include "llmemtype.h" #include "llpumpio.h" // @@ -100,7 +99,6 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) // static LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); LLSocket::ptr_t rv; apr_socket_t* socket = NULL; apr_pool_t* new_pool = NULL; @@ -198,7 +196,6 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) // static LLSocket::ptr_t LLSocket::create(apr_socket_t* socket, apr_pool_t* pool) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); LLSocket::ptr_t rv; if(!socket) { @@ -240,12 +237,10 @@ LLSocket::LLSocket(apr_socket_t* socket, apr_pool_t* pool) : mPort(PORT_INVALID) { ll_debug_socket("Constructing wholely formed socket", mSocket); - LLMemType m1(LLMemType::MTYPE_IO_TCP); } LLSocket::~LLSocket() { - LLMemType m1(LLMemType::MTYPE_IO_TCP); // *FIX: clean up memory we are holding. if(mSocket) { @@ -265,7 +260,6 @@ LLSocket::~LLSocket() void LLSocket::setBlocking(S32 timeout) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); // set up the socket options ll_apr_warn_status(apr_socket_timeout_set(mSocket, timeout)); ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_NONBLOCK, 0)); @@ -276,7 +270,6 @@ void LLSocket::setBlocking(S32 timeout) void LLSocket::setNonBlocking() { - LLMemType m1(LLMemType::MTYPE_IO_TCP); // set up the socket options ll_apr_warn_status(apr_socket_timeout_set(mSocket, 0)); ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_NONBLOCK, 1)); @@ -293,12 +286,10 @@ LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) : mSource(socket), mInitialized(false) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); } LLIOSocketReader::~LLIOSocketReader() { - LLMemType m1(LLMemType::MTYPE_IO_TCP); //lldebugs << "Destroying LLIOSocketReader" << llendl; } @@ -314,7 +305,6 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( { LLFastTimer t(FTM_PROCESS_SOCKET_READER); PUMP_DEBUG; - LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!mSource) return STATUS_PRECONDITION_NOT_MET; if(!mInitialized) { @@ -396,12 +386,10 @@ LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) : mLastWritten(NULL), mInitialized(false) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); } LLIOSocketWriter::~LLIOSocketWriter() { - LLMemType m1(LLMemType::MTYPE_IO_TCP); //lldebugs << "Destroying LLIOSocketWriter" << llendl; } @@ -416,7 +404,6 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( { LLFastTimer t(FTM_PROCESS_SOCKET_WRITER); PUMP_DEBUG; - LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!mDestination) return STATUS_PRECONDITION_NOT_MET; if(!mInitialized) { @@ -550,12 +537,10 @@ LLIOServerSocket::LLIOServerSocket( mInitialized(false), mResponseTimeout(DEFAULT_CHAIN_EXPIRY_SECS) { - LLMemType m1(LLMemType::MTYPE_IO_TCP); } LLIOServerSocket::~LLIOServerSocket() { - LLMemType m1(LLMemType::MTYPE_IO_TCP); //lldebugs << "Destroying LLIOServerSocket" << llendl; } @@ -575,7 +560,6 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( { LLFastTimer t(FTM_PROCESS_SERVER_SOCKET); PUMP_DEBUG; - LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!pump) { llwarns << "Need a pump for server socket." << llendl; @@ -608,6 +592,15 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( PUMP_DEBUG; apr_pool_t* new_pool = NULL; apr_status_t status = apr_pool_create(&new_pool, mPool); + if(ll_apr_warn_status(status)) + { + if(new_pool) + { + apr_pool_destroy(new_pool); + } + return STATUS_ERROR; + } + apr_socket_t* socket = NULL; status = apr_socket_accept( &socket, |