Commit Graph

33 Commits

Author SHA1 Message Date
Aleric Inglewood
9db6bc0557 Add AIStateMachine::mSMDebug
The patch is exclusively libcwd related.

Turns off output from statemachines to dc::statemachine by default.
Allows to turn on the debug output on a per statemachine basis (at
compile time).
2013-10-15 22:29:52 +02:00
Aleric Inglewood
1754b97e5c Need to export BackTrace::S_Number to use BACKTRACE. 2013-06-17 17:28:42 +02:00
Aleric Inglewood
c6c343a45b Compile bug fixes when -DDEBUG_CURLIO 2013-02-12 23:44:55 +01:00
Aleric Inglewood
b1892eb238 DoutEntering was hiding variable 'on' 2013-02-11 20:08:58 +01:00
Aleric Inglewood
2a177c6614 Fix for libcwd configured with --disable-location 2013-02-10 18:18:50 +01:00
Aleric Inglewood
136e6dd389 New debug channel dc::snapshot. 2013-01-09 00:54:53 +01:00
Aleric Inglewood
fac3fc67b6 Add filtering for curl debug output.
Add CURLTR debug channel for libcurl API calls,
and use CURLIO only for libcurl debug output.
Note: need to set gDebugCurlTerse to true for
filtering to take effect, then pass 'debug_on'
to the LLHttpClient methods that require debugging.
2012-12-24 02:54:36 +01:00
Aleric Inglewood
48702b1ed9 Various stuff
Comment fixes
Added some more debug support, not used yet (linux/libcwd only),
I used it, but won't commit the code that did.
Pass time_time parameter from post2() to prepRequest; only
used by mesh uploading at the moment.
2012-09-24 16:55:34 +02:00
Aleric Inglewood
484fff444f Compile fix for OSX 2012-08-31 05:23:20 +02:00
Aleric Inglewood
263a25fb87 Compile fix for DEBUG_CURLIO 2012-08-12 17:42:30 +02:00
Aleric Inglewood
164799e4c4 Curl debug output improvements and minor fixes. 2012-08-12 03:33:33 +02:00
Aleric Inglewood
8e1bbfe938 Amend last commit 2012-08-11 03:29:46 +02:00
Aleric Inglewood
3469d65f95 Windows compile and linker fixes.
* Do not include aithreadid.h from debug.h, because the latter is
  included everywhere (from linden_common.h) and aithreadid.h is
  heavy (includes among others windows.h).
