Commit Graph

3154 Commits

Author SHA1 Message Date
Aleric Inglewood
f7626699da Bug fix: (correctly) revoke CurlResponderBuffer events. 2012-10-21 17:28:22 +02:00
Aleric Inglewood
a4bf92dae4 Add CURLcode and TransferInfo to completed_headers event. 2012-10-20 23:56:19 +02:00
Aleric Inglewood
1e745ba48b Curl work in progress.
Minor changes like comment fixes and addition of accessors
that will be needed for future commits.
Also removed Responder::fatalError as it was never used.
2012-10-20 23:52:34 +02:00
Aleric Inglewood
f8273e977e Make NoVerifySSLCert work for all LLURLRequest
Moved CURLOPT_ENCODING from CurlEasyRequest::setPost_raw, and
CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST from
CurlResponderBuffer::prepRequest, to LLURLRequest::configure,
enabling the debug setting NoVerifySSLCert for the latter
two to work as follows: old behavior if "NoVerifySSLCert"
is not set, and check neither if it is set. However, if
the (new) bool mIsAuth is set the behavior of LLXMLRPCTransaction::Impl::init
is used. This is so in a next commit we can replace
LLXMLRPCTransaction with LLURLRequest: LLXMLRPCTransaction::Impl::init
will be removed. For the same reason, when the new boolean
mNoCompression is set then CURLOPT_ENCODING is set to "identity",
otherwise the old behavior (of clearing it) is used.
2012-10-20 23:28:33 +02:00
Aleric Inglewood
605843b527 HTTP status of 400 is an error too. 2012-10-20 21:47:31 +02:00
Aleric Inglewood
8ba127d4c5 HTTPTimeout work in progress
* Avoid using CurlEasyRequest::mTimeout for HTTPTime::done and
  HTTPTime::print_diagnostics when it might be NULL.
* Comment fixes.
* Indentation fix.
2012-10-15 21:07:17 +02:00
Aleric Inglewood
bb8ea493d6 Fix top check in MultiHandle::check_run_count.
This check isn't really needed at all, since curl_multi_info_read
is fast enough, but well... The old check was flawed anyway.
2012-10-15 21:03:08 +02:00
Aleric Inglewood
02cffa9a71 Replace TimeOut with Timeout everywhere. 2012-10-15 21:01:16 +02:00
Aleric Inglewood
76fc30e460 HTTPTimeout work in progress.
* Moved DoutCurlEasy and DoutCurlEasyEntering from aicurl.cpp
  to aicurl.h and renamed them to DoutCurl and DoutCurlEntering
  respectively.
* Moved the callback functions from aicurl.cpp to aicurlthread.cpp.
* In CurlEasyRequest, renamed timeout_timings to print_curl_timings
  and mTimeoutLowercaseHostname to mLowercaseHostname.
* Put all remaining CurlEasyRequest::mTimeout* variables and
  timeout_* methods in curlthread::HTTPTimeout, stripping them
  of said prefix, and moved the definition to aicurlprivate.h.
  Added a ThreadSafeCurlEasyRequest* member and a get_lockobj()
  method so to that class so we can still use DoutCurl /
  DoutCurlEntering. timeout_add_easy_request was removed completely
  and reimplemented as the constructor of HTTPTimeout.
  timeout_has_stalled was renamed to HTTPTimeout::has_stalled,
  but also reimplemented as CurlEasyRequest::has_stalled.
* CurlEasyRequest::mRequestFinalized was removed and it's
  functionality taken over by CurlEasyRequest::mTimeoutPolicy.
* Fixed the indentation of struct Stats, class CurlEasyHandle
  and class CurlEasyRequest.
* Added CurlEasyRequest::set_timeout_opts
* Added CurlSocketInfo::mTimeout (LLPointer<HTTPTimeout>).
* mUploadFinished is now reset in HTTPTimeout::data_received,
  this was needed because "HEAD /something" header-only
  messages triggered upload_finished (unlike "GET ..."),
  and in combination with redirection that caused an assert.
