diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 85e184ef5..70b2863c8 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -123,6 +123,13 @@ void ssl_locking_function(int mode, int n, char const* file, int line) } } +#if LL_WINDOWS +static unsigned long __cdecl apr_os_thread_current_wrapper() +{ + return (unsigned long)apr_os_thread_current(); +} +#endif + #if HAVE_CRYPTO_THREADID // OpenSSL uniq id function. void ssl_id_function(CRYPTO_THREADID* thread_id) @@ -216,8 +223,12 @@ void ssl_init(void) // Setting this avoids the need for a thread-local error number facility, which is hard to check. #if HAVE_CRYPTO_THREADID CRYPTO_THREADID_set_callback(&ssl_id_function); +#else +#if LL_WINDOWS + CRYPTO_set_id_callback(&apr_os_thread_current_wrapper); #else CRYPTO_set_id_callback(&apr_os_thread_current); +#endif #endif // Dynamic locks callbacks. old_ssl_dyn_create_function = CRYPTO_get_dynlock_create_callback(); @@ -286,7 +297,7 @@ void initCurl(void (*flush_hook)()) llwarns << "libcurl's age is 0; no ares support." << llendl; } llassert_always((version_info->features & CURL_VERSION_SSL)); // SSL support, added in libcurl 7.10. - if (!(version_info->features & CURL_VERSION_ASYNCHDNS)); // Asynchronous name lookups (added in libcurl 7.10.7). + if (!(version_info->features & CURL_VERSION_ASYNCHDNS)) // Asynchronous name lookups (added in libcurl 7.10.7). { llwarns << "libcurl was not compiled with support for asynchronous name lookups!" << llendl; } @@ -1313,8 +1324,8 @@ CurlMultiHandle::~CurlMultiHandle() { curl_multi_cleanup(mMultiHandle); Stats::multi_calls++; - int total = --sTotalMultiHandles; - Dout(dc::curl, "Called CurlMultiHandle::~CurlMultiHandle() [" << (void*)this << "], " << total << " remaining."); + --sTotalMultiHandles; + Dout(dc::curl, "Called CurlMultiHandle::~CurlMultiHandle() [" << (void*)this << "], " << sTotalMultiHandles << " remaining."); } } // namespace AICurlPrivate diff --git a/indra/llmessage/aicurl.h b/indra/llmessage/aicurl.h index ac89fdac3..6ca9f3100 100644 --- a/indra/llmessage/aicurl.h +++ b/indra/llmessage/aicurl.h @@ -233,6 +233,7 @@ typedef AIAccess AICurlEasyRequest_wat; // Events generated by AICurlPrivate::CurlEasyHandle. struct AICurlEasyHandleEvents { + virtual ~AICurlEasyHandleEvents(){} // Events. virtual void added_to_multi_handle(AICurlEasyRequest_wat& curl_easy_request_w) = 0; virtual void finished(AICurlEasyRequest_wat& curl_easy_request_w) = 0; diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index f4632b955..c848d7856 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -32,9 +32,11 @@ #include "aicurlthread.h" #include "lltimer.h" // ms_sleep #include +#if !LL_WINDOWS #include #include #include +#endif #include #undef AICurlPrivate @@ -132,7 +134,7 @@ namespace curlthread { // // mMaxFdSet is the largest filedescriptor in mFdSet or -1 if it is empty. -static size_t const MAXSIZE = std::max(1024, FD_SETSIZE); +static size_t const MAXSIZE = llmax(1024, FD_SETSIZE); // Create an empty PollSet. PollSet::PollSet(void) : mFileDescriptors(new curl_socket_t [MAXSIZE]), @@ -147,10 +149,10 @@ PollSet::PollSet(void) : mFileDescriptors(new curl_socket_t [MAXSIZE]), // Add filedescriptor s to the PollSet. void PollSet::add(curl_socket_t s) { - llassert_always(mNrFds < MAXSIZE); + llassert_always(mNrFds < (int)MAXSIZE); mFileDescriptors[mNrFds++] = s; #if !LL_WINDOWS - mMaxFd = std::max(mMaxFd, s); + mMaxFd = llmax(mMaxFd, s); #endif } @@ -195,7 +197,7 @@ void PollSet::remove(curl_socket_t s) curl_socket_t next = mFileDescriptors[--i]; // next = 'd' mFileDescriptors[i] = cur; // Overwrite 'd' with 'e'. #if !LL_WINDOWS - max = std::max(max, cur); // max is the maximum value in 'i' or higher. + max = llmax(max, cur); // max is the maximum value in 'i' or higher. #endif cur = next; // cur = 'd' // i NrFds = 5 @@ -214,7 +216,7 @@ void PollSet::remove(curl_socket_t s) // i NrFds = 5 // v v // index: 0 1 2 3 4 - // a b c d e // max = std::max('d', 'e') + // a b c d e // max = llmax('d', 'e') // If mNext pointed to an element before s, it should be left alone. Otherwise, if mNext pointed // to s it must now point to 'd', or if it pointed beyond 's' it must be decremented by 1. @@ -228,7 +230,7 @@ void PollSet::remove(curl_socket_t s) while (i > 0) { curl_socket_t next = mFileDescriptors[--i]; - max = std::max(max, next); + max = llmax(max, next); } mMaxFd = max; llassert(mMaxFd < s); @@ -256,7 +258,7 @@ void PollSet::remove(curl_socket_t s) mFileDescriptors[i] = cur; cur = next; } - if (mIter > i) + if (mIter > (unsigned int)i) --mIter; llassert(mIter <= mFdSet.fd_count); } @@ -278,7 +280,7 @@ inline bool PollSet::is_set(curl_socket_t fd) const inline void PollSet::clr(curl_socket_t fd) { - return FD_CLR(fd, &mFdSet); + FD_CLR(fd, &mFdSet); } // This function fills mFdSet with at most FD_SETSIZE - 1 filedescriptors, @@ -312,7 +314,7 @@ refresh_t PollSet::refresh(void) // Calculate mMaxFdSet. // Run over FD_SETSIZE - 1 elements, starting at mNext, wrapping to 0 when we reach the end. int max = -1, i = mNext, count = 0; - while (++count < FD_SETSIZE) { max = std::max(max, mFileDescriptors[i]); if (++i == mNrFds) i = 0; } + while (++count < FD_SETSIZE) { max = llmax(max, mFileDescriptors[i]); if (++i == mNrFds) i = 0; } mMaxFdSet = max; #endif } @@ -587,9 +589,9 @@ AICurlThread::~AICurlThread() // MAIN-THREAD void AICurlThread::create_wakeup_fds(void) { -#ifdef WINDOWS -// Probably need to use sockets here, cause Windows select doesn't work for a pipe. -#error Missing implementation +#if LL_WINDOWS + // Probably need to use sockets here, cause Windows select doesn't work for a pipe. + #error Missing implementation #else int pipefd[2]; if (pipe(pipefd)) @@ -612,10 +614,14 @@ void AICurlThread::create_wakeup_fds(void) // MAIN-THREAD void AICurlThread::cleanup_wakeup_fds(void) { +#if LL_WINDOWS + #error Missing implementation +#else if (mWakeUpFd_in != CURL_SOCKET_BAD) close(mWakeUpFd_in); if (mWakeUpFd != CURL_SOCKET_BAD) close(mWakeUpFd); +#endif } // MAIN-THREAD @@ -632,8 +638,8 @@ void AICurlThread::wakeup_thread(void) return; } -#ifdef WINDOWS -#error Missing implementation +#ifdef LL_WINDOWS + #error Missing implementation #else // If write() is interrupted by a signal before it writes any data, it shall return -1 with errno set to [EINTR]. // If write() is interrupted by a signal after it successfully writes some data, it shall return the number of bytes written. @@ -662,8 +668,8 @@ void AICurlThread::wakeup(AICurlMultiHandle_wat const& multi_handle_w) { DoutEntering(dc::curl, "AICurlThread::wakeup"); -#ifdef WINDOWS -#error Missing implementation +#ifdef LL_WINDOWS + #error Missing implementation #else // If a read() is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR]. // If a read() is interrupted by a signal after it has successfully read some data, it shall return the number of bytes read. @@ -758,9 +764,9 @@ void AICurlThread::run(void) fd_set* write_fd_set = ((wres & empty)) ? NULL : multi_handle_w->mWritePollSet.access(); // Calculate nfds (ignored on windows). #if !LL_WINDOWS - curl_socket_t const max_rfd = std::max(multi_handle_w->mReadPollSet.get_max_fd(), mWakeUpFd); + curl_socket_t const max_rfd = llmax(multi_handle_w->mReadPollSet.get_max_fd(), mWakeUpFd); curl_socket_t const max_wfd = multi_handle_w->mWritePollSet.get_max_fd(); - int nfds = std::max(max_rfd, max_wfd) + 1; + int nfds = llmax(max_rfd, max_wfd) + 1; llassert(0 <= nfds && nfds <= FD_SETSIZE); llassert((max_rfd == -1) == (read_fd_set == NULL) && (max_wfd == -1) == (write_fd_set == NULL)); // Needed on Windows. diff --git a/indra/llmessage/aicurlthread.h b/indra/llmessage/aicurlthread.h index c0f9d03f7..9bbc12c4a 100644 --- a/indra/llmessage/aicurlthread.h +++ b/indra/llmessage/aicurlthread.h @@ -105,7 +105,7 @@ class PollSet std::vector mCopiedFileDescriptors; // Filedescriptors copied by refresh to mFdSet. std::vector::iterator mIter; // Index into mCopiedFileDescriptors for next(); loop variable. #else - int mIter; // Index into fd_set::fd_array. + unsigned int mIter; // Index into fd_set::fd_array. #endif }; diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 1c6e649e4..a93176519 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -16,7 +16,7 @@ --> - Chat: + Chat: - Show links on chatting object names in chat history for: + Show links on chatting object names in chat history for: No object