* On windows, thread local members cannot be exported.
2012-08-11 03:23:31 +02:00
Aleric Inglewood
ffb55f482a Compile fixes for windows. 2012-08-10 05:35:11 +02:00
Aleric Inglewood
b9673df961 Clean up of debug.h: just use LL_COMMON_API. 2012-08-09 06:57:53 +02:00
Aleric Inglewood
37c8ea54eb Add AIThreadID - Cleanup of apr_os_thread* related code.
Apart from just really cleaning things up and moving
everything into one class regarding thread IDs (ie,
is_main_thread(), comparing ID's etc), this also
fixes an obscure bug where LL was casting thread ID's
to U32 and then compared those to find out if it
the same thread. It's theoretically possible that
such fails on a 64bit OS.

By generalizing the interface, I adopted the use
of a thread-local cache for the current thread ID
as used by LLMutex et al, so now all code benefits
from that. The idea was even extended to now also
be used for is_main_thread() tests and even resetting
a thread ID to the ID of the current thread.
2012-08-09 06:30:31 +02:00
Aleric Inglewood
5caeccc007 Final compile/link bug fixes for debug_libcurl code.
renamed cwdebug/debug_libcurl.cc -> llmessage/debug_libcurl.cpp
    and cwdebug/debug_libcurl.h  -> llmessage/debug_libcurl.h,
because debug_libcurl.cpp does curl calls that do ares and
openssl calls, so we need to link with those libraries.
llmessage is already linking with those libraries, and contains
the main entry point aicurl.h, so it's a suitable place to put
this.

Bug fix: must always include llpreprocessor.h before including
curl/curl.h.

Bug fix: Added #include "debug_libcurl.h" to hipporestrequest.cpp
and llurlsimstring.cpp which I missed before because they
included "curl/curl.h" instead of <curl/curl.h>. Same in
llwaterparammanager.cpp, but removed include there because it
isn't needed.

Now test DEBUG_CURLIO before including debug_curlio, that
seems better, because otherwise it would make more sense to
replace all #include <curl/curl.h> with #include "mycurl.h"
and then do it there-- but I didn't want to do that.

Bug fix: we undef-ed CURLOPT_DNS_USE_GLOBAL_CACHE, while really
that is an enum, not a macro.

Fixed DEBUG_WINDOWS_CODE_ON_LINUX again by adding a hack for
ioctlsocket(), not instantiating dumb_socketpair unless
DEBUG_WINDOWS_CODE_ON_LINUX is defined and removing again ^M's
introduced with the new windows non-blocking code.
Also changed the type of flags passed to fcntl to int (was long).
2012-08-07 20:57:39 +02:00
Aleric Inglewood
93416e40a4 Compile fix: CURLOPT_SSL_OPTIONS was also added since 7.25.0 2012-08-07 05:16:59 +02:00
Aleric Inglewood
e14be5c8c2 Make debug_libcurl.cc compile with libcurl 7.21 and higher 2012-08-07 01:33:29 +02:00
Aleric Inglewood
caef97ad36 Print all libcurl calls if -DDEBUG_CURLIO. Don't create static lib for cwdebug.
Basically, cmake doesn't support linking static libs into a shared lib.
The correct way is to just specify source files in subdirectories
directly as source files of the shared library. This patch changes that.

Also, after this commit, when DEBUG_CURLIO is defined, every call to
libcurl is printed to llinfos (or to dc::curl when using libcwd).
2012-08-05 18:51:21 +02:00
Aleric Inglewood
725cdc2d69 Linux compile fixes 2012-07-31 23:04:45 +02:00
Siana Gearz
048c57cf0c Linktime fix 2012-07-31 22:40:20 +02:00
Siana Gearz
9c4f22d85b Attempt at fixing linker errors... 2012-07-31 21:30:05 +02:00
Siana Gearz
7f64668e55 Compile warning fix 2012-07-31 21:29:22 +02:00
Siana Gearz
0208942b84 Compile warning fix 2012-07-31 21:28:37 +02:00
Siana Gearz
783e86990c Compile fixes 2012-07-31 19:42:15 +02:00
Aleric Inglewood
c9715c5b0b Print Dout() and DoutEntering() debug output on windows.
This is a bit of a hack currently and requires a
recompile with -DDEBUG_CURLIO.
2012-07-31 04:57:13 +02:00
Aleric Inglewood
df20f918ba New libcwd channel 'curlio'.
Enable printing of libcurl 'IO' debug messages when libcwd channel
'curlio' is turned on (added to .libcwdrc). Avoiding a recompile.
2012-07-05 03:10:16 +02:00
Aleric Inglewood
69ca6cd5b2 WIP: Make curl thread code robust and flexible.
Conflicts:

	indra/llmessage/llcurl.cpp
	indra/llmessage/llcurl.h
	indra/newview/app_settings/settings.xml
	indra/newview/llappviewer.cpp
	indra/newview/llmeshrepository.cpp

Resolved:

	indra/llmessage/llcurl.cpp:

	  Basically removed (not used anyway)

	indra/llmessage/llcurl.h:

	  Basically removed (just includes aiculr.h now)

	indra/newview/app_settings/settings.xml:

	  CurlUseMultipleThreads was remvoved.
	  CurlMaximumNumberOfHandles and CurlRequestTimeOut
	  are still in there, but unused at the moment.

	indra/newview/llappviewer.cpp:

	  CurlMaximumNumberOfHandles and CurlRequestTimeOut
	  are unused at the moment.

	indra/newview/llmeshrepository.cpp:

	  Lock mSignal always (is unlocked inside wait()).
	  Use mSignal lock to see if we are waiting; remove mWaiting.
	  Return false from the MeshFetch functions iff we have to retry
	  a HTTP fetch. Catch the error exception thrown by getByteRange
	  instead of using it's return value (always returns true
	  anyway).
2012-06-28 01:30:46 +02:00
Aleric Inglewood
f05343dec1 New libcwd debug channel CAPS. 2012-02-16 02:30:14 +01:00
Aleric Inglewood
addb7a559e Generalize how -fPIC is added, even in cwdebug.
Although the file is empty when not compiling with CWDEBUG,
windows doesn't like the -fPIC there.
2011-05-16 23:49:03 +02:00
Aleric Inglewood
f6b57d956d Added base class AIStateMachine.
This is the skeleton needed to implement classes that can be reused and
work together, which can perform asynchronous tasks (read: need to wait
for certain events before they can continue).

An example would be the task of waiting for a given inventory folder to
be read. This could then be used to improve the builtin AO
(automatically reading that folder when a notecard is dropped, and
continuing when the whole folder is read).

It's first use will be communication with a filepicker that runs
in a plugin.
2011-05-08 17:08:48 +02:00
Aleric Inglewood
474acdbff9 Add support for libcwd.
This patch has no influence if you don't have libcwd installed.
Note that libcwd (http://libcwd.sourceforge.net/) is only
available for linux.

A default compile of libcwd does memory allocation tracking,
which is too slow for everyday usage of the viewer (usable,
but notably slower) and we don't need that. Configure your
libcwd as follows:

./configure --prefix=/sl/usr --disable-alloc --enable-optimize

Or whatever prefix you prefer (add --enable-maintainer-mode
if you're compiling it from the SVN repository), add
--disable-nonthreading to compile twice as fast.

If you have it installed you can activate it's use by setting a
few environment variables:

CXXFLAGS="$(pkg-config --cflags libcwd_r)"
LDFLAGS="$(pkg-config --libs libcwd_r) -lpthread"

and then reconfiguring the viewer.

The -lpthread is needed when using ld.gold, however, if you
leave it out you might get an LDFLAGS that ends on trailing
whitespaces, which doesn't work for some reason.

Also, if you installed it in a non-standard place (/sl/usr
above) then you need this to run the viewer (and tests):

export LD_LIBRARY_PATH="/sl/usr/lib"
2011-05-08 17:08:48 +02:00