Commit Graph
100 Commits
Author SHA1 Message Date
James Turner 93226fc500 Change location used for path tests
Jenkins seems to dislike non-Latin-1 characters inside the build
tree on Linux, so use a location inside /tmp instead.
2016-07-15 17:57:32 +01:00
James Turner 31ba9dfa70 Further SGPath API usage cleanups. 2016-07-15 16:33:52 +01:00
James Turner 19df18fefb Use wide-string APIs on Windows.
SGPath and simgear::Dir use ‘w’ versions of POSIX APIs on Windows,
and convert UTF-8 SGPath to wide-strings as part of this.

Includes improved unit-tests for this code, with some very basic
tests of creating and iterating files with Unicode characters in
their names.

No user-visible changes should result from this, on any platform; in
particular wide-string support is still incomplete so FlightGear will
not yet work with arbitrary Unicode paths on Windows.
2016-07-15 09:50:44 +01:00
James Turner a5a4bf6d41 Another HLA/SGPath fix 2016-07-04 09:31:34 +01:00
James Turner 9812315d96 realpath returns a path, not a string. 2016-07-04 09:04:46 +01:00
James Turner c40044feeb Fix HLAFederate for readXML API change 2016-07-04 07:20:23 +01:00
James Turner a636da6959 SGPath in easyXML API 2016-07-03 23:41:07 +01:00
James Turner ca84d2046a Fix sg_gzofstream path type (now SGPath) 2016-07-03 23:05:42 +01:00
James Turner c037a0e461 Windows string conversion for SGPath 2016-07-03 22:56:04 +01:00
James Turner cf18d4eaaf SGPath can convert to std::wstring 2016-07-02 09:34:27 +01:00
James Turner 32735428bb More SGPath APIs 2016-07-01 17:14:34 +01:00
James Turner b862cf7e54 Fix repository test. 2016-07-01 09:02:52 +01:00
James Turner f21eac8473 Building with clean SGPath API 2016-06-30 16:17:52 +01:00
James Turner 38c8931950 Fix debug runtime assert 2016-06-29 16:26:42 +01:00
James Turner cfe1c0933f Further SG stream APIs 2016-06-27 12:29:23 -05:00
James Turner a3b3280123 iostream overloads taking an SGPath 2016-06-25 16:30:24 +01:00
James Turner 8cfe5a2e08 Native SGPath API on SGInterpTable
- string-based version will be removed in the future.
2016-06-23 15:21:26 +01:00
James Turner bd896096cc Changing SGPath APIs, using SGPath in more places.
Change most places we control (i.e not helper libs) to use SGPath
to represent a path, instead of using std::string. Extend SGPath
API to explicitly expose the path in either UTF-8 or the
system 8-bit encoding.
2016-06-22 17:15:32 +01:00
James Turner 855ff5a8b0 Fix Linux compilation of untar.hxx 2016-06-16 04:46:37 -05:00
James Turner e695505e62 Tests for un-tar code. 2016-06-15 22:27:01 +01:00
James Turner f824cf85a4 Fix Untar namespacing. 2016-06-14 15:13:58 +01:00
James Turner fb8b60b6fe Export untar header
Needed for scenery installation helper.
2016-06-14 15:12:20 +01:00
James Turner 516d76d41b VS215 tweaks, warning fixes 2016-06-09 20:38:01 +01:00
James Turner daa10503e6 Fixes to Windows console interaction.
Thanks To Jasin Colegrove for helping me understand the issues here!
2016-06-09 15:11:44 +01:00
James Turner c762dbe864 Fix dependency on ‘version’ file. 2016-06-09 11:03:35 +01:00
James Turner 37c551bae7 Fix for HTTP/curl waiting on update
This improves responsiveness of TerraSync with small files and general
throughout dramatically.
2016-06-08 15:43:59 +01:00
James Turner 0ccf3e1629 Threadsafe terrasync state updates/reading. 2016-06-08 15:27:47 +01:00
James Turner 5ba9004853 More repository test tweaks for Jenkins. 2016-06-07 11:24:01 +01:00
James Turner cb80af0ebe Improving channel lifetime in HTTP-based tests.
Previously, closed channels were not cleaned up, which looks to be
the caused of the test failures on Jenkins.
2016-06-06 17:26:50 +01:00
James Turner 1492de4391 Fix a leak / potential crash 2016-06-06 11:36:47 +01:00
James Turner fad905e7e0 Increase test timeout value.
- investigating failing tests on Jenkins
2016-06-03 15:26:48 +01:00
James Turner fb1b1b9c5e Fix uninitialized var 2016-06-03 08:44:25 -05:00
James Turner b7b304ecfb Fix a warning with GCC 2016-06-03 08:40:55 -05:00
James Turner 8690e4617f CMake tweaks for MSVC detection 2016-06-03 12:19:21 +01:00
James Turner a6bed69d19 Fix user-after-free in HTTP repo code 2016-06-02 23:53:15 +01:00
James Turner 100e327684 More permissive catalog version checks
- support wildcard prefixes on FlightGear versions
- drop catalog version equality check
2016-06-01 22:46:17 +01:00
James Turner 729c9e3faa More VS2015 fixes 2016-06-01 22:36:36 +01:00
James Turner be4ebddb60 Fix for VS2015 compilation 2016-05-31 13:41:28 +01:00
James Turner 34e804b784 Fix VS2015 compilation 2016-05-31 13:40:32 +01:00
James Turner 75b2ef9372 Fix VS2015 compilation 2016-05-31 13:40:00 +01:00
James Turner 1ae9e74539 More libCurl version guards. 2016-05-30 13:02:25 +01:00
James Turner 980ae3115c Whitespace fixes. 2016-05-30 13:02:24 +01:00
James Turner 5ca9a06273 FreeBSD fixes from Ganael LAPLANCHE 2016-05-30 13:02:24 +01:00
James Turner 1b0289b11f HTTP: Always use absolute paths for hashes
Ensure we only compute / retrieve hashes for absolute paths. Fixes
duplicate paths in repository hash cache.
2016-05-26 23:36:03 +01:00
James Turner 00f4248137 Partial update support for HTTP repos.
Not used yet, we set full-update mode on repositories for the
moment. Pending Terrasync change will enable partial mode.
2016-05-26 23:35:11 +01:00
James Turner 8211f1c482 Allow updating a Catalog URL explicitly.
Needed for fallback Catalog URL support.
2016-05-26 17:38:02 +01:00
James Turner 43ebde9914 Expose pending count from terrasync
Total and expose HTTP pending download value as a new
property under terrasync-root.
2016-05-26 17:38:02 +01:00
James Turner 7d59dd977f AbstractRepository interface removed. 2016-05-26 17:38:02 +01:00
James Turner 3e2f37418a Remove SVN sync code. 2016-05-26 17:38:02 +01:00
James Turner 9d2df12ab8 Remove old terraysnc backend methods.
Only in-process HTTP access is supported now, SVN and rsync
and removed. This is to allow changes for better use of the
HTTP API.
2016-05-26 17:38:02 +01:00
James Turner 49bd96c55d Guard usage of CURLMOPT_MAX_TOTAL_CONNECTIONS
Check the Curl patch version to avoid breaking on older
sustems.
2016-05-25 20:08:40 +01:00
James Turner 5fdc756a64 Fix missing <cstdint> on non-Mac 2016-05-24 08:16:40 +01:00
James Turner 871b418242 Initial Tar package support.
Needs proper testing, but basic unit-test passes.
2016-05-23 22:23:16 +01:00
James Turner 6285a409ed Fix a crash with mismatch package versions. 2016-05-18 19:02:41 +01:00
James Turner 9818a123ca Fix removal of directories. 2016-05-18 10:50:57 +01:00
James Turner 9dda5a4e31 Fix platform check for strerror_r on Mac 2016-05-10 20:47:25 +02:00
James Turner 616826ab69 Remove non-CURL HTTP option. 2016-05-07 10:11:40 +01:00
James Turner 6e4da15a58 Use SGBinaryFile in a couple more places.
Most importantly, when computing a hash from the on-disk
state.
2016-05-07 10:03:48 +01:00
James Turner 1fe8931129 Packages: fix extract dir cleanup on success.
Don’t leave extract_xxxxxxx dirs in the Aircraft tree after successfully
extract the contents to the final location.
2016-05-04 22:22:34 +01:00
James Turner d39b055ed1 Avoid unlink of an open file.
Works on Unix, not so great on Windows it turns out. Thanks to Jasin
and Geoff for figuring this out in the end.
2016-05-04 22:13:15 +01:00
James Turner 46ed4b2f79 Catalog refresh / package updating test. 2016-04-20 11:58:35 +02:00
James Turner 8582676100 Catalog removal test
- verifies installed packages are removed also.
2016-04-19 13:56:07 +02:00
James Turner 32181a3956 Expand package-system unit-tests.
More to come, but this covers the absolute basics now.
2016-04-19 13:50:37 +02:00
James Turner c17324b5ea Fixes for HTTP cancellation.
(Forgot to stage these from previous commit)
2016-04-14 09:42:04 +01:00
James Turner a3f1bb546f HTTP request cancellation
- replaces abort() with something more structured.
2016-04-14 09:16:36 +01:00
James Turner 177c5ec709 Guard against disabling a not-yet-active catalog. 2016-03-30 17:09:51 +01:00
James Turner 2e1f01a86a Use ref-ptr in canvas adapter getImage
Adjusted while investigating missing tooltip texture with recent
OSG versions.
2016-03-26 19:55:37 +00:00
James Turner 27baafab0d Packages: handle catalog versions better
When a catalog version is stale, disable it but don’t remove it,
and still try to refresh it. This should give much better behaviour
when the FG version changes, should behave as users expect.
2016-03-25 23:04:45 +00:00
James Turner 8ddcef9142 Fix HTTP unit-test 2016-03-25 13:28:24 +00:00
James Turner aa679ffb86 HTTP terra sync: fix hash cache handling
Avoids very long pauses blocking the terrasync thread, while existing
file trees are verified.

