Commit Graph

92 Commits (ce5baf14ac62ecd3bf471e1b49a4e166310ebe1a)

Author SHA1 Message Date
Monty Brandenberg 119e9b47f5 SH-4190 Reactivate unit tests neutered under MAINT-3202
HttpStatus unit tests have never caused a unit test failure but
they do have the word 'error' in their text descriptions which
gets picked up by the log processor in TC builds.  So, reactivate
the tests and reform the descriptions.
2013-05-14 16:56:27 -04:00
Monty Brandenberg 8a83408185 MAINT-2302 Tests frequently fail on Windows builds.
I'm calling this the more correct fix.  The httprequest tests
actually talk to an HTTP server running in the Python test
scaffold script.  Under severe CPU competition, it may not
get the cycles needed to start up and make progress.  So this
modifies the test to spin a little faster and dwell waiting
on the server for a longer period.  Hope this will be
adequate to make the tests reliable.
2013-05-14 11:52:12 -04:00
Monty Brandenberg 73f474d886 Merge. Refresh from /lindenlab/viewer-cat prior to pushing. 2013-05-13 18:34:54 -04:00
Monty Brandenberg 81ffd3fcca Whinge reduction effort on the unit tests. Python 2.7 SocketServer
library has new exception-throwing behavior when a client disconnects
unannounced.  Generally ignore exceptions as a result as we don't
care about the server side.  On HTTP trace-mode tests, spin a little
faster and longer to give libcurl time to emit all the junk it wants
to send us.  Should reduce 'reasonable time' failures on tests <12>
and <13>.
2013-05-13 18:32:03 -04:00
simon ee2fce8790 Merge downstream code and viewer-beta 2013-05-09 14:10:45 -07:00
Monty Brandenberg f5e8457e4e BUG-2295/MAINT-2624 unexpected crash around Content-Range: header processing
Not certain what the source of the short data is with one resident but I'm
going to make these problems retryable as they are transport-related.  Lift
the retry detection into a method that should be reusable by others interested
in determining what is retryable.  Trace output handling on the libcurl debug
callback was attrocious.  Some unsafe length handling on my part was protected
by a second layer of defense.  Made that correct and more useful by logging
actual data sizes during trace.
2013-05-06 12:12:05 -04:00
Monty Brandenberg f9850aa5d2 BUG-2295/MAINT-2624 [FIXED] Crash in HttpOpRequest::stageFromActive w/ Content-Range
Don't rely on a response body being present should a
Content-Range header be parsed.  Unit tests captured
the original crash and confirm the fix.
2013-04-29 17:09:13 -04:00
simon 6e483af1f6 Revert ares and libcurl version update that was causing problems, revise curl
handle duplication code.  Reviewed by Kelly
2013-04-25 14:14:35 -07:00
Oz Linden 3bb708d706 merge up to latest viewer-development for merge to 3.5.2 2013-04-19 14:42:56 -04:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Graham Madarasz (Graham) 2dcbbf04c9 Improve curl/ares init behavior by duping handles instead of calling easy_init 2013-02-28 09:45:43 -08:00
Monty Brandenberg 6c3375356e SH-3331 Fix incorrect overrun message when sending body with HTTP
request.  During readcallback, would generate an overrun-type message
about reading position beyond end-of-data.  Mistake was is messaging
when state is exactly at end of data (which is expected) versus an
overrun.  Both result in declaring end-of-data to libcurl.  Also
changed some of the status logging for the metrics payload to be
less chatty on success, more informative on error.
2012-12-21 22:21:58 +00:00
Oz Linden edcdce226a merge changes for DRTVWR-260 2012-12-10 15:33:39 -05:00
Logan Dethrow 7e59b10413 Removed duplicated block of code in LLAddBuildTest.cmake. Added comment to point to duplicated code. Replaced hard-coded tcmalloc link option with variable that is created in GooglePerfTools.cmake. 2012-12-07 19:38:12 -05:00
Nat Goodspeed cc2c426e88 merge changes for BUG-768 2012-12-04 21:10:30 -05:00
Monty Brandenberg 4d65c754d6 Tweak the example program (used as a performance tester) so that it
will run with higher connection concurrencies.  I'm using this to
test the listener queue length reporting on apaches and everything
is consistent and as expected with this change (stuck at eight before).
2012-11-27 18:09:01 +00:00
Monty Brandenberg f175b5a20f BUG-768 Texture fetches hit caps throttle and need more retries.
Bumped the default retry limit up from 5 to 8 which gives up to
15 seconds more dwell time should the viewer get a 503 or other
recoverable error on access.
2012-11-26 16:19:48 -05:00
Nat Goodspeed aaf96507a1 Some Mac header #defines macros like check and equivalent -- gack!!
Given that third-party libraries (such as Boost) can and do use those names,
properly namespace-scoped, it's unpardonable to break any such innocent usage
with a macro. Given the pervasiveness of the need, introduce a header file
with the requisite #undef directives.
2012-11-16 18:08:40 -05:00
Nat Goodspeed 4d1b62f46b Certain test and example programs now need the Boost.System library. 2012-11-16 18:04:07 -05:00
Oz Linden a7f02a3e51 merge changes for 3.5.0-beta2 2013-03-08 10:10:59 -05:00
Oz Linden e8d38f7885 skip some http core tests on Windows because they fail too frequently 2013-01-31 08:42:10 -05:00
Monty Brandenberg 81b9e29a1f DRTVWR-209 Merge of viewer-development with SH-3316 drano-http code.
Cmake files not merged correctly and had to be done by hand.  New memory
allocation made some memory usage tests in the llcorehttp integration
tests no longer valid.  Would like to work on LLLog sometime and get
it to be consistent.  Special flags needed for windows build of example
program.
2012-09-07 18:55:04 -04:00
Monty Brandenberg bf004be102 SH-3308 Beef up retry messaging.
Reformatted messages around request retry.  Successfully retried requests
also message so you can see the cycle closed.  Added additional retryable
error codes (timeout, other libcurl failures).  Commenting and removed some
unnecessary std::min logic.
2012-08-01 12:38:28 -04:00
Monty Brandenberg 052f985e75 Trivial change to tickle build. 2012-07-24 15:21:28 -04:00
Monty Brandenberg 85e69b043b Big comment and naming cleanup. Ready for prime-time.
Add to-do list to _httpinternal.h to guide anyone who
wants to pitch in and help.
2012-07-23 23:40:07 +00:00
Monty Brandenberg 334ce2556f Cleaning up comments, names, miscellany. 2012-07-23 17:00:11 -04:00
Monty Brandenberg 8d3e5f3959 SH-3241 Validate header correctness, SH-3243 more unit tests
Define expectations for headers for GET, POST, PUT requests.
Document those in the interface, test those with integration tests.
Verify that header overrides work as expected.
2012-07-16 17:35:44 -04:00
Monty Brandenberg d238341afa SH-3189 Remove/improve naive data structures
When releasing HTTP waiters, avoid unnecessary sort activity.
For Content-Type in responses, let libcurl do the work and removed
my parsing of headers.  Drop Content-Encoding as libcurl will deal
with that.  If anyone is interested, they can parse.
2012-07-16 11:53:04 -04:00
Monty Brandenberg 5eb5dc6b27 SH-3241 validate that request headers are correct
First round of integration tests.  Added a request header 'reflector'
to the web server to sent the client's headers back with a 'X-Reflect-'
prefix.  Use boost::regex to check various headers.  Run a test on
a simple GET and a byte-ranged GET a la texture fetch.
2012-07-13 18:24:49 -04:00
Monty Brandenberg d45b2e7cae SH-3183 Use valgrind on the library.
Using http_texture_load as the test subject, library looks clean.  Did
some better shutdown in the program itself and it looks better.  Libcurl
itself is making a lot of noise.  Adapted testrunner to run valgrind as
well but the memory allocation tester in the tools themselves grossly
interferes with Valgrind operations.
2012-07-12 17:46:53 +00:00
Monty Brandenberg 7010459f04 SH-3240 Capture Content-Type and Content-Encoding headers.
HttpResponse object now has two strings for these content headers.
Either or both may be empty.  Tidied up the cross-platform string
code and got more defensive about the length of a header line.
Integration test for the new response object.
2012-07-11 15:53:57 -04:00
Monty Brandenberg bc72acbfd2 SH-3244 Syscall avoidance in HttpRequest::update() method
Well, achieved that by doing work in bulk when needed.  But
turned into some additional things.  Change timebase from
mS to uS as, well, things are headed that way.  Implement
an HttpReplyQueue::fetchAll method (advertised one, hadn't
implemented it).
2012-07-10 18:50:21 -04:00
Monty Brandenberg 398d78a773 Rework the 'sleep' logic in the test HTTP server so that the
30-second hang doesn't break subsequent tests.  Did this by
introducing threads into the HTTP server as I can't find the magic
to detect that my client has gone away.
2012-07-09 13:28:50 -04:00
Monty Brandenberg 348db20b92 SH-3187 Issue smarter 'Range' requests for textures.
First, try to issue ranged GETs that are always at least partially
satisfiable.  This will keep Varnish-type caches from simply sending
back 200/full asset responses to unsatisfiable requests.  Implement
awareness of Content-Range headers as well.  Currently they're not
coming back but they will be someday.
2012-07-09 11:47:47 -04:00
Monty Brandenberg f5f51d3cda SH-3185 Fill in some FIXME/TODO cases
Also added some comments and changed the callback userdata argument
to be an HttpOpRequest rather than a libcurl handle.  Less code,
less clutter.
2012-07-07 19:35:32 -04:00
Monty Brandenberg 70e976d1a8 Odd that this was accepted by VS2010. It clearly wasn't right. 2012-07-06 19:17:23 -04:00
Monty Brandenberg d2af82aafc Experiment with ignoring priority in the library. Let upper layers
sort things out or use policy classes (eventually) to arrange low
and high priority traffic.  Subjectively, I think this works better
in practice (as I haven't implemented a dynamic priority setter yet).
2012-07-06 19:14:42 -04:00
Monty Brandenberg f37b90df50 SH-3222 Slow loading textures on Lag Me 1
Think I have found the major factor that causes the Linksys WRT54G V5 to
fall over in testing scenarios:  DNS.  For some historical reason, we're
trying to use libcurl without any DNS caching.  My implementation echoed
that and implemented it correctly and I was seeing a DNS request per request
on the wire.  The existing implementation tries to do that and has bugs
because it is clearing caching DNS data querying only once every few
seconds.  Once I started emulating the bug, comms through the WRT became
much, much more reliable.
2012-07-06 18:09:17 -04:00
Monty Brandenberg adce38800a Example program needs to set Accept: header to talk to Caps router. 2012-07-04 23:30:58 -04:00
Monty Brandenberg e38a676c08 Add CURLE_SEND_ERROR and CURLE_RECV_ERROR to the set of retryable errors.
Data problems after connections are established should be retried as well.
Extend to appropriate libcurl codes.  Also allow our connectivity to drop
to as low as a single connection when trying to recover.
2012-07-03 19:22:24 -04:00
Monty Brandenberg 2d7b7de203 More integration work for texture fetch timeouts.
The fetch state machine received a new timeout during the WAIT_HTTP_REQ
state.  For the integration, rather than jump the state to done, we issue
a request cancel and let the notification plumbing do the rest without
any race conditions or special-case logic.
2012-07-03 13:06:46 -04:00
Monty Brandenberg 8e5197a71b Merge 3.3.3 release with Drano HTTP library at 3.3.0
Big delta was converting the new texture debugger support code
to the new library.  Viewer manifest should probably get an eyeball
before release.
2012-07-02 18:06:22 -04:00
Monty Brandenberg e8b0088d1a SH-3184/SH-3221 More work on cleanup with better unit test work and more aggressive shutdown of a thread.
Some additional work let me enable a memory check for the clean shutdown case and
generally do a better job on other interfaces.  Request queue waiters now awake
on shutdown and don't sleep once the queue is turned off.  Much better semantically
for how this will be used.
2012-06-26 12:28:58 -04:00
Monty Brandenberg e172ec84fa SH-3184/SH-3221 Improve cleanup, destructor, thread termination, etc. logic in library.
With this commit, the cleanup paths should be production quality.  Unit tests have been
expanded to include cases requiring thread termination and cleanup by the worker thread.
Special operation/request added to support the unit tests.  Thread interface expanded
to include a very aggressive cancel() method that does not do cleanup but prevents the
thread from accessing objects that will be destroyed.
2012-06-23 23:33:50 -04:00
Monty Brandenberg bc7d5b24d1 This sets down the groundwork for dynamic policy classes.
Groundwork is used for the default class which currently represents
texture fetching.  Class options implemented from API user into
HttpLibcurl.  Policy layer is going to start doing some traffic
shaping like work to solve problems with consumer-grade gear.
Need to have dynamic aspects to policies and that starts now...
2012-06-22 19:13:50 -04:00
Monty Brandenberg 5ff1758b63 SH-3177, SH-3180 std::iostream and LLSD serialization for BufferArray objects.
Seems to be working correctly.  Not certain this is the fastest possible way
to provide a std::streambuf interface but it's visually acceptable.
2012-06-22 14:41:08 -04:00
Monty Brandenberg ed55eec8e3 Always another platform build fix. Mac this time. 2012-06-22 12:44:54 -04:00
Monty Brandenberg ed5db30654 Preparing for better shutdown/cleanup logic. 2012-06-21 21:32:33 -04:00
Monty Brandenberg eed28348f2 Compiler warning fix on linux. 2012-06-21 20:02:24 -04:00
Monty Brandenberg 4da93b6ad9 SH-3177 Add streambuf/iostream adapters to BufferArray object.
Initial version that should have enough of the plumbing to produce
a working adapter.  Memory test is showing 8 bytes held after one
of the tests so I'm going to revisit that later.  But basic
functionality is there going by the unit tests.
2012-06-21 19:45:40 -04:00