It was very confusing that only *after* a call to a libcurl function
it was written to debug output that it was called.
Now it prints it before calling it, and when that leads to additional
debug output while inside the function, it prints that before giving
the return value.
For example:
0x7f529ea15700 CURLTR : curl_multi_socket_action((CURLM*)0x7f528c002920, CURL_SOCKET_TIMEOUT, 0, <unfinished>
0x7f529ea15700 CURLIO 0xea8ef30 * About to connect() to login.agni.lindenlab.com port 443 (#0)
0x7f529ea15700 CURLIO 0xea8ef30 * Trying 216.82.16.97...
0x7f529ea15700 CURLIO 0xea8ef30 * 0xe3240e0 is at send pipe head!
0x7f529ea15700 CURLIO 0xea8ef30 * STATE: CONNECT => WAITCONNECT handle 0x7f528c001df0; (connection #0)
0x7f529ea15700 CURLTR : curl_easy_getinfo((CURL*)0xe3240e0, CURLINFO_PRIVATE, 0x7f529ea13db0) = CURLE_OK
0x7f529ea15700 CURL : Entering MultiHandle::socket_callback((CURL*)0xe3240e0, 36, CURL_POLL_OUT, 0x7f528c001508, 0) [CURLINFO_PRIVATE = 0xea8ef30]
0x7f529ea15700 CURLTR : curl_easy_getinfo((CURL*)0xe3240e0, CURLINFO_PRIVATE, 0x7f529ea13d58) = CURLE_OK
0x7f529ea15700 CURLTR : curl_multi_assign((CURLM*)0x7f528c002920, 36, 0x7f528c031680) = 0
0x7f529ea15700 CURL : CurlSocketInfo::set_action(CURL_POLL_NONE --> CURL_POLL_OUT) [0xea8ef30]
0x7f529ea15700 CURL : MultiHandle::timer_callback(): timeout set to 1 ms.
0x7f529ea15700 CURLTR : <continued> {1}) = 0
Unfortunately, this breaks defining DEBUG_CURLIO without using libcwd,
but that was unusable already anyway (even though it compiled).
We may need to trick the friends list into refreshing when someone is muted to complete this feature...
probably need mutelist callbacks if those exist
It happened because we filtered mFromName which started out as from_name, and inconsistently used the two after that...
This change switches to just using mFromName after that point..
SV-1226 #close Fixed it~
On (very) slow machines this might improve the experience.
This only has effect on Second Life, since that's currently the only
grid that uses https for capabilities (all of them, except GetMesh,
GetMesh2 and GetTexture).
When linking the viewer with libmemleak, which significantly slows
down calls to malloc (and calloc, realloc, new, memalign and so on)
and free (delete), I no longer could download my inventory.
With this patch this was solved. The reason was that completing
the SSL/TLS handshake took more than 10 seconds (15 to 20).
Since that fakes the libcwd macros, this is needed to compile
the recent change that allows to only turn on debugging output
for certain statemachine objects when DEBUG_CURLIO is defined,
but libcwd is not used (CWDEBUG is undefined).
Before, when anything but the exact correct Login URI was entered, the
user would either get no error, or a pop up saying "Cannot retrieve grid
info from server."
With this patch, that pop up includes what went wrong and stresses that
they check if they entered the correct Login URI and where to find it.
I was motivated to write this after looking at crash report 8405 where
a user who had downloaded Singularity for the very first time crashed
twice when entering things like "aviworlds" and " aviworlds.com:8002"
(not the space), and "http:aviworlds.com:8002" (missing '//').
Especially in the light of FS accepting Login URI without the 'http://',
a lot of grid websites (like that of aviworlds) might instruct users
to enter the url without http://. Ie, this user was told to enter
just "aviworlds.com:8002", and when that failed was instructed to
add 'http' in front of it...
Now the code accepts also really WEIRD things, but will never mess
up a good entry. For example, if you enter "pssshht:aviworlds.com:8002"
then that will work, as a side effect. The real objective however is
of course to let things work like: "aviworlds.com:8002 ",
"http:aviworlds.com:8002", " http:/aviworlds.com:8002", and to give
a usable error message when there is a typo in the hostname (Cannot
resolve hostname) or they forget to add a port number (404, or
connection refused), plus the text "Make sure you entered the correct
Login URI. An example of a Login URI is: \"http://cool.grid.com:8002/\",
this url can usually be found on the website of the grid."
Blocking http requests (code using responders derived from
BlockingResponder) *do* call getRaw() and getLLSD to get the body of
server error messages. It is therefore perfectly ok if mStatus !=
HTTP_OK.
This fixes at least one case (crash report 8407), which comes
down to not cleanly informing a responder of failure when the
request url is empty (or so badly formed that it isn't a valid
url). As a result, the statemachine would abort() without
informing the responder - which is bad, sort of.
The previous cases where the responder needed to be informed
of a failure, namely "statemachine timed_out()" and "bad_socket()"
when a socket suddenly becomes bad for unknown reason, have been
replaced with the more general 'aborted()' function, which must
be called before the statemachine calls abort(). Clearly this
has been done for all cases of abort() now, so that if the
llerrs fires again in the future then that would have to be
after the statemachine calls finish(), which is still as "impossible"
as it was - hence the llerrs is still there to make sure.
The reason that this seldom happened on SL, and more often on
opensim, even more often on home-brew test grids, seems plausible:
malformed urls happen more in those cases.
I also took the opportunity to improve the robustness of cases
where the curl error code is checked: it makes no sense to check
what curl gives as error code when an internal error occurred.