Also split the request queue so we don’t submit vary large numbers of
requests from a single repository, and hence block other repositories
from getting traffic.
2016-03-24 19:15:20 +00:00
James Turner 4fdcfb8623 HTTP/curl - pick up sleep value 2016-03-24 18:41:30 +00:00
James Turner c199c95218 Expose total bytes to download / remaining
For HTTP repositories, support some additional metrics about ongoing
transfers. Not currently exposed via properties / TerraSync API, but
will be shortly.
2016-03-22 21:14:17 +00:00
James Turner 3f9b6d632e HTTP/curl - transfer byte metric work
Should fix the missing download rate feedback on the splash screen
and terra sync dialog.
2016-03-22 21:13:22 +00:00
James Turner 714a6ac47d Disable HTTP pipelining if the connection closes.
Don’t keep attempting to pipeline if the next server sets Close on
its response, since this just generates needless overhead.
2016-03-22 20:06:22 +00:00
James Turner 2438dd8a08 Disable persistent TerraSync cache for HTTP
- since the root-level request for an HTTP repo is small, and static,
  it doesn’t make sense to use the same persistent cache, especially
  for initial testing.
2016-03-05 09:53:37 +00:00
James Turner 49146f41e3 Expose more pipelining controls on HTTP code
- used for both implementations, restrict default pipeline depth to
  5 instead of 32 which was perhaps a little ambitious for some
  servers.