2012-10-15 03:34:32 +02:00
Aleric Inglewood
9fba54ad5d On failed transfer, print CURLINFO_OS_ERRNO when available. 2012-10-14 03:13:32 +02:00
Aleric Inglewood
ccd98c3c3d Fix comment. 2012-10-14 02:55:45 +02:00
Aleric Inglewood
2539e41e59 Avoid problems in case a host also resolves to IPv6 2012-10-14 02:53:36 +02:00
Aleric Inglewood
83312fbb74 Allow getinfo() to be called on a const CurlEasyRequest. 2012-10-14 02:45:58 +02:00
Aleric Inglewood
3ac46f5fa7 HTTP timeout work in progress. 2012-10-12 19:39:11 +02:00
Aleric Inglewood
faee255730 HTTP timeout bug fix! Plus work in progress.
Use the better understandable alias CURLOPT_HTTPHEADER in debug output

Bug fix - finally!

This fixes a bug I've been looking for a week.
By accidently calling get_clock_count() for the mTimeoutLowSpeedClock
'event', the time difference 'now' - 'event' becomes negative, which
should be impossible; the result being that timeout_low_speed
stalled for 24 seconds while looping over the full 32 bit. That in
turn made SSL handshakes of libcurl fail, which seemed to be
impossible since the calls to libcurl had not changed!
2012-10-12 04:50:46 +02:00
Aleric Inglewood
02ead94848 HTTP timeout work in progress.
More debug output.
Avoid the new assert when exiting the viewer.
2012-10-08 19:14:22 +02:00
Aleric Inglewood
6a4f76a219 Bug fix for previous commit. 2012-10-08 05:00:11 +02:00
Aleric Inglewood
1252b0bde2 HTTP timeout work in progress.
* Remove progress meter call back, use read/write/header callbacks instead.
* Don't use timeout_lowspeed for ReplyDelay, instead use:
* Add timeout stuff to the main loop (CurlEasyRequest::mTimeoutStalled).

This patch fixes a few things compared to the previous version.
More things need to be fixed.
2012-10-08 02:19:32 +02:00
Aleric Inglewood
a40fbf0da1 Cache hostname of url in CurlEasyRequest::mTimeoutLowercaseHostname
Also add DoutCurlEasyEntering debug macro.
The caching is necessary because CURLINFO_EFFECTIVE_URL is unreliable
and can change several times during the transfer at any moment (as
a result of forwarding etc).
2012-10-06 01:21:33 +02:00
Aleric Inglewood
468f52a4f6 Merge branch 'master' into curlthreading3 2012-10-05 16:55:28 +02:00
Aleric Inglewood
3f1fb9a66e Add improved timeout handling for HTTP transactions.
Introduces AIHTTPTimeoutPolicy objects which do not just
specify a single "timeout" in seconds, but a plethora of
timings related to the life cycle of the average HTTP
transaction.

This knowledge is that moved to the Responder being
used instead of floating constants hardcoded in the
callers of http requests. This assumes that the same
timeout policy is wanted for each transaction that
uses the same Responder, which can be enforced is needed.

I added a AIHTTPTimeoutPolicy for EVERY responder,
only to make it easier later to tune timeout values
and/or to get feedback about which responder runs
into HTTP errors in debug output (especially time outs),
so that they can be tuned later. If we already understood
exactly what we were doing then most responders could
have been left alone and just return the default timeout
policy: by far most timeout policies are just a copy
of the default policy, currently.

This commit is not finished... It's a work in progress
(viewer runs fine with it though).
2012-10-05 15:53:29 +02:00
Aleric Inglewood
8430328043 Add support for uploading JP2 files.
Recognizes .jp2, .j2c and .j2k extensions.
Adds image/jp2 files to file picker image filter (windows and Mac,
windows apparently already showed them).
Show preview for jpeg 2000 files.
Fixes error reporting for failed image uploads.
Enforces a power-of-two size for jpeg 2000 files (seemed to make sense to do that).
2012-09-29 17:47:15 +02:00
Aleric Inglewood
2766f17cb9 Merge remote-tracking branch 'github/master' into curlthreading3 2012-09-24 17:52:46 +02:00
Aleric Inglewood
70c36716c9 Disable SSL/TLS session caching.
Fixes: VWR-28039, VWR-28629
2012-09-24 17:05:23 +02: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
3e22553d7e Merge remote-tracking branch 'github/master' into curlthreading3 2012-09-23 17:40:07 +02:00
Aleric Inglewood
4744839a08 Bug fix for curl request queue of last commit.
In debug mode an assertion was triggered when a queued
request was being removed by the main thread; and rightfully
so: we should remove such request from the queue in that
case.
2012-09-23 17:31:41 +02:00
Aleric Inglewood
a7cf09883e Merge branch 'master' into curlthreading3 2012-09-22 01:26:37 +02:00
Aleric Inglewood
1254a7bbe2 Merge remote-tracking branch 'github/master' into curlthreading3
Conflicts:
	indra/aistatemachine/aistatemachine.cpp
2012-09-22 01:25:54 +02:00
Aleric Inglewood
fb5ec1d1f5 Implement curl connection throttling (CurlConcurrentConnections) 2012-09-21 19:26:40 +02:00
Aleric Inglewood
5bcb350d89 Always print '(CURL*)' in front of CURL*'s in debug output. 2012-09-21 01:48:21 +02:00
Aleric Inglewood
81bc6b49f8 Debug code bug fix; removal of CurlEasyHandle::getErrorString()
CurlEasyHandle::mErrorBuffer (CURLOPT_ERRORBUFFER) can NOT be
used to retrieve information about an error returned by
curl_multi_info_read in CURLMsg::data::result. This buffer is
only initialized when a curl_easy_* call returns an error,
and those errors are already printed automagically.

Initialize the buffer with an empty string upon invokation
of an curl_easy_* call, so we are sure the error belongs to
the last call.
2012-09-21 01:28:26 +02:00
Aleric Inglewood
f3780998ed Always reset stream state after using std::hex 2012-09-20 16:50:03 +02:00
Aleric Inglewood
27090c541f Remove inconsistent dll linkage (missing LL_COMMON_API) 2012-09-20 05:36:11 +02:00
Aleric Inglewood
ef73469700 Merge remote-tracking branch 'singu/master'
Abandonning curlthreading2 -- which is now in master.
2012-09-20 05:17:56 +02:00
Aleric Inglewood
2d12a82a54 Always flush LLBufferStream objects. 2012-09-20 04:49:43 +02:00
Aleric Inglewood
c5d9dc4732 Bug fix 2012-09-20 04:48:03 +02:00
Siana Gearz
b7f5d7e415 Windows build fixes 2012-09-20 01:37:40 +02:00
Siana Gearz
8df7a52cf7 Merge branch 'curlthreading2' of git://github.com/AlericInglewood/SingularityViewer
Conflicts:
	indra/llplugin/slplugin/CMakeLists.txt
2012-09-19 23:30:48 +02:00
Aleric Inglewood
56f2f0b727 Merge branch 'curlthreading2' into curlthreading3 2012-09-19 04:14:25 +02:00
Aleric Inglewood
19f325aa09 Merge remote-tracking branch 'singu/master' into curlthreading2
Conflicts:
	indra/llcommon/CMakeLists.txt

Resolved with kdiff3 automatically.
2012-09-19 04:11:16 +02:00
Aleric Inglewood
1d5a63c180 Fixed showing TOS floater.
This creates a separate events interface structure
for CurlResponderBuffer (AICurlResponderBufferEvents)
for dealing with received HTTP headers.

The headers are passed to the Responder, but only
if the class derived from Responder implements
completedHeaders (otherwise it makes little sense
to even decode the headers).

Basically this is a reimplementation of the functionality
of the old LLHTTPClientURLAdaptor class.
2012-09-18 23:59:09 +02:00
Aleric Inglewood
c67f010302 Pass filename by reference when possible. 2012-09-18 05:01:34 +02:00
Siana Gearz
44b2392a10 Version 1.7.2 1.7.2 2012-09-15 21:33:09 +02:00
Siana Gearz
855540b5c5 Have i beaten you now, evil extortionists? 2012-09-15 21:31:33 +02:00
Siana Gearz
a7b9b0da42 Version 1.7.2 2012-09-15 21:17:16 +02:00
Siana Gearz
5f8eac9dc8 Have i beaten you now, evil extortionists? 2012-09-15 21:15:59 +02:00
Siana Gearz
b0ea103c61 Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer 2012-09-15 17:05:50 +02:00
Siana Gearz
65781e6080 Make label 'Multiple' click through in texture selector 2012-09-15 08:36:38 +02:00
Siana Gearz
fc0149cdbc Fix the Unlink button 2012-09-15 08:16:35 +02:00