2016-03-01 12:44:22 +00:00
James Turner 8009a33b26 Fix attempt to remove missing files. 2016-03-01 12:35:08 +00:00
James Turner b8d07cc460 Fixes for error handling in NetChannel
- return the correct errno value instead of using -1
2016-03-01 12:34:56 +00:00
James Turner 43dacf5951 HTTP repository testing tool. 2016-02-27 06:35:41 +02:00
James Turner 8adbefb2b7 Fix Windows compile of HTTP repo tests. 2016-02-26 21:21:00 +02:00
James Turner 4eb272f4f0 Lots of work on HTTP repository failure handling. 2016-02-26 21:18:26 +02:00
James Turner f84dac822a Fix a nasty bug in non-libCurl HTTP pipelining.
- when requests were closely overlapped, but not submitted at the
  same time, connection state could get corrupted.
2016-02-26 00:10:34 +02:00
James Turner 0b4f416ddc More error reporting from TerraSync/HTTP
- raise more errors when requests fail, and report/catch these.
2016-02-25 21:20:33 +02:00
James Turner 6cef1f9091 Fix compilation with older versions of libCurl. 2016-02-25 21:19:44 +02:00
James Turner 5c9f5361bd Fix for libCurl pipelining and connection count. 2016-02-24 23:36:25 +02:00
James Turner 4fb205b317 Work around lack of endian.h on Windows 2016-02-22 23:53:27 +02:00
James Turner 624dae5958 Fix a typo breaking HTTP unit-test. 2016-02-22 23:41:13 +02:00
James Turner d4384422f4 HTTP repository: replace an assert.
- Torsten is seeing this on his setup.
2016-02-22 21:27:03 +02:00
James Turner 935d649096 More HTTP repository compile tweaks. 2016-02-22 21:07:16 +02:00
James Turner 2b147f7429 Use SGFile to avoid Windows breakage. 2016-02-22 20:59:03 +02:00
James Turner dda922a651 Hopefully fix Linux compilation. 2016-02-22 18:05:02 +02:00
James Turner d179fccfcb Optionally use HTTP repository.
- disabled by default since needs much testing.
2016-02-21 21:49:20 +02:00
James Turner ae4d96872d HTTP repository implementation
A plain-HTTP terrasync repository implementation, using the
SimGear HTTP abstraction. File validity is based on SHA hashes,
and existing files are not re-downloaded if their hash matches,
so soft upgrade from an SVN checkout is possible.
2016-02-21 21:49:20 +02:00
James Turner 7075a8707b Create TerraSync repo API
- create an abstract API for a remote repository, based on the current
  SVN repository API, and update the code accordingly.
2016-02-21 15:49:12 +01:00
James Turner 41f40a9a10 Fix misnamed macro.
- should fix TerraSync user-agent.
2016-02-08 09:37:35 +00:00
James Turner af0a51930e CMake: don’t export build to build tree
- only export targets to the install tree, since this is
  hopefully compatible with CMake 2.8
2016-02-02 18:33:20 +00:00
James Turner ccb5d05eb4 Fix headless build for CMake export 2016-01-30 14:29:12 +00:00
James Turner 9d7402242a Work on CMake export of targets. 2016-01-29 23:15:07 +00:00
James Turner 819833a560 VS2013 compile fixes.
- mostly about return type conversions.
2016-01-27 14:02:27 +00:00
James Turner b60f8b4989 New log class for terrasync 2016-01-16 15:49:58 -06:00