Compare commits

...

2588 Commits

Author SHA1 Message Date
Vinnie Falco
4f9dba22c7 Set version to 0.29.1-rc1 2015-09-25 16:21:44 -07:00
Vinnie Falco
97e1a7db25 Merge branch 'release' into develop 2015-09-25 16:21:16 -07:00
JoelKatz
e03effd63b Disable compatible ledger safety if quorum is strict 2015-09-25 14:18:18 -07:00
JoelKatz
f9a65e4966 Add '--valid" command line option to consider starting ledger valid 2015-09-25 14:18:06 -07:00
JoelKatz
3c52fdfabe Allow the "quorum" command line option to lock the quorum 2015-09-25 14:18:03 -07:00
Vinnie Falco
938b2fed7c Set version to 0.29.1-b14 2015-09-25 13:43:32 -07:00
JoelKatz
d6875975ab Fix OpenLedger::empty:
* Fix logic of OpenLedger::empty
* Add regression test
* Remove some dead code
2015-09-25 11:37:54 -07:00
seelabs
92b2ca70b7 Inject journals:
Calls to WriteLog are replaced with injected journals
2015-09-25 06:29:08 -07:00
Vinnie Falco
df6ac8f7f5 Use injected Logs 2015-09-25 06:29:07 -07:00
Nik Bougalis
fa796a2eb5 Inject Config:
* Use dependency injections instead
* Remove deprecated fee interfaces
2015-09-25 06:29:07 -07:00
Miguel Portilla
c7b3153958 Upgrade ripple-lib. Fix OS X warnings 2015-09-24 20:22:07 -04:00
Vinnie Falco
5bbb89753d Set version to 0.29.1-b13 2015-09-22 17:06:23 -07:00
Miguel Portilla
654084d181 Allow partialPayment with path_find 2015-09-22 17:05:51 -07:00
Nik Bougalis
094f08211a Set version to 0.29.1-b12 2015-09-21 10:55:57 -07:00
JoelKatz
74b0a7c633 Improve SHAMap missing node behavior:
* Prevent recursive invocation of missing node handler
* Do not throw from ledger constructor
2015-09-21 10:55:30 -07:00
JoelKatz
8f09d3449d Improve ledger replay logic
Build a replay structure holding the transactions
in execution order along with the close time. Use
this structure when replaying a ledger close.
2015-09-21 10:55:30 -07:00
JoelKatz
0c7a7903b6 Use the new OpenView/OpenLedger classes
The server's open ledger is now an instance of the OpenView
class, managed by an instance of the OpenLedger class. This
should improve the performance of operations on open ledgers
because they are no longer Ledger/SHAMap operation.
2015-09-21 10:55:30 -07:00
seelabs
6a8d24372e Fix Travis compile 2015-09-21 08:59:15 -07:00
Edward Hennis
884dc11365 Set version to 0.29.1-b11 2015-09-18 12:19:32 -04:00
Howard Hinnant
83830ef9c0 Install upper_bound in ReadView:
*  And use it in doLedgerData.
2015-09-18 12:18:41 -04:00
Tom Ritchford
849e1ce5f4 Bring some constants into RPC::Tuning.h. 2015-09-18 12:18:40 -04:00
Nicholas Dudfield
4eb6020813 Add npm test for ledger_data command. 2015-09-18 12:18:39 -04:00
Tom Ritchford
d655fdca56 Honor markers in ledger_data requests (RIPD-1010). 2015-09-18 12:18:39 -04:00
seelabs
b6df6748df Use gcc-5 in travis 2015-09-18 12:18:38 -04:00
seelabs
269809dd1a Transitional support gcc 5.2 2015-09-18 12:18:37 -04:00
Vinnie Falco
65fdf1dc5e Add order book stuffing tests:
* PlumpBook makes sure large order books remain sane
* OversizeMeta checks for tecOVERSIZE handling
* FindOversizeBook probes metadata offer limits
2015-09-18 11:51:49 -04:00
Vinnie Falco
60002bf9bc Improve Env::ter and ter() funclet 2015-09-18 11:51:48 -04:00
Vinnie Falco
dd94de2830 jtx: Allow disabling of sig checks 2015-09-18 11:51:47 -04:00
Howard Hinnant
e1fc81f66f Add override keyword on all derived functions:
This silences warnings on latest clang compiler.
2015-09-18 11:50:33 -04:00
Tom Ritchford
b2cf1e4c65 Extract common function RPC::readLimitField. 2015-09-18 11:18:17 -04:00
Miguel Portilla
a65f692ab7 Disable RPC websocket coroutines 2015-09-18 11:16:12 -04:00
Howard Hinnant
44e4a50050 Fix stack bug in upper_bound 2015-09-18 11:14:34 -04:00
Vinnie Falco
ffbcb96eff Inject Application (cont.) 2015-09-18 11:09:40 -04:00
Scott Schurr
eed1a891a7 Remove TxnSignApiFacade (RIPD-945):
Replace TxnSignApiFacade with separate passed in arguments to
the various sign/submit RPC commands.

Also increase unit test coverage of the submit_multisign RPC
command.
2015-09-18 11:09:37 -04:00
Vinnie Falco
9b787434c9 Inject Application:
Calls to getApp are replaced with dependency injections.
2015-09-18 11:09:22 -04:00
Nicholas Dudfield
f4fe55caff Add coverage tracking via codecov.io
Conflicts:
	.travis.yml
2015-09-17 15:57:56 -04:00
Edward Hennis
8df88238cd Migrate Travis to container-based infrastructure
* http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
2015-09-17 11:46:06 -04:00
Nik Bougalis
ea0bd08660 Set version to 0.29.1-b10 2015-09-13 14:28:46 -07:00
Tom Ritchford
c1f50ca7b3 Use lambdas everywhere in JobQueue.
Conflicts:
	src/ripple/app/ledger/impl/LedgerConsensusImp.cpp
2015-09-13 14:28:38 -07:00
Tom Ritchford
a6f866b4d8 Use std::function in JobQueue. 2015-09-13 14:28:38 -07:00
Tom Ritchford
545b2fd6b1 Better suspend for continuation 2015-09-13 14:28:38 -07:00
JoelKatz
b0a855a10e Upgrade SQLite from 3.8.8.2 to 3.8.11.1 2015-09-13 14:28:37 -07:00
seelabs
b5600e940a Minor VS2015 doc update 2015-09-13 14:28:37 -07:00
seelabs
7f5d273e53 Tidy SetHex* function calls & misc cleanups
* Renamed SetHexExact -> SetHexUnchecked
* Removed calls to SetHexUnchecked with empty strings
* Marked ledger class as final, as it calls virtuals in its ctor
2015-09-13 14:28:37 -07:00
Nik Bougalis
b0e6be93ff Add Rate class to support scaling of IOU and XRP amounts 2015-09-13 14:28:37 -07:00
Nik Bougalis
324c42ae09 Support to_string for IOUAmount and XRPAmount 2015-09-11 14:10:35 -07:00
Nik Bougalis
acd03faee5 Use XRPAmount for fees and ledger headers 2015-09-11 14:10:35 -07:00
Nik Bougalis
94af42da44 Support STAmount conversions to XRPAmount and IOUAmount 2015-09-11 14:10:35 -07:00
Nik Bougalis
1e9624270d Make ledger close times increase strictly monotonically 2015-09-11 12:50:26 -07:00
Nik Bougalis
a50d67257c Limit the total number of offers processed while crossing 2015-09-11 12:46:03 -07:00
JoelKatz
3759c553b0 Remove unfunded offers on tecOVERSIZE 2015-09-11 12:39:08 -07:00
JoelKatz
332114c02a Allow more deliver loops when multiquality 2015-09-11 12:33:19 -07:00
Nik Bougalis
5d841c13b7 Set version to 0.29.0-hf2 2015-09-09 15:19:59 -07:00
Nik Bougalis
caecf78a6d Limit the total number of offers processed while crossing 2015-09-09 15:18:58 -07:00
JoelKatz
408a62f7d0 Remove unfunded offers on tecOVERSIZE 2015-09-09 15:18:58 -07:00
JoelKatz
b822d061ef Allow more deliver loops when multiquality 2015-09-09 09:50:57 -07:00
Vinnie Falco
020a112e77 Set version to 0.29.1-b9 2015-09-08 19:20:54 -07:00
Vinnie Falco
8e33ae78f8 Create zero balance trust lines with auth flag (RIPD-1003):
This allows a TrustSet transaction to create a trust line
if the only thing being changed is setting the tfSetfAuth
flag.
2015-09-08 19:18:08 -07:00
wltsmrz
dbddc6b7f2 Update integration tests 2015-09-08 19:14:42 -07:00
Vinnie Falco
f32be2b28d Fix SusPay condition check in Finish:
On a SusPayFinish, a check is added to make sure that the
presented digest matches the digest in the SusPay ledger
entry. Another check is added to make Finish transactions
containing sfProof fields that are not 32 bytes malformed.

This includes regression unit tests.
2015-09-07 18:12:46 -07:00
Vinnie Falco
0f05ebd834 Set version to 0.29.1-b8 2015-09-07 14:05:27 -07:00
Edward Hennis
14db51e3e4 Visual Studio 2015 support 2015-09-07 14:04:53 -07:00
Edward Hennis
8f3bb286f2 Changes to support VS2015 2015-09-07 14:04:53 -07:00
Nik Bougalis
258c93f8d8 Set version to 0.29.1-b7 2015-09-07 11:28:28 -07:00
JoelKatz
88f885f2e7 Limit changed node count 2015-09-07 11:27:15 -07:00
Nik Bougalis
91eee1a42d Limit the number of offers that can be consumed during crossing 2015-09-07 11:27:09 -07:00
Nik Bougalis
6a55f99ede Set version to 0.29.0-hf1 2015-09-07 09:17:06 -07:00
JoelKatz
0b457497d0 Limit changed node count 2015-09-07 09:16:30 -07:00
Nik Bougalis
b7c9e33343 Limit the number of offers that can be consumed during crossing 2015-09-07 09:00:25 -07:00
Scott Schurr
502d5689bf Set version to 0.29.1-b6 2015-09-03 16:53:12 -07:00
seelabs
d015debe2b Remove unused config param 2015-09-03 15:45:24 -07:00
Howard Hinnant
d8aab5a749 Optimize SHAMapItem construction 2015-09-03 14:18:43 -07:00
Vinnie Falco
7ed2094a6a Fix missing 'age' field from server_info 2015-09-03 14:11:46 -07:00
Miguel Portilla
464410d8be Differentiate path_find response (RIPD-1013) 2015-09-03 14:05:48 -07:00
Vinnie Falco
aa0e17dd93 Add consensus simulations 2015-09-03 13:44:37 -07:00
Vinnie Falco
b2cb4df29a Make suite::log_t public 2015-09-03 13:27:16 -07:00
Miguel Portilla
3d777f3f5d Convert all of an asset (RIPD-655) 2015-09-03 13:10:50 -07:00
Vinnie Falco
1842878c40 Tidy up STPathElement constructor 2015-09-03 12:59:15 -07:00
Vinnie Falco
23f47adb60 Add jtx::path funclet 2015-09-03 12:52:02 -07:00
Nicholas Dudfield
377e3d479c Always show fields that contribute to the hash in ledger header json 2015-09-03 12:30:33 -07:00
Tom Ritchford
d5193a776e Replace calls to new(). (#243)
* Replace all unavoidable uses of `new` with `std::make_unique` or
  `std::make_shared`.

* Fix some 80-column issues.
2015-09-03 12:09:44 -07:00
Scott Schurr
ef51128270 Enable simple multisign with a Feature (RIPD-182):
Eventually multisign will need to be enabled onto the network, at
which point compiling it in or out will no longer be an option.
In preparation, the compile guards are removed and multisign is
being enabled with a Feature.

You can locally enable a Feature using your config file.  To
enable multisign with your config file add a section like this:

[features]
MultiSign

The exact spelling and capitalization of both "features" and
"MultiSign" is important.  If you don't get those right multisign
will not be enabled.

There is a minor issue.  The "sign_for" and "submit_multisigned"
RPC commands are only enabled if multisign is enabled.  However
those commands are still shown in the help message even if
multisign is disabled.  This is because the code that produces
the help message doesn't read the config file (where the Features
are kept).  This problem will become irrelevant once multisign is
enabled onto the network.
2015-09-03 11:43:25 -07:00
Scott Schurr
9b15c88b0e Make Rules available outside of Transactors (RIPD-182):
Allows multisign to be enabled with a Feature.
2015-09-03 11:36:23 -07:00
Scott Schurr
f1c29ae20b Allow an account to be exclusively multisigned (RIPD-182):
An account can be made signable with only its regular key by
disabling the master key.  Now an account can also be made
exclusively multisigned by both disabling the master key and
having no regular key.

In order to prevent an account from becoming unsignable the
network uses these rules:

 o An account can always add or replace a regular key or a
   SignerList as long as the fee and reserve can be met by the
   account.

 o The master key on an account can be disabled if either a
   regular key or a SignerList (or both) is present on the account.
   Either the regular key or the SignerList can be used to
   re-enable the master key later if that is desired.

 o The regular key on an account may only be removed if either the
   master key is enabled or the account has a SignerList (or both).

 o The SignerList on an account may only be removed if either the
   master key is enabled or a regular key is present (or both).

As a consequence of this change, the tecMASTER_DISABLED error
code is renamed to tecNO_ALTERNATIVE_KEY.  The error code number
(130 decimal) is unchanged.
2015-09-03 11:16:36 -07:00
Nik Bougalis
6d2e3da306 Set version to 0.29.1-b5 2015-08-18 11:16:25 -07:00
seelabs
7695ea2822 Remove obsolete test file 2015-08-18 11:16:18 -07:00
seelabs
c729ceab20 Add includes for boost in_place 2015-08-18 11:16:18 -07:00
seelabs
e8643dd8cc Fix calling incorrect require function in tests 2015-08-18 11:16:18 -07:00
Miguel Portilla
7b69592fe1 Pass by reference in succ 2015-08-18 11:16:18 -07:00
Howard Hinnant
12e11721f9 Eliminate redundant traversal logic of SHAMap:
*  Only the const_iterator interface remains.
2015-08-18 11:16:18 -07:00
Tom Ritchford
96c13f0d98 Restrict source files to 80 columns. 2015-08-18 11:16:18 -07:00
Edward Hennis
df728cd2cd Reference fee unit clean up
* Use config object or ledger instead of hard coded value.
* The value is still const, and has no change mechanism.
2015-08-18 11:16:18 -07:00
Edward Hennis
0d7cad8d64 Devirtualize HashRouter
* Include some simple renames
2015-08-18 11:16:17 -07:00
Nicholas Dudfield
d69285f6ad Use unabbreviated "SuspendedPayment" for LedgerEntryType 2015-08-18 11:16:17 -07:00
Scott Schurr
b8e192e058 Increased fees for multisigned transactions (RIPD-182):
Multisigned transactions place a higher load on the network than
non-multisigned transactions, requiring a higher fee.

- A non-multisigned transaction always has a minimum fee - the
  network base fee.

- A multisigned transaction has a minimum fee equal to the number
  of multisigners plus one times the network base fee.
2015-08-18 11:16:17 -07:00
Vinnie Falco
aeebfeab10 Remove unused unl module code 2015-08-18 11:16:17 -07:00
Vinnie Falco
8aafebbb75 Move tests to app/tests 2015-08-18 09:02:25 -07:00
Vinnie Falco
c3da2e1f03 Update to soci 3.2 2015-08-18 08:48:16 -07:00
Nik Bougalis
c8c8003677 Merge commit 'caab155a00ca0158dcb16844bea5326e2a2c2562' into dn 2015-08-18 08:47:41 -07:00
Nik Bougalis
caab155a00 Squashed 'src/soci/' changes from 6e9312c..b2855dc
b2855dc Merge pull request #378 from ravselj/sqlite_memory_leak
bf5dad9 Memory leak fix in sqlite3_session_backend.
165737c Fix incorrect pointer instead pointee comparison.
625db74 Merge pull request #376 from ravselj/cmake_debug_postfix2
f3a1055 Added proper support for SOCI_DEBUG_POSTFIX by changing backend-loader macro. If debug postfix is specified in CMake then it is passed forward to soci-core backend loader which then combines proper name based on build configuration.
3459d7d Minor CMake fix that checks if shared mode is set before adding shared test(s).
66d407a Merge pull request #373 from musopr/ambiguous_session
9070742 Merge pull request #372 from musopr/clang_cxx_c11
7b08ec7 Fixed ambiguous 'session' reference
e9748de Include SOCI_CXX_VERSION_FLAGS when compiling Clang
abd6775 Merge pull request #368 from ravselj/cmake_debug_postfix
cae0086 Added CMAKE_DEBUG_POSTFIX to SOCI_LIB_SUFFIX. This fixes backend loading when CMAKE_DEBUG_POSTFIX is used.
3dd4726 Enable MSVC multi process compiling by setting /MP flag.( VS2005+ )
e5f577f Merge pull request #365 from ravselj/sqlite_msvc_fixes
c4dde08 Some trivial fixes in code to resolve MSVC warnings in SQLite back-end
330f0e0 Merge pull request #364 from ravselj/connection_pars
b78c8ef Merge pull request #358 from ArnaudD-FR/bind_clean_up
9f415ee Merge pull request #362 from ArnaudD-FR/sqlite3_optim_split
f1f0162 sqlite3 backend optimizations
0b1a835 Include soci-platform.h because of snprintf
ac65d58 Merge pull request #361 from ArnaudD-FR/blob
24c8383 Bug fix - std::map with key type of const char* is replaced with std::string
3e02a54 Changes due to compiler warnings.
0c88f8c New data_type dt_blob and simple-interface support
403b8de Fix bind_clean_up when using 'row'
92ada95 Merge pull request #363 from ravselj/oracle_win_fix
d1ad52f Add a unit test for CHAR(N) fields padding behaviour.
274d08a Explicitly set character set in Firebird unit tests for CHAR(N).
7623f76 More and better MSVC warnings fixes.
caa2370 Removed dummy and not compilable operator<<(boost::optional).
c025cc8 Fix inserting strings longer than 8000 bytes with ODBC/MS SQL.
d8d765f Update documentations
b5d6507 - oracle cmake Windows fix - test oracle compilation error fix
a6b3514 Split Statement::clean_up into bind_clean_up and clean_up
ba453c7 Make SQL state in ODBC backend error messages more clear.
a374e54 Make ODBC backend error messages more homogeneous.
c4255c9 Delete old /docs folder.
0d3b6b9 Merge pull request #344 from OniDaito/markdown_doc
04f9461 Merge pull request #352 from ravselj/cmake_bug_shared
955a915 - CMake bug fix when building MSVC with SHARED option enabled
f7be373 Merge pull request #348 from msobczak/classic-makefiles
36f373f Added classic Makefile for PostgreSQL test.
615cb94 Updated classic Makefile for PostgreSQL backend.
821092c Don't use both -ansi and -std=gnu++98 flags with g++.
07543f5 Merge pull request #346 from msobczak/classic-makefiles
291fbe7 Merge pull request #347 from jsonn/master
a87776e Make it easier to override SOCI_LIBDIR.
96e66f5 Corrected handling of generated file with backend search path.
0b26c32 Updated classic Makefiles for Oracle Express 11.2.
15a3705 Removed all the crap debian packaging threw in
6db2a65 Merge pull request #343 from OniDaito/master
cf11404 Added Markdown docs
ffbfdc0 Inlined the pragmas for the C++11 tests
ae3ac9d Mistake with CXX11 pragma fixed in session.h
303a966 Merge pull request #341 from mloskot/issues/340
7d7516d Add more qualifications uses of session class with namespace soci::session.
caa3e2b Merge pull request #335 from mloskot/issues/258
1e89d43 Fully qualify uses of session class with namespace soci::session.
1ed81ca Restore setting session with query transformation
84d29e2 Merge branch 'pull/336'
949924a Cope with GNU <=4.6 warning about the #pragma
3494b2b Wrap stream operator for boost::optional<int> with HAVE_BOOST
af4b1a3 Report SOCI_CXX_C11 in CMake output
5744a16 Merge branch 'master' of https://github.com/OniDaito/soci into pull/336
0ab7b37 Remove old build .tcl scripts.
8f2195a Check Postgression availability before proceeding with build.
cd3af53 Remove #include "error.h" of non-existent header
48a8bfa Added the C++11 changes back in
1aee2d1 Add -Wl,-flat_namespace -Wl,-undefined -Wl,suppress to LINK_FLAGS on Apple/OSX
2bf3aa7 Disable test of set_query_transformation with C++ lambda
1d26033 CMake should not terminate on unknown toolset
d8b64cb Remove SociSystemInfo.cmake modul as redundant.
fc3391f List Boost.DateTime in core dependencies
f4ff281 Indicate Travis CI builds Oracle WITH_BOOST=OFF
4863376 Merge pull request #326 from mloskot/issues/224
0c18240 Restore Oracle build with tests on Travis CI.
bc4abd7 Throw instead of truncating VARCHAR columns in Firebird backend.
4c612af No changes, just small code simplification in Firebird backend.
ba206ed Extract common part of MySQL and ODBC MySQL tests in a header.
a0fd859 Remove asserts from the SOCI headers and code.
b36944c Check vector indices instead of asserting that they are valid.
75ef8d8 Handle dt_unsigned_long_long in the "simple" SOCI layer.
2e2f60b Remove asserts on unknown type from the "simple" SOCI layer.
e21aef7 Throw instead of asserting if connection_pool::lease() fails.
4b4cecb Replace left over asserts with CATCH CHECK in the tests code.
388a8d3 Use compile-time asserts to check SQLINTEGER size.
af80fd8 Use SQLT_BDOUBLE instead of SQLT_FLT in Oracle backend.
c74132b Fix warning about pointer-to-int conversion in Firebird backend.
4916551 Reorganize more unit tests to use CATCH sections.
787b428 Fix duplicate test name in Oracle unit tests.
7f65799 Avoid warnings about int-to-pointer conversions in DB2 backend.
7e80c68 Use parameter names from the query, if given, in error messages.
8b0c372 Don't clean up SQLite3 statement prematurely.
9119ed8 Rename db2_statement_backend::names field to names_.
f5c86b7 Make SOCI_NORETURN public and use it in declaration.
62c17b2 Add mktime_from_ymdhms() helper.
ee0b9e4 Fix a clash between CATCH test cases defined in different files.
60a33f4 Reorganize "Use and into" unit test to use CATCH sections.
db59a48 Merge pull request #314 from rpiotaix/release/3.2
82ea95f Don't add DB2_INCLUDE_DIR to global include directories.
4f570d7 Restore Travis CI builds for other databases
71edca9 Merge pull request #306 from mloskot/postgression
1e4b365 Add a Travis build using PostgreSQL server at Postgression.
6abb7e1 Typo
1ccff47 Replace raw & with &amp; entity.
56d3aa6  No real changes, just remove trailing whitespace.
ef6d90d Fix previous attempt to correct include of SQLite3 backend header
31a22a1 Include SQLite3 backend public headers using soci/ prefix.
e4376ed Merge branch 'master' into develop-3.2.3
111b50a Merge branch 'hotfix/3.2.3'
0ef4912 Add 3.2.3 release notes
8da98b2 Add new contributors
ee7e155 Bump version number in docs
30c02f3 Merge branch 'master' of git://github.com/Alex-Vol/soci into hotfix/3.2.3-PR263
5577606 Improve readability of ODBC error message Closes #229
8e14c5b Improve error message when an odbc error occurs
8a50af6 Merge branch 'hotfix/3.2.3' of https://github.com/SOCI/soci into hotfix/3.2.3
a948ab3 Remove unused HAVE_XXX defines
2c85be1 Fix missing strtoll on Cygwin and MinGW
d9c059e Clarify documenation and examples on bulk operations.
a08d750 [travis] Disable Oracle build
70e67aa Replace prefix underscore with suffix in private member names
c799e4f Append each member of tuple/fusion instead of adding tuple/fusion
645e7a2 Merge github.com:pacocamberos/soci into pacocamberos-branch-mysql-blob
e96bc2b Ignore CMakeLists.txt.user created by Qt Creator IDE
f694e30 Bump library version number to 3.2.3
5ecebe9 fixed link error for msvc 64 bit
3278579 Fix email notifications for Travis CI builds.
ad9075c Configure Travis CI to fail the build a.s.a.p.
7481868 Explicitly set extra_float_digits when using PostgreSQL in ODBC.
83bbbd4 update sqlite3 backend documentation
57530a1 Merge pull request #302 from vadz/rich-exceptions
5cda82a Avoid throwing from soci_error copy ctor and assignment operator.
8bb6610 Provide context of the error in soci_error when possible.
a8ba1cb Add use_type_base::dump_value() for richer diagnostics.
76b3089 Add soci_error::get_error_message() method.
e8e5978 No real changes, just remove trailing whitespace.
a90018b Merge catch-tests branch.
7b8b37b Use REQUIRE() and not CHECK() for a test that can't be allowed to fail.
c9dbe19 Move all tests from tests/assert to tests directory itself.
246f657 Convert the tests to use CATCH testing framework.
b2060fb Add single header version of CATCH testing framework.
b87407e Add values::get_number_of_columns() accessor.
9628081 Define SOCI_NORETURN: a portable __attribute__((noreturn)) equivalent.
6ebcbcd Remove the never used details::statement_impl::namedUses_.
0f1f295 Add helper exchange_type_cast<>() template function.
02207fc Rename "version" class in the ODBC test to "odbc_version".
42549d0 Merge pull request #297 from nbougalis/unshadow
7d5eb2d Use a base-class member instead of shadowing it.
37fbe8f Don't always disable ODBC MS SQL test under Unix, just when using Travis.
ed37399 Fix ODBC backend get_affected_rows() when using FreeTDS driver.
f212ca9 Skip test which fails when using ODBC with MS SQL Server.
629386f Merge pull request #294 from denisarnaud/develop
294becb Fix for the issue #169: cleaner way to include headers.
120b88c Accept oraocci12 as a possible Oracle library name too.
8e1ddcd Merge pull request #213 from ayllon/develop
6552eb1 No real changes, just simplify Firebird backend code a little.
34be702 Test exact round trip for NUMERIC values for all backends.
24c0539 Fix rounding error in Firebird NUMERIC/DECIMAL conversions.
69352bc Speculatively enable exact floating point comparisons for all backends.
f497fb8 Disable exact floating point when using PostgreSQL ODBC driver.
6f9dd54 No changes, just fix a repetitive typo in "assert" in comments.
02f0a69 No changes, just remove annoying "EXECEPTION" typo.
4bf2d3c Explicitly disable exact floating point comparison in MySQL test.
1f3dd92 Replace accidental assignment with a comparison in Firebird unit test.
c3cd309 Make text-to-double conversion exact in PostgreSQL backend.
ff9146a Explicitly disable exact floating point comparison in SQLite test.
7039d00 Compare floating point values exactly in tests whenever possible.
53cd24e Don't start implicit transaction too eagerly in Firebird backend.
66f0d82 Add possibility to build Firebird using embedded library.
1489811 Update version to 4.0.0 in cmake too.
5838cc6 Reenable building, if not testing, Oracle backend.
dc4fb73 Move ORACLE_HOME to Oracle-specific script.
f9167a1 Avoid many warnings about floating point values comparison.
c85744b Define GCC_WARNING_SUPPRESS and GCC_WARNING_RESTORE macros.
ef7e9a9 Avoid warning about set but unused variable in Oracle backend.
86a4598 Avoid g++ warnings about casting away const with C-style casts.
2c887b3 Ignore CMake-generated files.
f61d7f5 Add missing include for std::max
21824a1 fixed deadlock in soci::connection_pool::try_lease
6e6bd46 Documentation for SQLite3 result code support.
97cbb0a Update PostgreSQL backend documentation for UUID type support.
5448cf1 Spelling fix in an error message: s/Commiting/Committing/.
5b073e3 Remove the unnecessary "error.h" inclusion from PostgreSQL code.
5776dd4 Introduced sqlite3_soci_error exception as subclass of soci_error. This new exception exposes the SQLite3 result code returned when any failure happens. Using this method is preferable to scrubbing string error messages in soci_error exceptions. Useful when there needs to be a distinction between general errors and database constraint errors. Unit test added to prove the funtionality does what is expected.
6d766e7 Introduced support for UUID column type in PostgreSQL statement.cpp. Unit test added for UUID column support testing all supported kinds of UUID formatted strings on input and standardized UUID formatted strings on output.
e106dc0 Optionally use the environment locale in the tests.
1b65061 Make sqlite3 and mysql backends work with any locale too.
8548642 Use locale-independent function for converting doubles to strings.
1260d4f Reimplement cstring_to_double() without using C++ standard library.
bc884fe Remove unused HAVE_XXX defines
4ffb21b Fix missing strtoll on Cygwin and MinGW
7bd4991 Clarify documenation and examples on bulk operations.
4d0785e Temporarily disable using Oracle backend on Travis.
da7e42c Merge pull request #242 from vadz/pgsql8-bytea
070b278 Merge branch 'fix_odbc_msvc_x86_64' of github.com:snikulov/soci into snikulov-fix_odbc_msvc_x86_64
fce8560 [travis] Disable Oracle build
0ff0e01 Replace prefix underscore with suffix in private member names
65a5ee3 Append each member of tuple/fusion instead of adding tuple/fusion
8e9fb42 Merge github.com:pacocamberos/soci into pacocamberos-branch-mysql-blob
3dca4e3 Ignore CMakeLists.txt.user created by Qt Creator IDE
de7e6f0 Bump library version number to 3.2.3
946dd5a Fix PostgreSQL unit test to pass with PostgreSQL < 9.0.
0a47eaf vs2013 got strtoll/strtoull
58d31f9 Update version to 4.0.0.
89df841 Merge pull request #239 from vadz/soci-headers-prefix
417ef5c Include all public headers using "soci/" prefix inside SOCI itself.
5a99a15 Merge pull request #238 from vadz/cstrtod
0585bb1 Merge pull request #237 from vadz/odbc-header-fix
6f4162c Add helper cstring_to_double() and use it in PostgreSQL backend.
73119cb Fix compilation of ODBC-specific SOCI header with new include paths.
d877390 Delete obsolete src/<backend>/test directories
06a970f Revert CMake setup for ODBC DB2 test
f04147a Move ODBC test DSN files to new tests location
0219c43 Fix paths to ODBC test DSN files
928174c Fix Firebird includes of private headers
bc171b6 Fix copy-n-paste error in CMake macro parameter name
1f4d6ef Fix includes to point to backend headers in subdirectories
552e81c Enable other tests in tests/assert
7a018a3 Move tests/assert into separate subdirectories
e2ec7ff Ignore Qt Creator and Eclipse files
5d527ec Fix windows.h case for cross-compilation
024ccc8 Firebird: fix harmless warning in 64 bit builds.
802f78e Merge pull request #216 from dgrambow/develop
32c5f88 Add get_last_insert_id tests for sqlite3 and mysql backends
ccd4c0d Add get_last_insert_id for sqlite3 and mysql backends Update docs/beyond.html accordingly
42aec23 Fix in soci::oracle to allow spaces in the params
b2ea9f7 fixed link error for msvc 64 bit
ef69fa9 [travis] Disable building tests due to #199
09acb8c [travis] Fix bash script syntax error
cba671f [travis] Disable ctest run due to #199
d8f7d9d [travis] Restore soci-devel notifications
22257b3 [cmake] Remove unused log message
0cffb8a CMake 2.8.7 have problems with per target includes
b430cb0 Attempt to correct -I paths for backend test
6c0721d Attempt to correct -I paths for backend folders
69d70c5 [travis] Disable tempoarily soci-devel notifications
f4802f1 [travis] Log build script name
8890aea [travis] Set CMAKE_VERBOSE_MAKEFILE=ON
717c38a [travis] Remove superfluos ] from make invocation
843a43c Fix travis-ci to run CMake from root directory
9e43795 Update copyright year
da025df Merge branch 'feature/125-new-layout' into develop
04a34f2 Link presentation from London C++ Meeting
11ef1fa Fix doc/index.html menu links
5393ee5 Merge branch 'hotfix/3.2.2' into develop
b6d97ff Implement new source tree layout #125

git-subtree-dir: src/soci
git-subtree-split: b2855dce54340522f149221c6ebe2d14fd1129ba
2015-08-18 08:43:51 -07:00
Nik Bougalis
1b85b6eaba Set version to 0.29.1-b4 2015-08-04 14:55:43 -07:00
JoelKatz
863add6a19 Remove spurious format string from log 2015-08-04 14:55:30 -07:00
JoelKatz
64b80e0573 Fix ledger loading on startup 2015-08-04 14:55:30 -07:00
Nik Bougalis
ed902d9dea Set feature activation date to Aug 17 2015-08-04 14:55:30 -07:00
Nik Bougalis
f38b373cb6 Exit if OpenSSL doesn't have secp256k1 support (RIPD-900) 2015-08-04 14:40:16 -07:00
Nik Bougalis
b8f2fdb6ac Remove obsolete DHUtil 2015-08-04 14:40:16 -07:00
Nik Bougalis
182f570f24 Reduce Transactor virtual interface 2015-08-04 14:40:16 -07:00
Nik Bougalis
5b90ccf65d Validate fee during preflight 2015-08-04 14:40:16 -07:00
Edward Hennis
22a8e25538 Fix display discrepancy in fee. 2015-08-04 14:40:16 -07:00
Edward Hennis
d63aab6312 Test display discrepancy in fee. 2015-08-04 14:40:16 -07:00
seelabs
774dcad392 Remove common_ledger 2015-08-04 13:51:02 -07:00
Tom Ritchford
7b7b27ee9e Replace tabs with spaces. 2015-08-04 13:51:02 -07:00
Vinnie Falco
c5adbc859a Fix OpenView::sles 2015-08-04 13:51:02 -07:00
Vinnie Falco
2cc12b2f2f Add Env::meta() 2015-08-04 13:51:02 -07:00
Vinnie Falco
13b33b5d4d Store STTx in JTx
Conflicts:
	src/ripple/test/jtx/impl/Env.cpp
2015-08-04 13:51:02 -07:00
Howard Hinnant
c7dea3ed17 Improve LoadFeeTrack::scaleFeeLoad:
* Move lock protection to where it is needed.
* Use gcd to reduce problem to lowest terms.
* Use improved overflow avoidance to retain
  as much precision as possible.
* Detect overflow if it can be shown that the
  final result will not fit in a uint64_t.
2015-08-04 13:51:01 -07:00
Edward Hennis
a7e6ecb5b3 Devirtualize LoadFeeTrack 2015-08-04 13:51:01 -07:00
Nik Bougalis
5964710f73 Set version to 0.29.0 2015-08-04 13:22:45 -07:00
Nik Bougalis
262a61564c Set feature activation date to Aug 17 2015-08-04 13:22:17 -07:00
Edward Hennis
4cc4421c82 Fix display discrepancy in fee. 2015-08-04 11:22:38 -07:00
JoelKatz
2786950c16 Fix ledger loading on startup 2015-08-04 11:05:02 -07:00
Nik Bougalis
e45c1b238f Set version to 0.29.1-b3 2015-07-31 17:42:16 -07:00
Tom Ritchford
d166e6a45e Add more documentation to Builds/Test.py. 2015-07-31 17:41:27 -07:00
Vinnie Falco
e759137f15 Thread SusPay to all affected accounts 2015-07-31 17:41:05 -07:00
JoelKatz
0bb570a36d Be paranoid about ledger compatibility:
* Consider ledgers incompatible based on last valid ledger
* Test against even ledgers not acquired yet
* Don't validate an incompatible ledger
* Don't switch to an incompatible ledger
* Protect against an unreasonably small quorum
2015-07-31 17:40:39 -07:00
JoelKatz
38c6083a2f Reduce some logging severity 2015-07-31 17:39:39 -07:00
JoelKatz
cfdf0d2f0a Remove a ledger from the set of present ledgers where needed
* If we encounter it in RPC
* If we fully-validate a ledger that doesn't have it in its history
2015-07-31 17:39:35 -07:00
JoelKatz
f0dc2bc425 Confirm valid suspend before relying on suspension 2015-07-31 17:39:14 -07:00
Tom Ritchford
32ec3fe089 Remove trailing spaces. 2015-07-31 17:39:03 -07:00
Scott Schurr
9e69bd5c56 Simple multisigning (RIPD-182):
With this changeset two-level multisigning is removed from the
codebase and replaced with single-level multisigning.

Additionally, SignerLists in the ledger are prepared for the
possibility of multiple SignerLists per account.  This was done
by adding a defaulted 32-bit SignerListID to each SignerList.
The SignerListIndex calculation incorporates the SignerListID.

There are three known missing elements:

 1. Multisigned transactions should require higher fees than
    regular (single-signed) transaction.  That's not yet
    implemented.

 2. It should be possible to disable the master key on an account
    if that account is multisign enabled (has a signer list).
    That's not yet implemented.

 3. Documentation about multisigning needs to be improved.

Multisigning is still compiled out of the code base.  To enable
multisigning for a stand-alone rippled, change the
RIPPLE_ENABLE_MULTI_SIGN macro (in BeastConfig.h) to "1" and
rebuild.

This commit also addresses:
 o RIPD-912: Remove multisign APIs from STObject, and
 o RIPD-944: Replace common_transactor with jtx at call sites.
2015-07-31 17:31:18 -07:00
Vinnie Falco
ceeb36039e New peer to peer network simulators 2015-07-31 17:31:01 -07:00
Vinnie Falco
2bfae2f0ac Tidy up UNL module:
* Renamed module to unl
* Renamed classes and members
* Removed cyclic dependency in Horizon
2015-07-31 17:30:56 -07:00
Vinnie Falco
b25f322c93 Set version to 0.29.0-rc6 2015-07-29 18:43:02 -07:00
JoelKatz
f77ecba896 Confirm valid suspend before relying on suspension 2015-07-29 18:42:14 -07:00
Nik Bougalis
5d2d88209f Set version to 0.29.1-b2 2015-07-29 12:50:58 -04:00
Nik Bougalis
ecf1a3c69c Initialize close offset 2015-07-29 12:50:41 -04:00
Vinnie Falco
3f0eacf5e7 Add SuspendedPayment feature (RIPD-992):
The code is enabled in jtx::Env, and enabled in production
ledgers only if the SuspendedPayment amendment is voted
into a ledger.
2015-07-29 11:56:10 -04:00
Vinnie Falco
d49f9ea109 Add [features] section to .cfg:
This non-production config section allows features to be enabled
by listing their text descriptions, one line each, in the config
section titled "features".

NOTE: Feature names with leading or trailing whitespace, or
      containing an equals sign ('=') are not supported.
2015-07-29 11:56:08 -04:00
Vinnie Falco
2ec40cb6f1 Add operator[] field accessors to STObject:
New array index operators allow for concise reading and
writing of fields in the STObject, with associated unit test.
2015-07-29 11:56:07 -04:00
Vinnie Falco
3e342e4b71 Add st.h module header 2015-07-29 11:56:05 -04:00
Vinnie Falco
147fee0272 Add describeOwnerDir 2015-07-29 11:56:04 -04:00
Vinnie Falco
fa900de548 Fix applyFlags when testing is disabled 2015-07-29 11:56:02 -04:00
Vinnie Falco
8cd44c637d Add except, unexcept in suite 2015-07-29 11:56:01 -04:00
Vinnie Falco
729caaacff Add THROW contract call 2015-07-29 11:56:00 -04:00
Edward Hennis
2f5d721ec1 Track STTx validity with HashRouter. (RIPD-977) 2015-07-29 11:55:58 -04:00
Edward Hennis
c15394c42a Add preflight functionality to transactors:
The preflight() function performs static validity
analysis of transactions without requiring a ledger.

* Use tx in ApplyContext
* Remove unused journal
* Document apply()
* Add preflight(), which takes an OpenView, uses its rules.
* Change `TER preCheck` to `void preCompute` since it can no longer fail.
2015-07-29 11:55:57 -04:00
JoelKatz
36a62f110c Switch some Ledger instances to ReadView instances
* Remove ltCURRENT
* Change getOwnerInfo
* Use ReadView in TransactionSign
* Change AcceptedLedger and ProposedTransaction to use ReadView
* Change RPC::accounts
2015-07-29 11:46:01 -04:00
Nik Bougalis
2d02b46253 Fix parsing in ledger_request 2015-07-28 20:27:00 -07:00
Miguel Portilla
6cf75f0fc2 Add uptime to crawl data (RIPD-997) 2015-07-28 20:26:51 -07:00
Nik Bougalis
1a3e2e3f36 Set features activation to Aug 10 2015-07-28 20:26:41 -07:00
Tom Ritchford
645e32b19e Fix coroutine suspend 2015-07-28 20:26:30 -07:00
Tom Ritchford
fa0a61b5d7 Revert "Always use co-routines:"
This reverts commit 3d6e76046c.
2015-07-28 20:26:19 -07:00
Nik Bougalis
2336fe2708 Set version to 0.29.0-rc5 2015-07-28 20:14:10 -07:00
Nik Bougalis
0cbd81146f Fix parsing in ledger_request 2015-07-28 20:07:53 -07:00
Miguel Portilla
a268c1a7ad Add uptime to crawl data (RIPD-997) 2015-07-28 20:07:53 -07:00
Nik Bougalis
3b7107b255 Set features activation to Aug 10 2015-07-28 20:07:53 -07:00
Tom Ritchford
a2ea89c64e Fix coroutine suspend 2015-07-28 20:07:19 -07:00
Tom Ritchford
b44cb1a64c Revert "Always use co-routines:"
This reverts commit 3d6e76046c.
2015-07-28 19:27:27 -07:00
Vinnie Falco
1dc3acb071 Set version to 0.29.1-b1 2015-07-23 14:23:23 -07:00
Vinnie Falco
0cf58cc505 Add Rules to ReadView:
An instance of Rules provides information on the tx
processing rules in a particular ledger.

* OpenView allows rules to be set on construction.

Conflicts:
	src/ripple/unity/ledger.cpp
2015-07-23 14:23:13 -07:00
Vinnie Falco
eb49e1bf47 Convert OrderBookDB to ReadView 2015-07-23 14:23:13 -07:00
Vinnie Falco
0627d3487b Add OpenLedger::empty 2015-07-23 14:23:13 -07:00
Vinnie Falco
84161b86c7 Add ReadView::sles 2015-07-23 14:23:12 -07:00
Vinnie Falco
110bbf3956 Add CachedLedger:
This type alias provide cache-wrapping for Ledger objects.
Through the CachedLedger interface, access to the underlying
Ledger is permitted to allow for cases where the implementation
must perform Ledger specific activities. For example, building
a fetch pack from the contained SHAMap objects.

The CachingReadView is refactored:

* Renamed to CachedView
* Templated on Base, the base type
* base() returns a shared_ptr to the wrapped object
* Constructor requires a shared_ptr<Base>
2015-07-23 14:23:12 -07:00
Vinnie Falco
fad9998f9d Remove deprecated abstract_clock::elapsed 2015-07-23 14:23:12 -07:00
Vinnie Falco
b38a96ae82 Add TimeKeeper:
This class tracks Ripple network time and closing time.

Conflicts:
	src/ripple/ledger/ReadView.h
2015-07-23 14:23:11 -07:00
Vinnie Falco
e82d774d32 Move SNTPClient to core:
* Refactor SNTPClient
* asio best practices
* Not derived from Stoppable
2015-07-23 14:23:11 -07:00
Miguel Portilla
8d1b169f5a Skip List unit test (RIPD-926) 2015-07-23 14:23:11 -07:00
Miguel Portilla
70ccdabf7c Squelch logs in Env (RIPD-982) 2015-07-23 14:23:10 -07:00
Nik Bougalis
af36942e1f Tidy up offer crossing:
* Clarify use of cancel view in OfferCreate transactor
* Reduce OfferStream public interface
* Reduce severity of some developer-only logging from ERROR to DEBUG
2015-07-23 14:23:10 -07:00
Nik Bougalis
b1b98fa3b0 Tidy up JLOG 2015-07-23 14:23:08 -07:00
Tom Ritchford
bb251063fc Remove deprecated 'accepted' parameter. 2015-07-23 12:34:08 -07:00
Tom Ritchford
663742e0d1 Fix compilation warnings in secp256k1. 2015-07-23 12:34:07 -07:00
Nik Bougalis
16c89aee04 Set version to 0.29.0-rc4 2015-07-23 12:32:43 -07:00
Nik Bougalis
abe735102a Fix metadata during apply:
Metadata is correctly generated for the case where a ledger entry is only changed as
a consequence of threading. This changes the result compared to previous versions,
which produced more than necessary for these cases.
2015-07-23 12:29:35 -07:00
David Schwartz
70a37811bd Set the fees in Ledger::setImmutable 2015-07-21 11:40:41 -07:00
Nik Bougalis
edab96e973 Set version to 0.29.0-rc3 2015-07-20 15:41:25 -07:00
Nik Bougalis
e7a50e2a5a Fix apply table metadata updates 2015-07-20 15:40:46 -07:00
Vinnie Falco
e18ba24670 Set version to 0.29.0-rc2 2015-07-17 13:31:08 -07:00
Vinnie Falco
f41fc87a33 Put OfferCreate bug fix on a ledger switch:
The fix for an off-by one bug that overstates the account reserve
during OfferCreate is set to become active on August 3rd. Before
this date, the program will exhibit the old behavior.
2015-07-17 13:25:03 -07:00
Vinnie Falco
5ec3534fea Set version to 0.29.0-rc1 2015-07-15 16:56:48 -07:00
Vinnie Falco
6bd39a316e Tidy up amendment feature macro 2015-07-15 16:56:45 -07:00
Yana
8434203e71 Add copyright notice 2015-07-15 16:56:44 -07:00
Nik Bougalis
59431c513a Add IOUAmount and XRPAmount (RIPD-976):
These numeric types replace the monolithic functionality
found in STAmount. They are not used yet.
2015-07-15 16:56:44 -07:00
Miguel Portilla
edc1bc35fd Add path find response field full_reply (RIPD-894) 2015-07-15 16:56:44 -07:00
Miguel Portilla
18ccdf8bd4 Add Directory container and iterator (RIPD-968) 2015-07-15 16:56:43 -07:00
seelabs
a0dcc4da8c Enable rm funded offer fix after a switch over date 2015-07-15 16:56:43 -07:00
seelabs
2b91e62d5d Fix funded offer removal during payment (RIPD-113):
In some cases, funded offers were incorrectly removed. This happened
when:

1) There are multiple payment paths.
2) A payment path has several offers in a row.
3) An offer causes a previous offer to become unfunded when calculating
   reverse liquidity and that offer does not satisfy the payment and
   there is another offer at the same quality.
4) The payment path is not used to satisfy the payment (there are other
   paths at better quality that do the job).
2015-07-15 16:56:43 -07:00
Vinnie Falco
bc5a25168a Update chrono types
Conflicts:
	src/ripple/test/jtx/impl/Env.cpp
2015-07-15 16:56:43 -07:00
Vinnie Falco
f453c58389 Fix manifest message handler 2015-07-15 16:56:42 -07:00
Vinnie Falco
ad74606ab3 Fix fees in Ledger construction
Conflicts:
	src/ripple/app/ledger/Ledger.cpp
	src/ripple/app/ledger/Ledger.h
	src/ripple/app/main/Application.cpp
	src/ripple/ledger/impl/View.cpp
	src/ripple/ledger/tests/View_test.cpp
	src/ripple/test/jtx/impl/Env.cpp
2015-07-15 16:56:42 -07:00
Vinnie Falco
bb15295935 Refactor computation of Ledger hash 2015-07-15 16:56:42 -07:00
Vinnie Falco
f0c1fbb098 Use LedgerInfo hash in applyHeldTransactions 2015-07-15 16:56:41 -07:00
Vinnie Falco
692f224e1c Tidy up genesis Ledger construction 2015-07-15 16:56:41 -07:00
Vinnie Falco
5bd9cd2ee8 Tidy up and move sources 2015-07-15 16:56:41 -07:00
Tom Ritchford
70fc091e74 Split up RPC handlers for classic build. 2015-07-15 16:56:40 -07:00
Tom Ritchford
1d09c54fdc Replace Ledger with ReadView in most RPC handlers. 2015-07-15 16:56:40 -07:00
Tom Ritchford
c7ebe7205c Move fields from Ledger to LedgerInfo. 2015-07-15 16:56:39 -07:00
Tom Ritchford
1b6c707abb Extract LedgerToJson.cpp from LedgerToJson.h. 2015-07-15 16:56:39 -07:00
Tom Ritchford
a0010effbc Simplify lookupLedger to use an RPC::Context. 2015-07-15 16:56:39 -07:00
Tom Ritchford
c094772bc0 Restrict Ledger.cpp to 80 columns. 2015-07-15 16:56:38 -07:00
Vinnie Falco
7ce871f3b2 Merge branch 'release' into develop
Conflicts:
	Builds/rpm/rippled.spec
	src/ripple/protocol/impl/BuildInfo.cpp
2015-07-15 16:56:10 -07:00
Nik Bougalis
77b3ad5de1 Set version to 0.29.0-b12 2015-07-13 16:38:40 -07:00
Tom Ritchford
a75a0c0b84 Mention rippled in the websocket test page. 2015-07-13 16:38:40 -07:00
Tom Ritchford
072fc53019 Rename duplicate .cpp files. 2015-07-13 16:38:39 -07:00
wilsonianb
5bad2db667 Add validations subscriptions (RIPD-504) 2015-07-13 16:38:39 -07:00
Miguel Portilla
7c2478480d DeliverMin enable switch and precheck greater than dest amount 2015-07-13 16:38:39 -07:00
Nik Bougalis
761f218c0a Refactor NetworkOPs:
* Reduce public API
* Use LedgerMaster interface from RPC
* Remove fetch pack management to LedgerMaster
2015-07-13 16:38:39 -07:00
Vinnie Falco
163e8eb8fc Use SecretKey, PublicKey 2015-07-13 16:37:04 -07:00
Vinnie Falco
6fccd07479 Add new cryptographic token types:
This replaces the equivalent functionality in RippleAddress.

* New PublicKey, SecretKey, Seed, Generator
* Removed AnyPublicKey, AnySecretKey
2015-07-13 16:37:04 -07:00
Vinnie Falco
c86a40a361 Tidy up digest functions:
* Add sha512_half_hasher
* Move sha512Half functions to digest.h
* Add explicit OpenSSL equivalents
2015-07-13 15:25:20 -07:00
Vinnie Falco
362726de4a Slice improvements:
* Rename to makeSlice
* Well defined default construction
* Add `empty`
* Add operator[]
* Buffer arithmetic
2015-07-13 15:25:20 -07:00
Vinnie Falco
5962a4817a Add secp256k1 module 2015-07-12 12:03:27 -07:00
Vinnie Falco
2e05471d72 Fix compilation with C++ 2015-07-12 12:03:27 -07:00
Vinnie Falco
d998c6461e Merge commit '94f13fb6061ead96fd5bc6ecd6ee5d9c5565a966' as 'src/secp256k1' 2015-07-12 12:03:20 -07:00
Vinnie Falco
94f13fb606 Squashed 'src/secp256k1/' content from commit 0cbc860
git-subtree-dir: src/secp256k1
git-subtree-split: 0cbc8600f3147c97ff0b404abebf5db19025b20b
2015-07-12 12:03:20 -07:00
Vinnie Falco
7edf783102 Set version to 0.29.0-b11 2015-07-12 11:51:27 -07:00
JoelKatz
efc2159441 Implement new amendment majority semantics :
This implements the tracking of when an amendment achieved a majority
in the ledger, ensuring that there's always network-wide agreement
on which amendments have achieved a majority and how long they've
held it.

* New fields
* Change transactor changes
* AmendmentTable API and implementation changes
* Update amendment enabled status on validated ledgers
* Reinstate support for ledger sequence in fee transactions
2015-07-12 11:51:27 -07:00
David Schwartz
3078c6da12 Check if synchronized in ripple_path_find
If a call to ripple_path_find does not specify a ledger,
the call should fail if the server is not synchronized
to the network.
2015-07-12 11:51:27 -07:00
Miguel Portilla
de6f678de7 Pass by reference in processTransaction 2015-07-12 11:51:26 -07:00
Nicholas Dudfield
d8d51e8103 Add quality to account_offers 2015-07-12 11:51:26 -07:00
Howard Hinnant
361f1da5b8 Optimize and clean up SHAMap::iterator:
* Remove dependence on boost::iterator_facade.
* Rename iterator to const_iterator.
* Change value_type from shared_ptr<SHAMapItem const> to SHAMapItem.
* Install a stack-path to the current SHAMapItem in the const_iterator.
2015-07-12 11:51:26 -07:00
Vinnie Falco
30e068ae17 Tidy up compilation units 2015-07-12 11:50:34 -07:00
Mark Travis
3b751cc6e6 Set version to 0.28.2-hf1 2015-07-09 22:57:16 +00:00
Miguel Portilla
6d60f19d73 Change NetOps processTransaction to use ref param 2015-07-09 22:56:03 +00:00
Vinnie Falco
94235d4b4f Set version to 0.29.0-b10 2015-07-09 14:21:49 -07:00
Vinnie Falco
367c3a5bfc Refactor View classes:
The View hierarchy of classes is reorganized to include new
classes with member functions moved and renamed, to solve
defects in the original design:

OpenView accumulates raw state and tx changes and
can be applied to the base. ApplyView accumulates changes
for a single transaction, including metadata, and can be
applied to an OpenView. The Sandbox allows changes with
the option to apply or throw them out. The PaymentSandbox
provides a sandbox with account credit deferral.

Call sites are changed to use the class appropriate for
the task.
2015-07-09 13:25:18 -07:00
Vinnie Falco
f3b172b0c9 Use OpenLedger in Env 2015-07-09 13:25:18 -07:00
Vinnie Falco
023715474c Add OpenLedger:
The OpenLedger class encapsulates the functionality of
maintaining the open ledger. It uses an OpenView with the
last closed ledger as its base. Routines are provided to
modify the open ledger to add new transactions, and to
accept a new last closed ledger. Business logic for
performing transaction retries is rewritten to fit this
framework and used in the implementation of accept.

When the RIPPLE_OPEN_LEDGER macro is set to 1 (BeastConfig.h),
the global Application OpenLedger singleton maintains
its open ledger in parallel by applying new transactions
and accepting new last closed ledgers. In the current
implementation this does not affect transaction processing
but logs any differences in the results as compared to
the original code.

Logging shows an occasional mismatch in what the OpenLedger
builds versus the original code, usually an OfferCreate
which gets a terINSUF_RESERVE instead of tesSUCCESS.
2015-07-09 13:20:28 -07:00
Vinnie Falco
f5873bcad0 Add unfunded account Env test 2015-07-07 12:55:56 -07:00
Vinnie Falco
9f27801b8d Log metadata differences on built ledger mismatch 2015-07-07 12:55:56 -07:00
Vinnie Falco
9eb0c2964c Pass a reference in SHAMap::compare 2015-07-07 12:22:50 -07:00
Vinnie Falco
73d64bbafc Set version to 0.29.0-b9 2015-07-07 10:14:31 -07:00
Tom Ritchford
ea67a2d051 Remove jss::account_index and jss::peer_index. 2015-07-07 10:14:31 -07:00
Vinnie Falco
1e7588d0ab Fix open ledger flag when jumping 2015-07-07 10:14:31 -07:00
Vinnie Falco
b6b3548c0c Remove redundant unit test 2015-07-07 10:14:27 -07:00
Vinnie Falco
097a8ce640 Merge branch 'release' into develop
Conflicts:
	Builds/VisualStudio2013/RippleD.vcxproj
	Builds/VisualStudio2013/RippleD.vcxproj.filters
	Builds/rpm/rippled.spec
	src/ripple/app/misc/NetworkOPs.cpp
	src/ripple/app/tx/impl/TransactionEngine.cpp
	src/ripple/protocol/impl/BuildInfo.cpp
	src/ripple/unity/app_tx.cpp
2015-07-07 09:35:41 -07:00
Vinnie Falco
6374aad9bc Set version to 0.28.2 2015-07-07 09:21:44 -07:00
Vinnie Falco
fed3f7b74b Set version to 0.29.0-b8 2015-07-02 15:53:05 -07:00
Vinnie Falco
c079d9ae38 Env_test fixes 2015-07-02 15:53:00 -07:00
Nik Bougalis
6a093b1b44 Fix SHAMapTreeNode deserialization 2015-07-02 15:50:11 -07:00
Miguel Portilla
4dc573f195 Add DeliverMin transaction field (RIPD-930) 2015-07-02 15:50:11 -07:00
Vinnie Falco
b7f07aed00 Add BasicView::txs memberspace interface 2015-07-02 15:09:10 -07:00
Vinnie Falco
cb791482a0 Serializer improvements:
* Add getSlice()
* Make getVLDataLength public
2015-07-02 15:09:10 -07:00
Vinnie Falco
bd7eb94d69 Refactor clock declarations in chrono.h 2015-07-02 15:09:09 -07:00
Vinnie Falco
223389a464 Tidy up abstract_clock:
* Add clock_type
* Make elapsed() const
2015-07-02 15:09:09 -07:00
Vinnie Falco
575f124fb8 Tidy up transactors:
* Rename some members
* Don't use SLE cached from the base view
2015-07-02 15:09:09 -07:00
Vinnie Falco
483f768370 Use BasicView:
Many functions and classes that used a Ledger now use a BasicView.

Calls to cachedRead are changed to call member read on the view,
note that this bypasses the SLECache optimization. To restore the
optimization, the BasicView passed at the top of call stacks
should be wrapped with a caching view, coming in future commits.
2015-07-02 15:09:08 -07:00
Vinnie Falco
ab20ca95aa Add hash to ViewInfo 2015-07-02 15:09:08 -07:00
Vinnie Falco
bf775036bc Add MetaView hold parameter 2015-07-02 15:09:08 -07:00
Vinnie Falco
08bfd302fe Apply tx to new open ledger on switch (RIPD-972):
When the last closed ledger jumps, transactions from the
old open ledger and local transactions need to be applied
to the new open ledger or else transactions could get lost
locally (but still relayed, and therefore make it into a ledger).

A harmful effect is that rippled will report that the transaction
was not applied even when it was, making robust transaction
submission malfunction.
2015-07-02 15:09:07 -07:00
Vinnie Falco
3b6ea02920 Fix missing tefEXCEPTION handling in apply 2015-07-02 15:09:07 -07:00
Howard Hinnant
26bfeb1319 Replace Serializer with Blob in SHAMapItem:
* This helps decouples SHAMap and Serializer.
* Restyle data member names.
* Rename getTag() to key().
2015-07-02 15:06:09 -07:00
Vinnie Falco
72659d431e Set version to 0.29.0-b7 2015-07-01 13:06:51 -07:00
Howard Hinnant
53dabe68ef Fix warning 2015-07-01 13:06:47 -07:00
Nik Bougalis
ccd6b46995 Fix shadowing 2015-07-01 12:34:00 -07:00
Vinnie Falco
91b3227a0f Fix canonicalization race in batch apply 2015-07-01 12:29:46 -07:00
Vinnie Falco
adebba94dc Set version to 0.28.2-rc3 2015-07-01 12:27:21 -07:00
Vinnie Falco
9d3b3f7a01 Fix canonicalization race in batch apply 2015-07-01 12:27:21 -07:00
seelabs
b354360bc0 Port DeferredCredits test to jtx and views 2015-07-01 13:45:56 -04:00
seelabs
8c24f7eb03 Account for deferred credits of parent views 2015-07-01 10:59:02 -04:00
Vinnie Falco
f473eade5a Set version to 0.29.0-b6 2015-06-30 19:52:28 -07:00
mDuo13
dc74a44b70 Update command-line usage message (RIPD-922) 2015-06-30 19:51:23 -07:00
Vinnie Falco
f96ac3db67 Refactor View, MetaView, and tx processing:
This tidies up the View interface and makes transaction
application a free function, with the removal of the
TransactionEngine class. A new class ApplyContext provides
all the state information needed to apply a Transactor. The
Transactor is refactored to perform all the processing
activities previously part of TransactionEngine.

The calculation of metadata from a MetaView is improved.
A new apply function performs all the steps for calculating
and inserting metadata into the tx map.

Transaction processing code path is passed a Config instead
of retrieving the global, and uses the Journal supplied in
the call to apply() consistently.

To support transaction processing and RPC operations, a
new POD type ViewInfo is added which consolidates static
information about open and closed ledgers, such as the ledger
sequence number or the closing times. Ledger and MetaView are
refactored to use this info.

The ViewInfo now contains the "open ledger" setting. The
tapOPEN_LEDGER ViewFlag is removed. The view property of
being an open ledger is obtained from the base or by using
the MetaView constructor which presents a closed ledger as
an open one.

View, MetaView:

* Fix missing includes
* Add apply free function
* Use Journal in TransactionEngine
* Use BasicView in TransactionEngine
* inline NetworkOPs::batchApply
* Add shallow_copy, open_ledger MetaView ctor tags
* Add ViewInfo with open flag, seq, close times
* Make parent_ a reference
* Tidy up ctor arguments and base_ name
* Remove tapOPEN_LEDGER
* add assert to MetaView::apply
* ViewInfo comment
* Throw, pass Journal in txInsert
* Add BasicView::txCount

TransactionEngine:

* Add apply
* Make TransactionEngine private
* Refactor MetaView::apply and apply()
* Rename to TxMeta
* Refactor treatment of metadata in MetaView, TransactionEngine
* Rename to ApplyContext
* Use ApplyContext& in Transactor
* Pass Config in ApplyContext
* Declare Transactor classes in headers
* Use view flags in Transactor
2015-06-30 19:26:02 -07:00
Vinnie Falco
b11b9939f4 Add contract interface 2015-06-30 12:29:58 -07:00
Vinnie Falco
e595fd5e02 Add JLOG macro 2015-06-30 12:29:57 -07:00
Vinnie Falco
af52276cd9 Set version to 0.29.0-b5 2015-06-30 11:33:45 -07:00
Vinnie Falco
2eec47415e Add enableTesting flag to applyTransactions 2015-06-30 11:33:45 -07:00
Vinnie Falco
4a2af70c2c Return tefEXCEPTION in TransactionEngine 2015-06-30 11:11:34 -07:00
Vinnie Falco
6211065802 Disable Websocket ping timer 2015-06-30 11:01:34 -07:00
Vinnie Falco
a338d9efe0 Return tefEXCEPTION in transaction engine 2015-06-30 10:59:39 -07:00
Vinnie Falco
e2ef423624 Disable Websocket ping timer 2015-06-30 10:56:48 -07:00
Nik Bougalis
0f8206e269 Set version to 0.29.0-b4 2015-06-29 17:19:52 -07:00
Nik Bougalis
4ccc3751d6 Remove unused function 2015-06-29 17:19:48 -07:00
Tom Ritchford
7ef6e58024 Tidy Json:
* Remove unused code.
  * Rename .inl file to .cpp.
  * Remove duplicate macros.
2015-06-29 17:11:17 -07:00
Vinnie Falco
57689c4e66 Refine View interfaces:
This shores up the View interface support for contextual
transaction processing by putting params in the View, and
provides support for replacing the open ledger with the
open MetaView.

Transaction metadata is now part of the View interface.
Stacked MetaViews correctly apply their transaction
metadata to the parent.

* Add lastCloseTime to View
* Add insertTx to View, implement in MetaView
* Add View::txExists for transaction checking
* Add Fees to View, cache fees in Ledger and MetaView
* Use ViewFlags in View
* Use tapENABLE_TESTING flag for features
* Use cached Fees in View
* Rename to ViewFlags
* Move FreezeHandling to View.h, remove ViewAPIBasics.h
* Remove BasicView::parent hack
* Remove calls to getLedger in Transactors
2015-06-29 17:06:48 -07:00
Nik Bougalis
2fc8d70655 Set version to 0.29.0-b3 2015-06-26 20:02:45 -07:00
Edward Hennis
7ee9f8513c Levelize RipplePathFind.h 2015-06-26 20:02:45 -07:00
Nik Bougalis
1a843fb4f6 Refactor consensus:
Classes implementing the consensus process on Ripple are cleaned
up in preparation for modularizations and compartmentalization.

Functions and state related to inter-round consensus are moved out
of NetworkOPs and into Consensus, where they are more effectively
isolated.

Some member functions are changed to free functions and some free
functions have their scope reduced to specific translation units.

* Track inter-round consensus state using new Consensus object
* Devirtualize interfaces
* Reduce NetworkOPs, Consensus and LedgerConsensus interfaces
* Add comments
2015-06-26 20:02:45 -07:00
Tom Ritchford
9111ad1a9d Handle empty Json values:
* Replace Json::Value::isNull() and Json::Value::empty with operator bool()
2015-06-26 20:01:02 -07:00
Tom Ritchford
a5a9242f4e Handle empty strings in Json::Value::empty() 2015-06-26 20:00:44 -07:00
Nik Bougalis
3fcf4ae8b7 Set version to 0.28.2-rc2 2015-06-25 14:46:43 -07:00
Nik Bougalis
c3d34aaf4d Fix shadowing 2015-06-25 14:45:32 -07:00
Vinnie Falco
e4f585b7fe Set version to 0.29.0-b2 2015-06-25 11:17:10 -07:00
Tom Ritchford
e3ac1001be Tidy up locks and locals. 2015-06-25 11:17:09 -07:00
Tom Ritchford
67f2a5d9d6 Remove duplicate and shadow variables. 2015-06-25 11:17:09 -07:00
Edward Hennis
89b9fa0b35 Fix shadowing 2015-06-25 10:57:03 -07:00
JoelKatz
4c0de726c8 Require longer delays before disconnecting peers 2015-06-25 10:55:59 -07:00
JoelKatz
7d96075e14 Avoid lock overlap:
Prefer to release the InboundLedgers lock before acquiring
a lock on a specific ledger
2015-06-25 10:55:40 -07:00
JoelKatz
924a8cdd4b Rework of InboundLedgers::mRecentFailures:
This provides more precise tracking of failed ledger acquires
and more useful information in fetch_info.
2015-06-25 10:55:36 -07:00
Miguel Portilla
b27d078c67 Path finding unit tests (RIPD-731)
Conflicts:
	src/ripple/app/paths/tests/Path_test.cpp
	src/ripple/unity/app_paths.cpp
2015-06-25 10:54:45 -07:00
JoelKatz
c64ec9cfb9 Use continuation in legacy pathfinding:
Handle legacy (ripple_path_find) requests that don't specify a ledger
the same way regular path_find requests are. This provides a
performance improvement for these requests and reduces the problem
of server busy errors.

Conflicts:
	src/ripple/app/paths/PathRequest.cpp
2015-06-25 10:32:04 -07:00
JoelKatz
3d6e76046c Always use co-routines:
This permits RPC handlers to suspend and reschedule:
2015-06-25 10:30:06 -07:00
Vinnie Falco
48d6a4ab6a Refactor MetaView (RIPD-954):
Obsolete functionality is removed. DeferredCredits is moved
to a new class PaymentView, and used in RippleCalc.
2015-06-25 10:27:15 -07:00
JoelKatz
f535304e1b Use new MetaView functionality in RippleCalc (RIPD-954):
RippleCalc is changed to stack views when calculating results
instead of making a copy of the MetaView, improving efficiency.
2015-06-25 10:23:36 -07:00
Vinnie Falco
2f485672fa Refactor AccountID (RIPD-953):
All AccountID functionality is removed from RippleAddress and
replaced with free functions. The AccountID to string conversion
cache is factored out as an explicit type with an instance in
the Application object. New base58 conversion functions are used,
with no dependence on OpenSSL.

All types and free functions related to AccountID are consolidated
into one header file. Routines to operate on "tokens" are also
introduced and consolidated into a single header file.

A token one of the cryptographic primitives used in Ripple:

    Secret Seed
    Server Public Key
    Server Secret Key
    Account ID
    Account Public Key
    Account Private Key

    and these deprecated primitives:

    Account Family Seed
    Account Family Generator
2015-06-25 09:05:06 -07:00
Vinnie Falco
63d438c979 Add digest.h and protocol digest classes 2015-06-24 16:28:36 -07:00
Vinnie Falco
c955c03197 Add SHA256 and RIPEMD-160:
* Renamed files to reflect digest family names
* Add SHA256 to SHA2
* Add RIPEMD-160 to RIPEMD
* Reduce duplicated code
2015-06-24 16:28:35 -07:00
Vinnie Falco
ceff6bc271 Set version to 0.29.0-b1 2015-06-22 19:32:26 -07:00
seelabs
80a5f5878f Add offer jtx test 2015-06-22 19:32:26 -07:00
Howard Hinnant
1e6111c09c Make the data of a SHAMap const:
* Hold a shared_ptr<SHAMapItem const> instead of a shared_ptr<SHAMapItem>.
* Compiler helps us enforce data immutability.
* Make SHAMapAbstractNode::addRaw const

Conflicts:
	src/ripple/app/ledger/Ledger.cpp
	src/ripple/app/ledger/Ledger.h
	src/ripple/app/ledger/LedgerHistory.cpp
	src/ripple/app/ledger/LedgerToJson.h
2015-06-22 18:39:33 -07:00
Vinnie Falco
d468deee12 Refactor Ledger and LedgerEntrySet:
Member functions and free functions on Ledger and LedgerEntrySet are
rewritten in terms of new abstract interfaces `BasicView` and `View`,
representing the set of non-decomposable primitives necessary to read
and write state map items in a ledger, and to overlay a discardable
view onto a Ledger that can calculate metadata during transaction
processing. const-correctness is enforced through the parameter and
return types.

The MetaView now supports multi-level stacking: A MetaView can be
stacked on top of either a Ledger or another MetaView, up to any
number of levels.

The getSLEi member function is removed. The CachedView wrapper
replaces it, wrapping a View such that any function called with a
CachedView will go through the SLECache.

* Add BasicView, View, CachedView
* Rename LedgerEntrySet to MetaView
* Factor out free functions
* Consolidate free functions in ViewAPI
* Remove unused class members and free functions
2015-06-22 18:39:33 -07:00
Vinnie Falco
e7eb3aa63d Set version to 0.28.2-rc1 2015-06-19 16:03:42 -07:00
JoelKatz
749f31f69d Tidy up SHAMap node handling of invalid wire formats 2015-06-19 16:03:42 -07:00
Vinnie Falco
2d6af1da1d Add SigningPubKey regression test 2015-06-19 16:03:42 -07:00
JoelKatz
6ec5fa9cae Fix null pointer in ec wrapper 2015-06-19 15:53:41 -07:00
JoelKatz
72832c0fa2 More robust call to get the valid ledger index 2015-06-19 15:53:32 -07:00
Vinnie Falco
7d329570f4 Set version to 0.28.2-b10 2015-06-18 15:35:48 -07:00
Edward Hennis
c334093223 jtx: Add ledger advance.
Conflicts:
	src/ripple/test/jtx/impl/Env_test.cpp
2015-06-18 15:35:46 -07:00
Edward Hennis
27274c9620 jtx: Add JTx properties. 2015-06-18 15:34:41 -07:00
Vinnie Falco
cd5e36045c jtx: json, memo funclets, fixes, improvements:
* Add json funclet
* Add memo funclet
* Add Env::trace
* Add PrettAmount regression test
* Fix PrettyAmount construction
* Make Env::trust balance-neutral
* Log parse errors during signing
2015-06-18 15:33:44 -07:00
Tom Ritchford
0062a260b9 Fix warning 2015-06-18 13:56:15 -07:00
Nik Bougalis
fdd2ea8feb Set version to 0.28.2-b9 2015-06-15 19:43:03 -07:00
Tom Ritchford
fbc1768784 Fix JobQueue synchronization. 2015-06-15 19:43:03 -07:00
Vinnie Falco
c53b9f3713 Add SHAMap::iterator 2015-06-15 19:43:03 -07:00
Vinnie Falco
eb709f415b Tidy up jtx:
* Tidy declaration order
* Remove AccountInfo
* Remove Env autofill settings
2015-06-15 19:43:02 -07:00
Vinnie Falco
9dd08e4dab Rename Account to AccountID 2015-06-15 19:43:02 -07:00
Tom Ritchford
e1cd1e9e32 Add header 2015-06-15 19:43:02 -07:00
Howard Hinnant
f875603525 Split SHAMapTreeNode into leaf and inner nodes.
* This reduces the memory requirements of both leaf and inner nodes.
* The name SHAMapTreeNode is retained for leaf nodes so as to keep
  the public API of SHAMap stable.
2015-06-15 19:43:02 -07:00
JoelKatz
e95ab65396 Improve peer send queue management:
* Disconnect peers on sustained large send queues
* Disconnect peers on sustained failure to pong
* Refuse some queries if send queue is at target
* Allow latency to exceed ping timer interval
2015-06-15 19:43:02 -07:00
JoelKatz
e0907ede4f GatewayBalances RPC command
RPC command to get a gateway's hot wallet balances
and total obligations.
2015-06-15 19:43:02 -07:00
Vinnie Falco
17020ffc54 Fix MSVC link 2015-06-15 19:43:02 -07:00
Nik Bougalis
abd05a6378 Set version to 0.28.2-b8 2015-06-13 21:02:51 -07:00
Vinnie Falco
189592938a Improvements to jtx framework:
This adds "require" functionality which allows invariants
to be checked after processing transactions using a simple,
terse interface. Also adds more comprehensive test coverage
for the framework itself, verifying that the more sophisticated
language constructs work in all ways.

All functions and classes have been split up into individual
files which may be included a-la carte, or accessed through
a single convenience header <ripple/test/jtx.h>

* Move, rename all sources
* Put everything in the jtx namespace
* Add sendmax funclet
* Rename funclet to paths
* Correctly set input issue and destination amount in path
* Conditionally invoke funclets using is_call_possible
* Add any() function means "any currency they will accept"
* Add None, none modifiers on amounts to mean "no amount"
* Add require conditions to JTx
* Add Env::require variadic condition checker
* Add le, rename some items for consistency
* Add require functors, balance, flags, nflags
* Add require functors lines, owners, offers, tickets
* Add ticket example of extending the system
* Add noripple modifier for funding accounst
* Add Env::st to parse Json into STTx
* Add tests to ensure correctness of fund()
* Add virtual Env member hooks
* Add Env::balance
* Add Env::seq
* Add PrettyAmount
* Add all container Account support
* IOU and XRP return PrettyAmount amounts
* IOUs print the issuer's name instead of base58
* Fix int and double conversions to XRP
* Fix autofill of Env::fund with noripple
2015-06-13 21:02:51 -07:00
Vinnie Falco
4f34724c5a Conditionally enable tickets at run time 2015-06-13 21:02:51 -07:00
Vinnie Falco
e958f72ba9 Convert to bool in suite::expect 2015-06-13 21:02:51 -07:00
Vinnie Falco
5c5b121b62 Add is_call_possible 2015-06-13 21:02:50 -07:00
Vinnie Falco
d21171b21e Refactor LedgerEntrySet:
* Remove duplicate:
    This changes behavior to fix an apparent bug. The
    copy will now correctly inherit mParams instead
    of reverting to tapNONE

* Tidy up LedgerEntrySet declarations
* Tidy up TransactionEngine
* Tidy PathCursor declarations
* Add LedgerEntrySet::apply
* Add LedgerEntrySet ctor
* Add Keylet, keylet namespace
* Add defaulted copy members
* Use optional in TransactionEngine
* Use optional<LedgerEntrySet> in PathState
* Return shared_ptr in Ledger::fetch
* Don't call entryCache with zero
* Deprecate invalidate
* Remove default constructor
* Remove unused container API
* Remove CountedObject base class
* Remove insert, clear
* Remove entryCreate overload
* Remove unused and tidy up STLedgerEntry
* Make getEntry private and tidy
* Replace members with adjustOwnerCount free function
* Replace accountFunds with funds free function
2015-06-13 21:02:50 -07:00
MarkusTeufelberger
aead038215 Fix docs 2015-06-13 12:02:28 -07:00
Nik Bougalis
a16c07c78a Remove unused NodeIdentity table fields 2015-06-13 12:02:22 -07:00
Nik Bougalis
3aebabce3d Revert "Enable EDH only for anonymous SSL contexts":
The issue was caused by client-side functionality added to IE
to protect against LOGJAM. By properly supporting larger keys
we no longer need to disable Ephemeral DH.

This reverts commit 3028ffd083.
2015-06-13 11:55:03 -07:00
JoelKatz
7239bcf0b7 Support larger EDH keys:
In the past we used only 512-bit EDH keys. To protect against the
LOGJAM attack, OpenSSL 1.0.1n and later versions reject EDH keys
that are less than 768 bits and a future version will increase the
minimum to 1024.

We now have DH parameters for 1024-bit and 2048-bit EDH keys and
will correctly return and use those, when asked. Note that at this
time, OpenSSL will only ask for 512 or 1024 bit keys.
2015-06-13 11:55:03 -07:00
Tom Ritchford
623faa1550 Fix warning 2015-06-13 11:55:03 -07:00
Nik Bougalis
60fad25476 Beast clean up:
* Remove binding, dispatch handling and exit hooks in favor
  of std alternatives; remove crash-handling infrastructure,
  error message framework, system-specific process handling
  and Objective-C interop helpers.
* Simplify Beast function profiling
* Simplify beast::Time interface
* Simplify beast::String interface
* Simplify beast::File interface
2015-06-13 11:55:03 -07:00
Tom Ritchford
d06e07ef0e Correctly compare JSON values. 2015-06-13 11:55:03 -07:00
Mark Travis
ca800f9e8d Batched transaction application:
Applying multiple transactions to the open ledger
reduces SHAMap modification overhead.
2015-06-13 11:53:45 -07:00
Nik Bougalis
4225b78bf5 Set version to 0.28.2-b7 2015-06-10 16:02:29 -07:00
Nik Bougalis
8c68eff460 Cleanup object templates:
* Avoid exposing class members - use boost::iterator_range instead
* Use std::make_unique instead of naked new
2015-06-10 15:59:52 -07:00
Tom Ritchford
c2814308f1 Remove unused parameters to accountFromString. 2015-06-10 15:56:24 -07:00
Nik Bougalis
f237187b0d Remove cache sweep profiling 2015-06-10 15:55:05 -07:00
Nik Bougalis
187b4caf3c Add logging support to Taker:
Log progress during offer crossing and flow calculations to
allow for easier debugging and transaction analysis. All
logging is done at debug and trace level and will normally
not be visible.
2015-06-10 15:54:27 -07:00
Tom Ritchford
b8526f7894 Allow RPC yield to be a continuation. 2015-06-10 15:54:07 -07:00
Tom Ritchford
b2b0377717 New method JobQueue::getJobForThread().
* Clean up mutability.
* Add override specifiers.
* Get rid of unused parameters.
2015-06-10 15:53:59 -07:00
Nik Bougalis
24ea1ab035 Parse pathsets when accounts are specified in hex 2015-06-10 15:53:04 -07:00
Nik Bougalis
e980e69eca Acquire logic fixes:
In InboundLedgers::acquire, properly return a ledger if we are
able to create one immediately.

In LedgerMaster::walkHashBySeq, don't walk the whole ledger if
we already know we have it.
2015-06-10 15:52:48 -07:00
Vinnie Falco
2904add428 Set version to 0.28.2-b6 2015-06-08 17:25:17 -07:00
Vinnie Falco
babaac9305 Refactor Ledger and support classes:
This performs a deep refactor on the Ledger class and its supporting
classes, in preparation for the move to shared_ptr<SLE const> in
places where the SLE is immutable and we are currently using
shared_ptr<SLE>.

Member functions are converted to free functions, the SLECache is an
explicit parameter, one line convenience functions are removed to
streamline the interface. Some callers are changed to use <SLE const>
instead of <SLE>

SLECache:
* Moved to its own header file

RippleState:
* Remove unused functions
* Store the SLE as const
* Simplify callers

AccountState:
* Remove unused members
* Simplify existing members

Ledger:
* Replace writeBack with insert and update
* Remove unused functions
* Remove LedgerStateParams
* Move getLastFullLedger to Application
* add entryCacheI, exists, fetch, erase
* Use boost::optional where it makes sense
* Make member functions free functions

Free functions:
* fetch: cache-aware SLE retrieval
* forEachItem, forEachItemAfter
* (various)
2015-06-08 17:25:16 -07:00
Vinnie Falco
454d2f8c45 Add SHAMap::fetch returning SHAMapItem const 2015-06-08 15:38:19 -07:00
Howard Hinnant
5d42d52660 C++14 readiness 2015-06-08 15:38:19 -07:00
Edward Hennis
a0e87c7aee ConnectedAddresses stores Addresses to avoid port issues.
* Also change log level on a couple of Overlay messages.
2015-06-08 15:07:06 -07:00
Edward Hennis
49c4ec6f93 Travis build unity and nounity. 2015-06-08 15:06:28 -07:00
Nik Bougalis
eb0ece417d Fix move sequencing 2015-06-08 15:05:33 -07:00
seelabs
7b5bf7f129 Add support for scons ninja backend 2015-06-08 15:05:20 -07:00
Vinnie Falco
ab8ffc1a00 Set version to 0.28.2-b5 2015-06-02 18:00:31 -07:00
Vinnie Falco
64c8335e22 New Env transaction testing framework:
This adds a suite of tools used to write unit tests. The Env provides
a context containing a ledger, and routines that assemble transactions
from JSON with optional "funclets" that add details in an exensible, terse
notation.
2015-06-02 18:00:31 -07:00
Vinnie Falco
4cfffdf76f Add pretty(Json::Value) 2015-06-02 16:52:23 -07:00
Vinnie Falco
8adc4c1e3c Add rpcErrorString function 2015-06-02 16:52:22 -07:00
Vinnie Falco
02c118981f Add jss fields 2015-06-02 16:52:22 -07:00
Vinnie Falco
4825cefbf8 Add strHex(Slice) 2015-06-02 16:52:22 -07:00
Vinnie Falco
4b91a18532 Remove linefeed from JSON to string conversion 2015-06-02 16:52:21 -07:00
Vinnie Falco
ff2453e42c Add missing include 2015-06-02 12:55:25 -07:00
Vinnie Falco
269ad321e6 Allow multi-sign to be enabled at runtime:
This lets unit tests exercise multi-sign interfaces
without having to set RIPPLE_MULTI_SIGN_ENABLE.
2015-06-02 12:55:25 -07:00
Vinnie Falco
8be4e7e65f Refactor Serializer, SerialIter, SHAMapItem, NodeObject:
* Make LessThan private
* Make NodeObject::isSame private
* Remove hotTRANSACTION
* Remove some Serializer members
* Remove unused SHAMapItem::getRaw
* Remove unused STLedgerEntry::getOwners
* Remove Serializer constructors
* Remove unused Serializer members
* Remove SerialIter ctor
2015-06-02 12:55:07 -07:00
Vinnie Falco
c25184cc88 Add sha512Half and SHA512HashHasher:
These routines replace existing code to compute SHA512-Half hashes.
The new code accumulates serialized data into a hashing context
instead of allocating a buffer, for improved performance.
2015-06-02 12:52:10 -07:00
Vinnie Falco
06823349f9 Tidy up Serializer:
* Remove getSHA512Half size parameter
* Remove unused Serializer::getSHA256
* Remove Serializer::getRIPEMD160
2015-06-02 12:49:30 -07:00
Vinnie Falco
e18c6f63cc Add SHA512 hasher:
* Remove unused SHA256
2015-06-02 12:49:30 -07:00
Vinnie Falco
36a864106d Update hash_append to latest draft specification 2015-06-02 12:49:30 -07:00
JoelKatz
3028ffd083 Enable EDH only for anonymous SSL contexts
Enabling EDH breaks compatibility with some versions of IE. Disabling
EDH is an acceptable workaround.
2015-06-02 12:49:11 -07:00
Nik Bougalis
a3d5a97df6 Remove unused old-style unity files 2015-06-02 12:48:44 -07:00
Mark Travis
52879d964e Revert "Reduce SHAMapTreeNode copying during SHAMap unsharing:"
This reverts commit 47c6ab0ced.
2015-06-02 12:48:30 -07:00
Vinnie Falco
aaf209485c Merge remote-tracking branch 'david/lz4' into develop 2015-06-02 12:47:51 -07:00
Scott Schurr
4515ac0bca Replace base_uint(string) with from_hex_text<> (RIPD-897)
Removes the base_uint constructor that took a string.  Replaces
that functionality with two free functions named from_hex_text<>.
Use of from_hex_text<> looks like this:

auto v = from_hex_text<uint256>("AAA555");
static_assert (std::is_same<decltype(v), uint256>::value, "Huh!");

from_hex_text<> only operates on base_uint types.  At the moment the
list of those types include:

 o uint128,
 o uint160,
 o uint256,
 o Directory,
 o Account,
 o Currency, and
 o NodeID.

Using from_hex_text<> with any other types will not compile due to
an enable_if.
2015-06-02 12:46:03 -07:00
seelabs
d7def5509d Remove temp_db (RIPD-887) 2015-06-02 12:45:29 -07:00
JoelKatz
4ff845ac91 Merge commit 'df26c08a34b4e07235d33fcd7e2fb311d83f069f' into HEAD
Synchronize LZ4 with upstream
2015-05-29 15:03:27 -07:00
JoelKatz
df26c08a34 Squashed 'src/lz4/' changes from e25b51d..baf78e7
baf78e7 Merge pull request #111 from Cyan4973/dev
6f50184 Updated NEWS
acae59a Fixed : default sparse mode disabled on stdout, to support ` >>`  redirection scenario reported by Takayuki Matsuoka (#110)
91c1b9a Performance fix : big compression speed boost for clang (+30%)
0fb0392 Merge branch 'dev' of github.com:Cyan4973/lz4 into dev
bb22103 Merge pull request #107 from t-mat/issue/103pr2
7d72c0c Added LZF
e769a0e Combine unique .lz4 file info
ffff9ee Support iterative edit and testing
a8fdeb4 Add log output of succeeded decompression to test script
5151c30 Add log of same files and sha1 hash of unique files to versionstest
26065c3 Fixed  : LZ4IO exits too early when frame crc not present, reported by Yongwoon Cho (#106)
87e560e minor tests improvements
a9ff13a minor test refactor
58b5aad Fixed sparse issue with non seekable streams (#105)
60d657a removed "flush" argument to please Travis's python version
cdb136d cosmetic changes, 2nd try
c779c80 minor cosmetic changes for Takayuki's testVersions
26021db Merge branch 'dev' of github.com:Cyan4973/lz4 into dev
e3b5bf3 Merge pull request #104 from t-mat/issue/103pr2
fe11e0b Issue #103 : Add compatibility test between releases
f02c467 Added a few more interoperability tests (32bits vs 64 bits)
05c3f66 Updated a few comments
9607848 Fixed minor typo
45e1995 minor introduction update
7d182b8 Merge pull request #102 from Cyan4973/dev
fdd0029 minor parsing update
672bfde Updated comments
b4ef93a Fixed typo
efbebd2 Added : LZ4_compress_destSize()
1c3e633 Added compilation flag -Wcast-qual
05b0aa6 Updated readme
e05088d Updated lz4hc API
b4348a4 Fixed minor Visual warning
1171303 Updated streaming examples
1b17bf2 New lz4 API, using LZ4_compress_fast()
b495c91 Merge pull request #99 from eberge/dev
791512c Fixed bug 9318
2a974d7 refactored lz4hc
1e751a7 Install the lz4frame.h header in the cmake build
ad2dd6d moved lz4frame context types to incomplete typedef
c9cbb8f Increased aligment requirement for lz4frame context pointer
ef55dfb Modified lz4frame context typedef, to enforce stricter alignment condition
87a1c70 Fixed minor static analyzer warning
d6dc0a4 streaming API : Improved ring buffer management
bda38fd Merge pull request #98 from eberge/dev
a9a24e8 cmake support for AIX, HPUX, Solaris and Windows
9c6fb8b Added LZ4_compress_fast_extState()
b05d3d7 Frame content size disabled by default when using LZ4F_compressFrame(), to be in better coherence with the advanced API LZ4F_compress_update()
b805d58 Removed obsolete functions from lz4 cli
f11afaf Removed LZ4_compress() (obsolete) from lz4
72e6794 Updated LZ4F_freeDecompressionContext(), to provide stage hint as result
a01e10d Changed LZ4F compressionLevel from unsigned to signed, in anticipation for LZ4_compress_fast() integration.
cbcdd88 Fixed frame concatenation
e18aa90 Fixed frametest
c035b7a Restored make-lz4
197982e Fixed unfinished frame (issue #75)
409f816 Updated LZ4F_getFrameInfo() behavior, related to uncomplete frame header decoding attempts
47c3040 added --no-sparse test
9fd4f1f Sparse file support is now enabled by default
7644bee test error message in multiple files mode
bce2eeb Reclassified some notification messages as errors
9e92bee stronger arm tests
2ed9dcc fix minor "divide by zero" risk
633c1ca fixed minor leak
0ed2e71 Static analyzer generates error codes on bug suspicion
2cf8a19 minor header refactoring
634e4ee Merge pull request #96 from t-mat/improve-pr-95
e328d41 minor optimization for small files
13c6e16 Removed status notification in multiple-files mode
d153aaa Add LZ4F_OBSOLETE_ENUM() to describe obsolete enums
a430b85 Multiple files decompression refactoring
4e574e7 Updated lz4frame error names
d37926b Merge pull request #95 from t-mat/issue/90
240b554 Merge pull request #94 from t-mat/dev
3d46d4b Fix LZ4_DEPRECATED() in lz4hc.h
5f732e1 Merge pull request #91 from t-mat/dev
175890f Issue#90 : Change old enum names to new one
585bab8 Issue#90 : Change old enum to macro to maximize compatibility
081bcca Issue#90 : Add LZ4F_ prefix
e1283c7 Fix LZ4_DEPRECATED() for older/non-gcc/clang/MSVC compilers
d7298d2 Replace GCC_VERSION with LZ4_GCC_VERSION
9851583 Merge pull request #93 from drcrallen/descriptiveFrameErrors
b664a72 Revert "Revert "Add more descriptive frame errors""
3f4f623 Valgrind tests generate errors
83e350d Merge branch 'dev' of github.com:Cyan4973/lz4 into dev
066e9d3 Merge pull request #92 from Cyan4973/revert-89-descriptiveFrameErrors
5a66527 Revert "Add more descriptive frame errors"
0dc8308 Merge pull request #89 from drcrallen/descriptiveFrameErrors
05a46fc Changes LZ4F_compressBound() definition using NULL prefsPtr to cover worst case instead of default.
348f509 lz4io refactoring
eabc6d8 New valgrind test with multiple files
113b150 Fix leak issue with compression of multiple files
c64200d Improved performance when compressing a lot of small files
cc24124 minor compatibility fixes
ccba7a0 Merge pull request #86 from KyleJHarper/origin/r129/multiple_inputs_patch
d535214 Add more descriptive frame errors
bc28fc1 Merge pull request #87 from t-mat/fix-example2
fd77bad Replace obsolete functions
b036eaa Add snprintf macro for MSVC
7f2f1fc Added support for continuation of file compression and decompression if input files are missing.  Should more closely match gzip/bzip2/xz and so forth.  Also removed a debug print accidentally left in.
0169502 Added new LZ4IO_decompressMultipleFilenames to allow decompression of multiple files with the -m switch added in r128 (ref: google code issue 151).  Limitation: will only process files matching LZ4_EXTENSION macro, which for now seems reasonable.
da11725 new memory leak test for fullbench using multi-files
2c79887 Shortened tests durations
42e5bc4 Updated badges
2852b9e Fixed issue #84
8f49666 Fixed : minor coverity warning
8a61000 Fixed a few coverity warnings
138673d fixed minor g++ warning
cc8d617 Merge pull request #82 from t-mat/add-lz4-prefix
81fdd9d Fixed a few Valgrind warnings
ad86910 Add LZ4 prefix to deprecation macros
66b8a4a Fixed : minor Visual warnings
62ed153 Fixed : a few minor coverity warnings
9443f3d Extended obsolete warning messages to lz4hc
973e385 Implemented obsolete warning message
be9d248 Update lz4hc API : LZ4_compressHC_safe()
a07db74 Clarified lz4frame.h inline doc
8b8e5ef fixed minor sanitize warning
c22a0e1 Updated : fuzzer tests can be programmed for a timelength
a2864fd Fixed a few minor sanitize warnings
33134fb Added : sanitize test
f344fbd Fixed a few warnings from -fsanitize=undefined
2f8a4c3 New LZ4_compress_safe() API
1853622 fixed over-cautious visual warning
b41137f minor Makefile test refactoring
327cb04 minor memory leak fix and test
43e0535 fix g++ typecast
61d7416 updated doc
17f8614 added : memtest on fullbench
d38b0b6 Merge pull request #73 from funcodeio/dev
979a991 memcpy speed as reference
157a739 Merge pull request #74 from Cyan4973/fastMode
dd69902 Removed unused lines.
43eaf8f Merge pull request #72 from fzort/master
f72761f new tests for large files with content size support (#70)
90c0104 Added : progress indicator, in fast and decompression modes
1d3ab5d Cygwin has fileno, so there's no need to use _fileno.
78d2dfd fullbench : tests of _limitedOutput variants intentionnally provides less memory space than safe (LZ4_compressBound())
ef7cd83 Fixed issue 160, reported by Eric Berge
28e237e simplified LZ4_compress_limitedOutput()
89eee0d Removed make dist
0615eb4 Stricter tests : treat warnings as errors
76a03c1 simplified LZ4_compress_withState()
6625068 simplified LZ4_compress()
886b199 Modified files rights
7b5e945 Removed Visual 2013 solution, as AppVeyor automated mode only works with a single solution
117ab8c Added : Visual 2013 solution
08b24af Updated Visual 2012 solution : + 3 projects (fullbench, frametest, datagen)
a761546 Fix : minor warning under Visual
bf146ec Removed .suo & .user files from Visual solutions
7db6678 Restored proper credit
3bba55c Fixed : Windows compilation Added : Appveyor badge
160661c Merge pull request #69 from Cyan4973/dev
8437a0e Fixed : Visual compilation
7c26b03 Updated make dist
f174964 Added : Frame documentation in MarkDown format
880381c Removed HTML Frame Format documentation
5b9fb69 minor tweak
4783cb8 Updated readme
4c227a4 Added LZ4_compress_fast()
003af71 Merge pull request #67 from Cyan4973/dev
2a82619 fixed fullbench memory allocation error
6c69dc1 faster compression in 64 bits mode
44793b8 Updated documentation
b93f629 changed file name
eeb8bea Updated comments on LZ4F_getFrameInfo()
002ec60 restored lz4hc compression ratio
987e78c Merge pull request #66 from Cyan4973/dev
8cb06d5 lz4frame validates contentSize during decompression
d5da787 Changed struct member to contentSize
2d4fed5 Merge pull request #65 from Cyan4973/dev
ce71b07 converted to markdown friendly syntax
1ba37f3 Reference format doc
5780864 Fixed : Makefile
b009767 windows friendly make clean
27f7d06 minor beautifier (make clean)
b4755c7 Added : arm cross-compilation test
a357f43 Fixed cast-align warnings on 32-bits
4a9335b Added : doc authorship
e652285 Merge pull request #63 from t-mat/comment-on-example-directory
2af52a9 Add "Examples" subtree
679afea Add README.md as table of contents
19665c9 Add document for "Line by Line Text Compression" example
438fee9 Add document for "Double Buffer" example
a38166b Add document : "Streaming API Basics"
80e71c6 Updated man page : "--[no-]X"
5950f72 Updated tests
6b923d5 Updated long commands, with reverse "--no-" variants
d0f8d40 updated dist list
00c3208 Merge pull request #61 from Cyan4973/dev
7f436a1 lz4 cli supports frame content size
a28b147 removed useless man pages
7cf4e5c Updates tests & Man pages
f02adc7 new long commands
86715b2 Some more tests related to frame content size
7ee7256 frame content size support
7d87d43 Updated lz4io sparse file support (alignment properties)
b54d256 minor lz4frame optimisation (no more malloc() on using LZ4F_compressFrame() in fast mode)
da9402c minor lz4frame refactoring
859fe3b Updated LZ4 frame format documentation
8edb7f1 Added : Readme into lib directory, to explain what does each file
e7fb4d1 lz4 utility supports "pass-through" mode
2a02455 minor refactoring
3a68324 skippable frames support
93849d1 minor CMakeLists update
471eabe Merge pull request #60 from Cyberunner23/master
ef029a1 Removed checking of CMAKE_SYSTEM_PROCESSOR when adding -fPIC, breaks when that var is '64bit'.
c9a2b14 removed -s command from lz4c specific list of legacy commands
207aafd Added :  unlz4 symbolic link to "lz4 -d"
2b55752 changed "make install" default install directory to /usr/local
bbcfe21 Added : clang test
8a87769 Fix : static analyzer test on Travis
45b0642 scan-build tests
a18fb43 Merge pull request #58 from Cyan4973/sparseFile
248b761 windows sparse file support
d11ac40 Improved sparse files support
45a357f Improved sparse file support
e38c268 Fixed minor g++ warnings
12ab415 Preliminary support for sparse files
e3f33d2 Fixed minor warnings
74a6b14 Merge pull request #57 from alexDarcy/master
f2cc4be Updated Cmake configuration for non-gnu compiler
ceec6fa g++ compatibility
6b0c39b Updated datagen (can create sparse files)
e277511 Merge pull request #54 from t-mat/gc-issue/155
e1d9b59 Fixed : static library (x64 binary)
32a85fc NetBSD compatibility (#48)
488029e Updated : compress multiple files
046bd3a Merge pull request #52 from KyleJHarper/r128/multiple_inputs
dcdd628 Fix sentinel bit pattern
de5c930 Fix sentinel size miscalculation
eed7952 Add GNU coreutil's is_nul() method to isSparse()
b372f45 Add Neil's method to isSparse()
01a24af Improve isSparse()
4a5d92b Adjust coding style
97679fa Google Code Issue 155: lz4 cli should support sparse file https://code.google.com/p/lz4/issues/detail?id=155
fa27d23 Added support for multiple input files to act more like other compressors. For example: gzip file1 file2 file3. You can now do: lz4 [args] -m file1 file2 file3. Fixes 151.
67f3b41 Merge pull request #49 from t-mat/msvc-fseeki64
e68d1c9 restored lz4 hc compression ratio
41b6ed3 Replace fseek with _fseeki64 to avoid MSVC's 2GiB barrier
8f4e201 Fix : lz4frame.h within uninstaller
9fd92de Added : Visual project directory

git-subtree-dir: src/lz4
git-subtree-split: baf78e7e4dcbdf824a76f990ffeb573d113bbbdb
2015-05-29 15:03:27 -07:00
Tom Ritchford
e9d147f4b8 Set version to 0.28.2-b4 2015-05-29 13:45:23 -04:00
Tom Ritchford
f1a1ef49d5 Remove duplicate types. 2015-05-29 13:45:16 -04:00
Tom Ritchford
fd03c3297c Fix dangling pointer in websocketpp/error.hpp. 2015-05-29 13:45:07 -04:00
wilsonianb
ffd2e884f2 Clean up LedgerConsensus log message
Add missing space and use consistent pluralization.
2015-05-29 13:44:59 -04:00
Nik Bougalis
0d700d9833 Unsubscribe from normal data feeds on destruction 2015-05-29 13:44:52 -04:00
Nik Bougalis
dd902292ed Consensus cleanup:
* Inject dependencies, make functions free and levelize
* Add comments to document the intent behind the code
* Reduce class public interfaces
* Remove support for proposals without ledger hashes
2015-05-29 13:44:44 -04:00
seelabs
1b4e0f5f48 Tidying & Selectively forward manifests to peers:
* Do not forward manifests to peers that already know that manifest
* Do not forward historical manifests to peers
* Save/Load ValidatorManifests from a database
* Python test for setting ephmeral keys
* Cleanup manifest interface
2015-05-28 08:16:56 -07:00
Tom Ritchford
31d352b3aa Productionize manifest generator.
* Better output.
* Better error checking and reporting.
* Clearer names.
* Python style.
2015-05-28 07:22:34 -07:00
Tom Ritchford
c26b8124e5 Add original manifest.py. 2015-05-28 07:22:34 -07:00
Tom Ritchford
6bf7de2415 Add ecdsa Python library. 2015-05-28 07:22:33 -07:00
Tom Ritchford
18c51f4e4a Add ed25519 Python library. 2015-05-28 07:22:33 -07:00
Tom Ritchford
adf4860988 Move Python code to its own directory. 2015-05-28 07:22:33 -07:00
Josh Juran
0dd6b95ac2 Add Validator Manifests (RIPD-772):
A Validator Manifest allows validators to use a generated ed25519
secret key as a master key for generating new validator public/secret
key pairs. Using this mechanism, rippled instances trust the master
ed25519 public key instead of the now-ephemeral validator public key.

Through a new message and propagation scheme, this lets a validator
change its ephemeral public key without requiring that all rippled
instances on the network restart after maintaining the configuration
file.
2015-05-28 07:22:32 -07:00
Vinnie Falco
41a840e776 Tidying:
* Add missing includes
* Use preincrement
* Rearrange some declarations
* Fix some comments
2015-05-28 07:21:08 -07:00
Josh Juran
7d75041fb1 Fixes to cryptographic containers:
* Include Sign.cpp in unity builds
* Fix AnySecretKey publicKey and sign
* Make AnyPublicKey copyable
* Define op != for Slice
* Overload op << for Slice
* Overload op << for KeyType
2015-05-27 13:25:20 -07:00
Vinnie Falco
6675ee7f5c Set version to 0.28.2-b3 2015-05-22 11:12:44 -07:00
Howard Hinnant
155fcdbcd0 Change typedef to using.
Conflicts:
	src/ripple/app/TODO.md
	src/ripple/app/ledger/Ledger.h
	src/ripple/protocol/Protocol.h
2015-05-22 11:09:50 -07:00
Vinnie Falco
52f298f150 Tidy up app unity sources 2015-05-22 10:58:16 -07:00
Vinnie Falco
860ab3523c Refactor Ledger:
* Consolidate constructors
* Use pointer/size instead of Serializer
* Factor out PendingSaves
* Make some members free functions
* Reduce size of constructor initializer lists
2015-05-22 10:58:04 -07:00
Nik Bougalis
36ac3bc672 Set version to 0.28.2-b2 2015-05-21 14:51:46 -07:00
crazyquark
fc9ab12bf9 Add build instructions for Eclipse CDT + SConsolidator plugin. 2015-05-21 14:51:46 -07:00
Miguel Portilla
b39c1eb92c Require port in ips (RIPD-893) 2015-05-21 14:51:46 -07:00
JoelKatz
6994423a49 Don't consider broken peers candidates for history 2015-05-21 14:51:46 -07:00
JoelKatz
172e967a73 Latency-aware fetch pack target selection 2015-05-21 14:51:46 -07:00
Nik Bougalis
6f5d8bba2d Reduce STAmount public interface (RIPD-867):
* Implement subtraction as addition to the additive inverse
* Do not allow comparison with, addition to or subtraction from integers
* Remove unused functions
* Convert member functions to free functions
* Isolate unit-test specific code into the unit test
2015-05-21 14:51:41 -07:00
Nik Bougalis
67b18e4bea Check the fee early and return an error if it's malformed 2015-05-21 14:50:49 -07:00
Vinnie Falco
e932ba591f Set version to 0.28.2-b1 2015-05-20 13:24:13 -07:00
Vinnie Falco
f58399d2f3 Reduce thread count in static_initializer test (RIPD-864) 2015-05-20 13:24:13 -07:00
Nik Bougalis
730cd5d513 Cleanup consensus helper functions:
* Reduce public class interfaces
* Use free functions when possible
* Add self-documenting function return values
* Simplify ledger close resolution calculations
2015-05-20 13:24:12 -07:00
Edward Hennis
e838b30def Integration test to validate the WS ledger results.
* Also replace a couple of magic values with the relevant Tuning param.
2015-05-20 13:24:12 -07:00
Howard Hinnant
dddcc09378 Restrict access to data members. 2015-05-20 13:24:12 -07:00
JoelKatz
5adb68bba4 Easier way to get the validated ledger index 2015-05-20 13:24:12 -07:00
Scott Schurr
d6ef66646f 2-level transaction multi-signatures (RIPD-182):
This commit provides support for 2-level multi-signing of
transactions.  The ability is usually compiled out, since other
aspects of multi-signing are not yet complete.

Here are the missing parts:

 o Full support for Tickets in transactions.
 o Variable fees based on the number of signers,
 o Multiple SignerLists with access control flags on accounts,
 o Enable / disable operations based on access control flags,
 o Enable / disable all of multi-signing based on an amendment,
 o Integration tests, and
 o Documentation.
2015-05-20 13:24:06 -07:00
Scott Schurr
cf1638e6de sign_for RPC command (RIPD-182):
The sign_for RPC command returns a field suitable for
signing a multi-signed transaction.  Actual multi-signed
transactions are in the next commit.
2015-05-20 13:23:59 -07:00
Scott Schurr
64ebd64d2b SignerListSet txn and InnerObjectFormats (RIPD-182):
Add support for the SignerListSet transaction as a step toward
multi-sign support.

As part of the SignerListSet implementation, add InnerObjectFormat
templates (similar to TxFormats and LedgerFormats) and enforce them
in STObject, STArray, and STParsedJSON.
2015-05-20 13:23:52 -07:00
Scott Schurr
92799187ed Improvements to protocol serialization:
A few serialization changes coming from m-of-n development:

 o Improve readability of SField.cpp.
 o Better initialization of STObject.
 o Trimming of STObject public methods.
 o Add STObject::getFieldObject and STObject::setFieldObject.
 o Make STObject::isEquivalent more robust.
 o Improvements to whitespace, overrides, and virtuals.
2015-05-20 12:34:20 -07:00
Vinnie Falco
2f3834359e Modularize app/tx:
* Move LedgerView declaration
* Move CrossType
* Move Clock declaration
* Move Quality to protocol/
* Move Amounts to protocol/
* Move book to tx/impl
* Remove 0.27 legacy support
* Remove unused AmountType
* Remove core namespace
* Use STAmount
2015-05-20 12:34:19 -07:00
Miguel Portilla
399c43cae6 Set version to 0.28.1 2015-05-20 13:34:29 -04:00
Tom Ritchford
80acbe6f6b Change ArchLinux/PKGBUILD to have correct ripple build line. 2015-05-20 13:29:54 -04:00
Miguel Portilla
d90ba775e8 Require port in ips_fixed (RIPD-892) 2015-05-20 13:24:21 -04:00
Miguel Portilla
ea4161d880 Change example configuration protocol on loopback IP (RIPD-886) 2015-05-20 13:24:04 -04:00
Torrie Fischer
172a060330 circle: docker: Don't tag branches if its a PR (PKG-33) 2015-05-20 13:23:38 -04:00
Nik Bougalis
231efb5aa5 Set version to 0.28.1-rc3 2015-05-18 13:00:15 -07:00
JoelKatz
079475e491 Only touch InboundLedgers on success so failed acquires can expire 2015-05-18 13:00:15 -07:00
Tom Ritchford
aa775b4d3d Clean up rippled-example.cfg and update for new node_db settings 2015-05-18 13:00:00 -07:00
Nik Bougalis
216c8125e2 Expedite zero flow handling 2015-05-18 12:52:03 -07:00
Vinnie Falco
c61d0c663e Merge branch 'master' into develop 2015-05-13 13:29:54 -07:00
Nik Bougalis
0187c6a5a1 Set version to 0.28.0-hf2 2015-05-13 13:21:32 -07:00
Nik Bougalis
8289d4140a Correctly clamp when the taker balance is the limiting factor 2015-05-13 13:21:26 -07:00
Vinnie Falco
c7118a183a Set version to 0.28.1-rc2 2015-05-13 12:41:04 -07:00
JoelKatz
b1881e798b Control query depth based on latency:
This changes TMGetLedger protocol in a backward-compatible way to include
a "query depth" parameter - the number of extra levels in the SHAMap tree
that a server should return in the corresponding TMLedgerData. Depending
on the value or absence of the field, a server may adjust the amount of
returned data based on the observed latency of the requestor: higher
latencies will return larger data sets (to compensate for greater
request/response turnaround times).
2015-05-13 12:40:16 -07:00
Nik Bougalis
d44230b745 Correctly clamp when the taker balance is the limiting factor 2015-05-13 12:40:09 -07:00
Vinnie Falco
7b417b9d51 Set version to 0.28.1-rc1 2015-05-12 17:21:48 -07:00
Vinnie Falco
cc05e5727d Merge release into develop 2015-05-12 17:20:43 -07:00
Vinnie Falco
764a8f2644 Set version to 0.28.1-b10 2015-05-12 12:47:56 -07:00
JoelKatz
a15785eb64 Reduce severity of some logging messages 2015-05-12 12:47:56 -07:00
Vinnie Falco
688f8c5f3f Add historical ledger fetches per minute to get_counts 2015-05-12 12:47:56 -07:00
Vinnie Falco
dde5ccf7fa Add DecayWindow implementation 2015-05-12 12:47:55 -07:00
Vinnie Falco
d5a6313c71 Add RangeSet::lebesgue_sum 2015-05-12 09:50:12 -07:00
Vinnie Falco
f030aab759 Set version to 0.28.1-b9 2015-05-11 18:14:45 -07:00
JoelKatz
4393f98a2c History fetch changes:
* Don't pollute ledger cache with history
* Avoid race condition when getting ledger sequence numbers
* Make fetch packs larger
2015-05-11 18:14:45 -07:00
JoelKatz
c377d6c94b InboundLedgers improvements:
* Change findCreate to acquire
* Return Ledger rather than InboundLedger
2015-05-11 18:14:45 -07:00
JoelKatz
16aa015682 Fix off-by-one error in SHAMapNodeID:
Limit is 64 inner nodes at depth 0-63, and one leaf at depth 64
2015-05-11 18:14:45 -07:00
Miguel Portilla
9cded76cf0 Fix RPC ledger synchronization requirements:
* Better rules specific to each lookup case:
* By hash: Any ledger found by hash is valid.
* By numeric index: If rippled is out of sync, and the index is after the
* validated ledger, return "InsufficientNetworkMode" error.
* By named index: If rippled is out of sync, or closed/current is requested and significantly older than the validated ledger, return "InsufficientNetworkMode" error.
2015-05-11 18:14:45 -07:00
Vinnie Falco
4ad07bb6b2 Fix hops adjustment for validations 2015-05-11 18:14:45 -07:00
David Schwartz
d0b28a6700 Compute validated ledger age from signing time 2015-05-11 18:14:39 -07:00
Vinnie Falco
18299c3f7a Tidy up PeerSet:
* Move PeerSet to overlay/
* Remove unused functions
* Make some public members private
* Rename some functions
* Add comments
2015-05-11 12:06:14 -07:00
Miguel Portilla
ca07a1230b Add filtering to Account Objects (RIPD-868) 2015-05-11 11:58:35 -07:00
Edward Hennis
e0ad66d967 Fail Travis if scons vcxproj produces differences 2015-05-11 11:56:45 -07:00
seelabs
5615c4a2a7 Force scons to include soci version file:
Running `scons vcxproj` will sometimes include
soci's version.h and sometimes it will not. This
patch forces it to always include the file.
2015-05-11 11:56:42 -07:00
Nik Bougalis
d7fbef6764 Set version to 0.28.1-b8 2015-05-06 14:00:34 -07:00
JoelKatz
e95bda3bdf Peer latency tracking (RIPD-879):
Track peer latency, report in RPC, make peer selection for
fetching latency aware.

This also cleans up the PeerImp timer to minimize
resetting. Indirect routing is made latency-aware as well.
2015-05-06 13:38:59 -07:00
JoelKatz
c010a85ef5 Check the correct progress flag on transaction root node receipt 2015-05-06 13:38:59 -07:00
MarkusTeufelberger
798d36efcf Fix typo in LedgerMaster.cpp 2015-05-06 13:25:50 -07:00
Nik Bougalis
2d44c8568f Eliminate need for ledger in delivered_amount calculation (RIPD-860) 2015-05-06 13:25:50 -07:00
Nik Bougalis
7232bdb40c Reduce PeerFinder log verbosity 2015-05-06 13:25:50 -07:00
David Schwartz
45f092488a Simplify InboundLedger expiration (RIPD-873)
Let sweep logic remove obsolete ledger requests.
Touch inbound ledgers to prevent sweeping on requests.
Update sequence number if possible.
2015-05-06 13:25:50 -07:00
JoelKatz
4244e1070d Improvements to STParsedJSON:
* Cleanups and reduction of copying
* Add STArray::back, operator[], push_back(&&)
* Add make_stvar
* Rework STParsedJSON
* Fix code and unit tests that use STParsedJSON
* STTx move constructor
2015-05-06 13:11:24 -07:00
Nik Bougalis
5a7fa8cfa9 Reduce STAmount public interface (RIPD-867):
The STAmount class includes a number of functions which serve as thin
wrappers, which are unused or used only in one place, or which break
encapsulation by exposing internal implemenation details. Removing
such functions simplifies the interface of the class and ensures
consistency.

* getSNValue and getNValue are now free functions
* canonicalizeRound is no longer exposed
* Removed addRound and subRound
* Removed overloads of multiply, mulRound, divide and divRound
2015-05-06 13:11:24 -07:00
Josh Juran
daf4f8fcde Remove wallet_accounts and generator maps (RIPD-804):
* Remove the deprecated wallet_accounts command.
 * Remove dead code for generator maps.
 * Remove the help for the obsolete wallet_add and wallet_claim commands
   (which have already been removed).
2015-05-06 13:11:24 -07:00
Miguel Portilla
d182d1455e Relax RPC ledger synchronization requirements (RIPD-27, RIPD-840):
This enhances the reporting capability of RPC::LookupLedger and reduces
the requirement of a current ledger for many RPC commands.

The perceived up-time of client handlers improves since requests will
not depend on the server being fully synced.
2015-05-06 13:10:47 -07:00
Vinnie Falco
dc2260adbe Set version to 0.28.1-b7 2015-04-29 16:44:47 -07:00
Vinnie Falco
83a01e0c7d Set hopsAware version cutoff to 0.28.1-b7 2015-04-29 16:44:05 -07:00
Tom Ritchford
53c1269ebd Set version to 0.28.1-b6 2015-04-29 14:34:54 -04:00
Nik Bougalis
f8bfe3a550 Terminate process on SIGINT in all cases 2015-04-29 14:34:54 -04:00
Vinnie Falco
90bb53af20 Structured Overlay support for TTL limited messages:
When the [overlay] configuration key "expire" is set to 1, proposals
and validations will include a hops field. The hops is incremented with
each relay. Messages with a hop count will be dropped when they exceed
the TTL (Time to Live). Messages containing a hops field will not be
relayed or broadcast to older versions of rippled that don't understand
the field.

This change will not affect normal operation of the network or rippled
instances that do not set "expire" to 1.
2015-04-29 14:34:54 -04:00
Vinnie Falco
c77a2f335a Tidy up some business logic:
* Add OverlayImpl::for_each to tidy up some call sites
* Add comment about computing the unique ID for message routing
* Remove unused code
2015-04-29 14:34:53 -04:00
Vinnie Falco
8e34a1f6a7 Tidy up aged container declarations 2015-04-29 14:34:53 -04:00
Tom Ritchford
2564b62f5c Fix C++ style issues.
* Restrict files to 80 columns.
* Function names in GenerateDeterministicKey now start with lower case.
* Remove deprecated boost::format calls.
2015-04-29 14:34:53 -04:00
seelabs
a7598c5610 Remove unused database table (RIPD-755) 2015-04-29 14:34:52 -04:00
seelabs
8377f2516b Cache and apply account credits after payment processing (RIPD-821):
Credits made to any account during the processing of a payment are delayed until
the payment completes, enforcing a new invariant: liquidity for any paths
during a payment's execution may never increase. This eliminates the need for special
code to handle a variety of corner cases where consuming liquidity in one path
increases liquidity in others.
2015-04-29 14:34:52 -04:00
Vinnie Falco
7efd0ab0d6 Set version to 0.28.0 2015-04-24 18:57:36 -07:00
Vinnie Falco
14d38a1a8d Fix --rpc_ip and --rpc_port (RIPD-679)
This reverts commit 2b040569e7.
2015-04-24 18:57:04 -07:00
seelabs
c8447c190c Report the inbound listening port during crawl (RIPD-866) 2015-04-24 18:55:53 -07:00
Mark Travis
aa5d16b3d8 Skip inefficent SQL query (RIPD-870):
For large data sets the JOIN may not make forward progress in time.
This prevents the deletion of those entries in the database during
online delete. The number of such entries is very small compared to
the total size of the data anyway. A future version will address
this more thoroughly.
2015-04-24 18:55:49 -07:00
Vinnie Falco
fd1135315c Set version to 0.28.1-b5 2015-04-24 18:44:30 -07:00
Vinnie Falco
98c915b2ca Fix --rpc_ip and --rpc_port (RIPD-679)
This reverts commit 2b040569e7.
2015-04-24 18:44:30 -07:00
seelabs
9114f3d2e6 Report the inbound listening port during crawl (RIPD-866) 2015-04-24 18:19:10 -07:00
Mark Travis
5b0109055d Skip inefficent SQL query (RIPD-870):
For large data sets the JOIN may not make forward progress in time.
This prevents the deletion of those entries in the database during
online delete. The number of such entries is very small compared to
the total size of the data anyway. A future version will address
this more thoroughly.
2015-04-24 17:21:27 -07:00
Tom Ritchford
5a3168c9ff Set version to 0.28.1-b4 2015-04-23 16:47:23 -04:00
seelabs
a14f29f84f Remove obsolete code 2015-04-23 16:47:23 -04:00
Tom Ritchford
6c1190a361 Remove unnecessary thread in Soci (RIPD-862). 2015-04-23 16:47:22 -04:00
Howard Hinnant
100a76f0e8 Remove nested types SField::ref and SField::ptr...
* This silences a warning about a redundant cv-qualifier.
* This makes future coding mistakes about redundant
  cv-qualifiers much less likely.
* This makes the code easier to read.
2015-04-23 16:47:22 -04:00
JoelKatz
47482acf83 In consensus, get relative times from a steady clock (RIPD-859)
Using the system clock to get relative times for consensus
timing can result in performance issues if the system time
changes frequently.
2015-04-23 16:47:21 -04:00
Nik Bougalis
54ef4ee6ef Reduce severity level of offer cancellation logging 2015-04-23 16:47:20 -04:00
seelabs
2389abc295 Fix ownership of memory buffers in StatsDCollector (RIPD-756):
* Ownership of buffer memory in StatsDCollector is passed to the
boost::asio callback function. Before this, the memory may have been
freed before async_send was finished with the memory.
2015-04-23 16:47:20 -04:00
Nik Bougalis
67c666b033 Clean up LedgerEntrySet and TransactionEngine:
* Reduce public interfaces
* Remove wrapper functions
* Remove freeze timed cutover code
* Return results directly instead of via ref parameters
2015-04-23 16:47:19 -04:00
Vinnie Falco
5ce3ed3555 Set version to 0.28.1-b3 2015-04-21 14:01:44 -07:00
Nik Bougalis
d30b32fcde Set TX processing change date to 2015-05-12 13:00:00PDT 2015-04-21 14:01:25 -07:00
Miguel Portilla
568e4cebda Fix check for current ledger ID in RPC 2015-04-21 14:01:18 -07:00
Tom Ritchford
29d644e9d3 Fix WebSockets treatment of ping timer:
This solves a problem that caused a hang on shutdown related to
the lifetime of the ping timer completion handlers used in WebSockets.

* Turn the ping timer back on
* Use std::weak_ptr for WebSockets timer callbacks.
* Disable WebSocket pings if frequency in the .cfg is non-positive.
2015-04-21 14:01:13 -07:00
Torrie Fischer
2dbb7301fb Fix circleci 2015-04-21 14:01:09 -07:00
seelabs
d2cba1c54f Tidy up SQLite table creation:
* Check if tables and indexes exist
* Remove commands for unused table
2015-04-21 14:01:05 -07:00
seelabs
6a0c26a709 Fix return value when looking up non existent transactions 2015-04-21 14:01:00 -07:00
JoelKatz
e44ae6af93 Give ledger data requests their own job type:
This gives requests for ledger data (and transaction set data)
from peers a separate job type and prioritizes it appropriately.
Previously it was lumped in with fetch packs which have a low
concurrency limit. This should improve the performance of
retrieving historical information.
2015-04-21 14:00:54 -07:00
Vinnie Falco
837b0799ac Set version to 0.28.0-rc3 2015-04-21 13:48:39 -07:00
Nik Bougalis
bc85a8b24f Set TX processing change date to 2015-05-12 13:00:00PDT 2015-04-21 13:48:38 -07:00
Miguel Portilla
15d68649d5 Fix check for current ledger ID in RPC 2015-04-21 13:48:30 -07:00
Tom Ritchford
e0d96ae807 Fix WebSockets treatment of ping timer:
This solves a problem that caused a hang on shutdown related to
the lifetime of the ping timer completion handlers used in WebSockets.

* Turn the ping timer back on
* Use std::weak_ptr for WebSockets timer callbacks.
* Disable WebSocket pings if frequency in the .cfg is non-positive.
2015-04-21 12:26:11 -07:00
Torrie Fischer
3aa39ced60 Fix circleci 2015-04-21 12:23:23 -07:00
seelabs
1f1c0618e1 Tidy up SQLite table creation:
* Check if tables and indexes exist
* Remove commands for unused table
2015-04-21 12:21:27 -07:00
seelabs
7788aa25b5 Fix return value when looking up non existent transactions 2015-04-21 12:20:53 -07:00
JoelKatz
d5b460a85c Give ledger data requests their own job type:
This gives requests for ledger data (and transaction set data)
from peers a separate job type and prioritizes it appropriately.
Previously it was lumped in with fetch packs which have a low
concurrency limit. This should improve the performance of
retrieving historical information.
2015-04-21 12:15:59 -07:00
Vinnie Falco
9019f3a4f2 Set version to 0.28.1-b2 2015-04-20 15:57:02 -07:00
seelabs
dfda0d566a Support for boost 1.58 2015-04-20 15:55:48 -07:00
Vinnie Falco
99c2fac143 STVar: optimized storage for STObject (RIPD-825):
This introduces the STVar container, capable of holding any STBase-derived
class and implementing a "small string" optimization. STObject is changed
to store std::vector<STVar> instead of boost::ptr_vector<STBase>. This
eliminates a significant number of needless dynamic memory allocations and
deallocations during transaction processing when ledger entries are
deserialized. It comes at the expense of larger overall storage requirements
for STObject.
2015-04-20 15:54:26 -07:00
Nicholas Dudfield
4c5308da8d Update account_objects test:
* Use Request over json-rpc
* Use lodash to filter irrelevant fields from expectations
* Use LedgerState for state setup
* Test using limit and marker

Conflicts:
	test/account_objects-test.js
2015-04-20 15:54:14 -07:00
Miguel Portilla
4d0ed3d857 RPC account_objects (RIPD-777)
General RPC command that can retrieve objects in the account root.
  * Add account objects integration test.
  * Support tickets.

* Add removeElement in Json::Value
2015-04-20 15:54:09 -07:00
Vinnie Falco
0b5582ed0d Disable redundant ping timer 2015-04-20 15:52:38 -07:00
Tom Ritchford
17734f833c Revert "Checkpoint SOCI exactly every 1000 pages."
This reverts commit e874a2624f.
2015-04-20 15:52:33 -07:00
Vinnie Falco
98a9d5d424 Lower the severity of some PeerFinder logging 2015-04-20 15:52:29 -07:00
Vinnie Falco
6d74f36449 Fix Crawl handshake header parsing in Overlay 2015-04-20 15:52:20 -07:00
Vinnie Falco
47a5bf6aa5 Fix beast::ci_equal 2015-04-20 15:52:16 -07:00
Vinnie Falco
2805e9eb3b Set version to 0.28.0-rc2 2015-04-20 15:19:07 -07:00
Vinnie Falco
72a1a86886 Disable redundant ping timer 2015-04-20 13:42:00 -07:00
Tom Ritchford
ec190bae33 Revert "Checkpoint SOCI exactly every 1000 pages."
This reverts commit e874a2624f.
2015-04-20 11:01:23 -07:00
Vinnie Falco
83003e43d7 Lower the severity of some PeerFinder logging 2015-04-20 11:01:20 -07:00
Vinnie Falco
3b20dc2994 Fix Crawl handshake header parsing in Overlay 2015-04-20 11:00:03 -07:00
Vinnie Falco
a7198298e7 Fix beast::ci_equal 2015-04-20 10:59:58 -07:00
Vinnie Falco
f3d76d5780 Set version to 0.28.1-b1 2015-04-17 11:43:51 -07:00
Vinnie Falco
e2305c3c5e Merge branch 'release' into develop
Conflicts:
	Builds/rpm/rippled.spec
	src/ripple/protocol/impl/BuildInfo.cpp
2015-04-17 11:43:09 -07:00
Vinnie Falco
ba737d7e58 Set version to 0.28.0-rc1 2015-04-17 11:41:50 -07:00
Vinnie Falco
88f69204c8 Merge 0.28.0-b21 into release 2015-04-17 11:41:17 -07:00
Vinnie Falco
bb4561c2b8 Set version to 0.28.0-b22 2015-04-16 11:31:57 -07:00
seelabs
4710f764e4 Quiet unused variable warning 2015-04-16 11:31:57 -07:00
JoelKatz
11a59a767e Adjust cache parameters for 'huge' node size 2015-04-16 11:31:54 -07:00
Miguel Portilla
4cf3157aad Set version to 0.28.0-b21 2015-04-14 18:54:31 -04:00
Miguel Portilla
b1f6cb349b Improved parsing of universal port configuration settings (RIPD-856) 2015-04-14 18:51:53 -04:00
David Schwartz
0c134582ca Track peer "sanity" (RIPD-836)
* Each peer has a "sane/insane/unknown" status
* Status updated based on peer ledger sequence
* Status reported in peer json
* Only sane peers preferred for historical ledgers
* Overlay endpoints only accepted from known sane peers
* Untrusted proposals not relayed from insane peers
* Untrusted validations not relayed from insane peers
* Transactions from insane peers are not processed
* Periodically drop outbound connections to bad peers
* Bad peers get bootcache valence of zero

Peer "sanity" is based on the ledger sequence number they are on.  We
quickly become able to assess this based on current trusted validations.
We quarrantine rogue messages and disconnect bad outbound connections to
help maintain the configured number of good outbound connections.
2015-04-14 18:51:52 -04:00
Nik Bougalis
acf2833362 Set version to 0.28.0-b20 2015-04-13 10:24:47 -07:00
Nik Bougalis
20f9971096 Finalize date for switchover to 0.28.0 processing semantics 2015-04-13 10:24:47 -07:00
Nik Bougalis
cefeaceef0 Signal error for incorrect configuration during unit test 2015-04-13 10:24:47 -07:00
Howard Hinnant
1ba7c4b6ee Remove unneeded member initializer:
* This works around a clang bug.
* Also un-commented correctly deleted copy members.
2015-04-13 10:24:47 -07:00
Vinnie Falco
1b49776819 Add fetchBatch Backend interface 2015-04-10 19:14:57 -07:00
Vinnie Falco
41c68f4bbc Use static_initializer in KnownFormats singleton 2015-04-10 19:14:57 -07:00
Nik Bougalis
56ac830405 Refund owner's ticket reserve when a ticket is canceled (RIPD-855) 2015-04-10 19:12:51 -07:00
Nik Bougalis
ebcf821d81 Return descriptive error from account_currencies RPC (RIPD-806):
The 'account_index' field is expected to be an integer. If something
else is specified, the error message should clearly indicate which
field is at fault.
2015-04-10 19:11:28 -07:00
Tom Ritchford
e874a2624f Checkpoint SOCI exactly every 1000 pages. 2015-04-10 19:11:28 -07:00
Tom Ritchford
03d1c0ed21 Clean SOCI code.
* Throw exception rather than SEGV.
* Hide details of checkpointing from clients.
* Restrict to 80 columns and minor style tweaks.
2015-04-10 19:11:28 -07:00
Tom Ritchford
1b8c77eee0 Allow logging to be used outside the ripple namespace.
* Split logging macros over multiple lines.
* Restrict Log.h to 80 columns.
2015-04-10 19:11:28 -07:00
Tom Ritchford
d575cd50b1 Clean up Sustain.h and Sustain.cpp.
* Bring out magic numbers.
  * Get rid of boost::format.
2015-04-10 19:11:28 -07:00
Tom Ritchford
2b040569e7 Remove deprecated flags --rpc_ip and --rpc_port. 2015-04-10 19:11:28 -07:00
Miguel Portilla
7a53f86fff Compare current seq vs validated (RIPD-669) 2015-04-10 19:11:28 -07:00
Torrie Fischer
a90bb53cd2 Drop nexmo SMS support. Reverts 58b3cc1d. 2015-04-10 19:11:27 -07:00
Tom Ritchford
b450d62138 Port to Python: Build and run tests for multiple build configurations. 2015-04-10 19:11:27 -07:00
Nik Bougalis
1a9d65c52a Set version to 0.28.0-b19 2015-04-10 19:00:45 -07:00
seelabs
05f4746bbe Add workaround include for Windows.h NOMINMAX 2015-04-10 19:00:45 -07:00
seelabs
1c587723fa Safer macro restoration using MSVC extensions 2015-04-10 19:00:34 -07:00
Nik Bougalis
b2a9c79de5 Fix transaction enumeration in account_tx (RIPD-734):
In some corner cases, an incorrect resume marker could be
returned, preventing the complete enumeration of account
transactions.

* Robust markers via improved paging support
* New unit tests
* Cleanup
2015-04-10 19:00:22 -07:00
Nik Bougalis
64259c7bcb Better transaction analysis (RIPD-755):
The analysis of differences between locally built ledgers and consensus
ledgers is now more intelligent. Differences in these values will be
categorized:

 - Operation results
 - Transaction ordering
 - Generated metadata
2015-04-10 18:58:52 -07:00
Nik Bougalis
a7efdb4e52 Improve version switchover semantics:
* Support PreviousTxnID until the switchover
* Implement "No Ripple" for issue_iou and redeem_iou.
* Do not utilize issue_iou and redeem_iou from legacy code
* Rename 0.27.x legacy files to account for VS build process
* Misc. cleanups
2015-04-10 18:56:52 -07:00
Tom Ritchford
091ff0cce0 Set version to 0.28.0-b18 2015-03-31 21:50:45 -04:00
seelabs
7e25a3a942 Fix SQL in online delete cleanup:
* SQL statement is corrected to perform an implicit JOIN
* Add unit test
2015-03-31 21:50:45 -04:00
Nik Bougalis
b3254e2b18 Remove unsupported proof-of-work command parsing 2015-03-31 21:50:44 -04:00
JoelKatz
9a0fa79144 Fix duplication of full below cache and tree node cache 2015-03-31 21:50:43 -04:00
JoelKatz
352db260b2 STArray optimization 2015-03-31 21:50:43 -04:00
Nik Bougalis
f072b5b679 Avoid copying and improve optimization opportunities 2015-03-31 21:50:43 -04:00
JoelKatz
b4058a813b Small changes to improve transaction benchmarking:
* Set transaction valid in hash router correctly
* Properly account for root nodes in walkLedger
* If loaded ledger is insane, log details
* Extra logging while loading replay ledger
* Don't test unsigned transactions expecting them to succeed
* Don't be too noisy about signature failures
2015-03-31 21:50:42 -04:00
Vinnie Falco
b27e152ead NuDB: Enforce pool_thresh minimum of 1:
pool_thresh is prevented from going to zero. This solves a problem when
using callgrind where the CPU is monopolized, causing operations that
should complete quickly to take days.
2015-03-31 21:50:42 -04:00
Tom Ritchford
936e83759d Remove three warnings. 2015-03-31 21:50:41 -04:00
Tom Ritchford
18fdc175c6 Clean structure of RPC::addPaymentDeliveredAmount 2015-03-31 21:50:41 -04:00
JoelKatz
47c6ab0ced Reduce SHAMapTreeNode copying during SHAMap unsharing:
In some code paths, we bump the SHAMap sequence number
before we unshare. This forces SHAMapTreeNode to be
copied. By making the ledger immutable we cause the
unsharing to occur earlier, eliminating the copies.
2015-03-31 21:50:40 -04:00
seelabs
4868135d47 Improve build times:
* Get classic & unity sources once only
* Use MD5-Timestamp
* Use implicit cache for specific debug builds
* Skip prep work for targets what will not be built
2015-03-31 21:50:39 -04:00
Miguel Portilla
5e70db651d Improved local tx error messages (RIPD-720)
Failed local built transactions report the specific error.
2015-03-31 21:50:39 -04:00
David Schwartz
1fedede771 Remove transaction set acquire logic from consensus object
This creates a new InboundTransactions object that handles transaction sets,
removing this responsibility from the consensus object. The main benefit is
that many inbound transaction operations no longer require the master lock.

Improve logic to decide which peers to query, when to add more peers, and
when to re-query existing peers.
2015-03-31 21:50:38 -04:00
seelabs
00596f1436 Reduce memory allocation, remove some functions in Serializer. 2015-03-31 21:50:37 -04:00
Nik Bougalis
db840b5604 Perform Transactor checks early (RIPD-751):
Certain checks that determine if a transaction is malformed can be performed
without needing to look up accounts or access the ledger.

Perform those checks as early as possible to optimize transaction processing.
2015-03-31 06:49:53 -07:00
Nik Bougalis
45070d0e51 Reduce Transaction public interface 2015-03-30 13:05:42 -07:00
Tom Ritchford
8a1081f9ef Set version to 0.28.0-b17 2015-03-26 12:38:33 -04:00
seelabs
ac84e44161 Correct missing semicolons on sql statements 2015-03-26 12:38:33 -04:00
seelabs
836dfb6503 Do not log errors from initial database statements 2015-03-26 12:38:33 -04:00
Edward Hennis
35a8ce2349 Pathfinding unit tests:
* Refactor ripple path find to be more testable.
* Reimplements the first 4 tests from `tests\path-test.js`
* Verify balances in Ledger test.
2015-03-26 12:38:33 -04:00
Tom Ritchford
bb7d68b3b9 Add notes about Rippled's container classes. 2015-03-26 12:38:33 -04:00
Howard Hinnant
1979846e5e Change several uses of std::list to alternative containers:
*  Performance motivated.
*  Several of these called size() which is O(N) in gcc-4.8.
*  Remove container copy from LedgerConsensusImp::playbackProposals().
*  Addresses RIPD-284.
2015-03-26 12:38:33 -04:00
Howard Hinnant
a61ffab3f9 Remove unnecessary allocation/deallocation from masterLock
* Add make_lock.
* Rename Application::LockType to Application::MutexType:
* Rename getMasterLock to getMasterMutex.
* Use getMasterMutex and make_lock.
* Remove unused code.
2015-03-26 12:38:33 -04:00
Howard Hinnant
698fe73608 Move SHAMap hash computations from dirtyUp to walkSubTree
in order to reduce the total number of hash computations.
2015-03-26 12:38:33 -04:00
Josh Juran
0083c32629 Update VS project files 2015-03-26 12:38:33 -04:00
Nik Bougalis
f313caaa73 Set version to 0.28.0-b16 2015-03-19 07:55:19 -07:00
Edward Hennis
6e3f07ddce Remove unused / redundant functions. 2015-03-19 07:41:57 -07:00
Mark Travis
11d28c4856 Always increment payment pass counter 2015-03-19 07:41:57 -07:00
Nik Bougalis
e9394ca85a Implement "Default Ripple" logic in active direction:
When a balance change invokes trustCreate, we need to set the no ripple flag
if the "active" account's asfRippleDefault flag is cleared.
2015-03-19 07:41:57 -07:00
Nik Bougalis
9445a30e72 Implement "Default Ripple" logic in LedgerEntrySet::checkState 2015-03-19 07:41:57 -07:00
JoelKatz
185b1a3d36 Add noripple_check RPC command
To help gateways make the changes needed to adjust to the
"default ripple" flag, we've added the "noripple_check"
RPC command. This command tells gateways what they need
to do to set this flag and fix any trust lines created
before they set the flag.

Once your server is running and synchronized, you can run
the tool from the command line with a command like:
  rippled json noripple_check '
  {
    "account" : "<gateway_trusted_address_here>",
    "role" : "gateway",
    "transactions" : "true"
  }'

The server will respond with a list of "problems" that it
sees with the configuration of the account and its trust
lines. It will also return a "transactions" array suggesting
the transactions needed to fix the problems it found.
2015-03-19 07:41:57 -07:00
JoelKatz
1c2f5d60a5 Subscribe/Unsubscribe improvements:
* Don't acquire the master lock where it's not needed
* InfoSub tracks RT and validated accounts separately
* Correctly remove accounts from the InfoSub
2015-03-19 07:41:57 -07:00
JoelKatz
2f32910bef Reduce master lock scope in some RPC functions 2015-03-19 07:41:57 -07:00
JoelKatz
8de1b20bb5 Defer/avoid acquiring the master lock on proposals 2015-03-19 07:41:57 -07:00
David Schwartz
60a7abcef6 Decongest the master lock:
* Reduce scope of lock in ledger accept
* Remove duplicate tracking of transaction sets
* Need master lock to secure ledger sequencing
2015-03-19 07:41:57 -07:00
David Schwartz
e44e75fa6b Track and report peer load:
* PeerImp::charge only calls fail if dispatched from the peer
* Add "load" to output of RPC command "peer"
* Add Resource::Charge values for peer commands
* Impose some fee for every peer command
* Cleanup fee imposition
2015-03-19 07:41:57 -07:00
JoelKatz
ff7dc0b446 Reduce chatty log outputs 2015-03-19 07:41:57 -07:00
JoelKatz
f813cb2310 Tolerate LedgerSequence field in pseudo-transactions:
This will enable a forthcoming change to prevent pseudo-transactions
from reusing a transaction ID
2015-03-19 07:41:57 -07:00
JoelKatz
cba19d7e23 Document and cleanup ledger advance logic
* Don't acquire if validated ledger is old
* Don't try to publish if no valid ledger
* Update README.md file
2015-03-19 07:41:57 -07:00
Nicholas Dudfield
9479c0e12d Update uniport tests to use new config 2015-03-18 19:39:30 -07:00
Nicholas Dudfield
65c9c45ec6 Rename test file so npm test finds it 2015-03-18 19:39:30 -07:00
Miguel Portilla
6d79004d4f Better admin IP management in .cfg (RIPD-820):
* Deprecate rpc_admin_allow section from configuration file
* New port-specific setting 'admin':
  * Comma-separated list of IP addresses that are allowed administrative
    privileges (subject to username & password authentication if configured)
  * 127.0.0.1 is no longer a default admin IP.
  * 0.0.0.0 may be specified to indicate "any IP" but cannot be combined
    with other IP addresses.
2015-03-18 19:39:30 -07:00
seelabs
97623d20c5 Use soci in more places:
* Validator, peerfinder, SHAMapStore,
  RpcDB, TxnDB, LedgerDB, WalletDB use soci backend.
2015-03-18 19:39:26 -07:00
seelabs
d37802a42f Remove SqliteFactory. 2015-03-18 19:37:09 -07:00
seelabs
9b837a24aa Remove beast's sqdb module.
Conflicts:
	src/beast/beast/module/sqdb/api/backend.h
	src/beast/beast/module/sqdb/api/blob.h
	src/beast/beast/module/sqdb/api/into.h
	src/beast/beast/module/sqdb/api/session.h
	src/beast/beast/module/sqdb/api/statement.h
	src/beast/beast/module/sqdb/api/transaction.h
	src/beast/beast/module/sqdb/api/type_conversion_traits.h
	src/beast/beast/module/sqdb/api/use.h
	src/beast/beast/module/sqdb/detail/error_codes.h
	src/beast/beast/module/sqdb/detail/exchange_traits.h
	src/beast/beast/module/sqdb/detail/into_type.h
	src/beast/beast/module/sqdb/detail/once_temp_type.h
	src/beast/beast/module/sqdb/detail/prepare_temp_type.h
	src/beast/beast/module/sqdb/detail/ref_counted_prepare_info.h
	src/beast/beast/module/sqdb/detail/ref_counted_statement.h
	src/beast/beast/module/sqdb/detail/statement_imp.h
	src/beast/beast/module/sqdb/detail/type_conversion.h
	src/beast/beast/module/sqdb/detail/type_ptr.h
	src/beast/beast/module/sqdb/detail/use_type.h
	src/beast/beast/module/sqdb/sqdb.h
2015-03-18 19:37:08 -07:00
seelabs
d0ef2f7dd8 Use soci in some places:
* Brings the soci subtree into rippled.
* Validator, peerfinder, and SHAMapStore use new soci backend.
* Optional postgresql backend for soci (if POSTGRESQL_ROOT env var is set).
2015-03-18 19:37:08 -07:00
seelabs
c7cfd23580 Update sqlite3 to 3.8.8.2. 2015-03-18 19:37:03 -07:00
Vinnie Falco
9708a12607 Squashed 'src/soci/' content from commit 6e9312c
git-subtree-dir: src/soci
git-subtree-split: 6e9312c4bb3748907bd28d62c40feca42878cfef
2015-03-18 19:36:00 -07:00
Vinnie Falco
7cf1ec3f89 Merge commit '9708a1260720d879d76a10f894925962f20611bc' as 'src/soci' 2015-03-18 19:36:00 -07:00
Nik Bougalis
92812fe723 Set version to 0.27.4 2015-03-18 17:54:57 -07:00
JoelKatz
79417ac59a Limit passes in the payment engine to prevent endless looping:
This adds a limit of 1,000 passes to the payment engine. It protects against
possible cases where the execution of a pass fails to exhaust the liquidity
that made the pass possible or cases where two passes alternate providing
liquidity for each other.
2015-03-18 17:53:52 -07:00
Mark Travis
984f66e083 Don't VACUUM SQLite databases on startup with online delete enabled. 2015-03-18 17:53:42 -07:00
Tom Ritchford
ef2a436769 Set version to 0.28.0-b15 2015-03-16 20:54:17 -04:00
Edward Hennis
7f1a95550f Clean up unit test logs on success.
* Add a little bit of shell variable safety and tweak output.
2015-03-16 20:54:17 -04:00
seelabs
803f5b5613 Use buffer in STBlob 2015-03-16 20:54:15 -04:00
Nicholas Dudfield
8ca9fa1c26 Fix testutils.create_accounts
* Don't call ledger_wait inside parallel async loop
2015-03-16 20:54:14 -04:00
David Schwartz
3b3b897193 Add "Default Ripple" account flag and associated logic:
AccountSet set/clear, asfDefaultRipple = 8

AccountRoot flag, lsfDefaultRipple = 0x00800000

In trustCreate, set no ripple flag if appropriate.

If an account does not have the default ripple flag set,
new ripple lines created as a result of its offers being
taken or people creating trust lines to it have no ripple
set by that account's side automatically

Trust lines can be deleted if the no ripple flag matches
its default setting based on the account's default ripple
setting.

Fix default no-rippling in integration tests.
2015-03-16 20:54:14 -04:00
Torrie Fischer
6c364f63cc Build docker images on circleci based on travis.yml 2015-03-16 20:54:14 -04:00
seelabs
6b9e842ddd Replaces StringPairArray with Section in Config. 2015-03-16 20:54:13 -04:00
Nik Bougalis
8f88d915ba Support switchover from 0.27 to 0.28 processing semantics based on time:
Changes made to support autobridging and improve the offer-crossing and
pathfinding logic result in transaction-breaking changes which cause
incompatibilities between 0.27 and 0.28 builds of RippleD.

This patch simplifies deployment of 0.28 on the Ripple network by allowing
RippleD to emulate the 0.27 semantics while the last closed ledger closed
before March 30, 2015 at 13:00:00 PDT, after which time the new 0.28
semantics will become active.

The transaction-breaking changes addressed in this commit are:
    3ccbd7c9b2
    b203db27a4
2015-03-16 20:54:12 -04:00
JoelKatz
eaa1f47f00 Limit passes in the payment engine to prevent endless looping:
This adds a limit of 1,000 passes to the payment engine. It protects against
possible cases where the execution of a pass fails to exhaust the liquidity
that made the pass possible or cases where two passes alternate providing
liquidity for each other.
2015-03-16 20:54:11 -04:00
JoelKatz
cbeae85731 Fix specified destination issuer in pathfinding (RIPD-812)
* Compute the effective recipient.
* Make sure the effective recipient exists.
* Prohibit paths to the recipient, if not the effective recipient.
* Treat paths to the effective recipient as complete.
* Don't find looped paths.
* Use the effective recipient for getPathsOut weight.
2015-03-16 20:54:09 -04:00
Nik Bougalis
84e618b3f2 Improve pool seeding during startup:
* When starting up, we no longer rely just on the standard
  system RNG to generate entropy: we attempt to squeeze some
  from the execution state, and to recover any entropy that
  we had previously stored.

* When shutting down, if sufficient entropy has been accumulated
  attempt to store it for future use.
2015-03-16 20:54:08 -04:00
JoelKatz
382a16ff07 Avoid excess ledger header requests 2015-03-16 20:54:07 -04:00
JoelKatz
7bd339b645 Balance peer selection in getFetchPack 2015-03-16 20:54:07 -04:00
David Schwartz
70d8b2c4b7 getMissingNode performance and logging improvements 2015-03-16 20:54:07 -04:00
David Schwartz
3764a83c6b Ledger binary option
Conflicts:
	src/ripple/app/ledger/Ledger.cpp
	src/ripple/app/ledger/Ledger.h
	src/ripple/rpc/handlers/Ledger.cpp
2015-03-16 20:54:06 -04:00
Tom Ritchford
c3d200ddcd Set version to 0.28.0-b14 2015-03-13 11:21:02 -04:00
Tom Ritchford
44c5e337ab Remove obsolete comments from doc/CHANGELOG. 2015-03-13 11:21:02 -04:00
Nik Bougalis
040982e321 Only report 'delivered_amount' for executed payments (RIPD-827) 2015-03-13 11:21:00 -04:00
Nik Bougalis
6c81ea846c Calculate deep offer quality 2015-03-13 11:20:59 -04:00
Josh Juran
d082a0696d Support Ed25519 keys and signatures:
Recognize a new JSON parameter `key_type` in handlers for wallet_propose
and sign/submit.  In addition to letting the caller to specify either of
secp256k1 or ed25519, its presence prohibits the (now-deprecated) use of
heuristically polymorphic parameters for secret data -- the `passphrase`
parameter to wallet_propose will be not be considered as an encoded seed
value (for which `seed` and `seed_hex` should be used), and the `secret`
parameter to sign and submit will be obsoleted entirely by the same trio
above.

* Use constants instead of literals for JSON parameter names.
* Move KeyType to its own unit and add string conversions.
* RippleAddress
  * Pass the entire message, rather than a hash, to accountPrivateSign()
    and accountPublicVerify().
  * Recognize a 33-byte value beginning with 0xED as an Ed25519 key when
    signing and verifying (for accounts only).
  * Add keyFromSeed() to generate an Ed25519 secret key from a seed.
  * Add getSeedFromRPC() to extract the seed from JSON parameters for an
    RPC call.
  * Add generateKeysFromSeed() to produce a key pair of either type from
    a seed.
* Extend Ledger tests to cover both key types.
2015-03-12 21:53:59 -07:00
Nik Bougalis
f999839e59 Set version to 0.27.3-sp2 2015-03-12 13:37:47 -07:00
JoelKatz
f1bc662a24 Add noripple_check RPC command
To help gateways make the changes needed to adjust to the
"default ripple" flag, we've added the "noripple_check"
RPC command. This command tells gateways what they need
to do to set this flag and fix any trust lines created
before they set the flag.

Once your server is running and synchronized, you can run
the tool from the command line with a command like:
  rippled json noripple_check '
  {
    "account" : "<gateway_trusted_address_here>",
    "role" : "gateway",
    "transactions" : "true"
  }'

The server will respond with a list of "problems" that it
sees with the configuration of the account and its trust
lines. It will also return a "transactions" array suggesting
the transactions needed to fix the problems it found.
2015-03-12 13:37:06 -07:00
Nik Bougalis
232693419a Set version to 0.27.3-sp1 2015-03-11 10:26:39 -07:00
Nicholas Dudfield
ed66b951c6 Fix testutils.create_accounts
* Don't call ledger_wait inside parallel async loop
2015-03-11 10:25:27 -07:00
Nik Bougalis
70c2854f7c Set version to 0.27.3 2015-03-10 14:06:33 -07:00
David Schwartz
e9381ddeb2 Add "Default Ripple" account flag and associated logic:
AccountSet set/clear, asfDefaultRipple = 8

AccountRoot flag, lsfDefaultRipple = 0x00800000

In trustCreate, set no ripple flag if appropriate.

If an account does not have the default ripple flag set,
new ripple lines created as a result of its offers being
taken or people creating trust lines to it have no ripple
set by that account's side automatically

Trust lines can be deleted if the no ripple flag matches
its default setting based on the account's default ripple
setting.

Fix default no-rippling in integration tests.
2015-03-10 14:05:18 -07:00
Tom Ritchford
1b46e003c3 Set version to 0.28.0-b13 2015-03-09 17:49:39 -04:00
Howard Hinnant
4611d5a35f Remove unused SyncUnorderedMap 2015-03-09 17:49:39 -04:00
Nicholas Dudfield
2e59378ab7 Fix AppVeyor:
* Detect continuous integration environment via `CI` variable
* Use double quotes for build cache path
2015-03-09 17:49:39 -04:00
JoelKatz
fc8bf39043 Simplify tracking of recently requested ledger entries
Instead of tracking recently-requested entries from inbound
ledgers by node ID, track by hash. This allows state and
transaction entries to be tracked in the same set.
2015-03-09 17:49:38 -04:00
Vinnie Falco
2cccd8ab28 Fix gentex usage in nudb 2015-03-09 17:49:37 -04:00
Vinnie Falco
d537ceedd6 Tidy up nudb:
* Define WIN32_LEAN_AND_MEAN before including Windows.h
* Remove unnecessary template argument
* Rename to identity
* Make identity default api codec
2015-03-09 17:49:37 -04:00
Tom Ritchford
ac7243b309 Remove unused static function. 2015-03-02 17:40:12 -05:00
Tom Ritchford
607e983f37 Set version to 0.28.0-b12 2015-03-02 16:50:01 -05:00
Mark Travis
02f7326b7e Remove orphan function. 2015-03-02 16:50:01 -05:00
Edward Hennis
b688f69031 Builds/test-only.sh will build and test by scons target.
* test-all.sh simplified to call test-only.sh.
* Script fails if build or tests fail. Allows chaining and git bisect run.
* Add copyright notice
* Ignore gprof performance data created by testing the profile builds.
2015-03-02 16:50:00 -05:00
Tom Ritchford
df41329df9 Replace "it's" with "its" in several places. 2015-03-02 16:49:59 -05:00
Tom Ritchford
0825bd7076 Cleanups to Json Object code.
* Replace Json::JsonException with std::logic_error.
* Move two functions definitions to Object.cpp.
* Fix include guards.
2015-03-02 16:49:56 -05:00
Tom Ritchford
e9b7003cf5 Move streaming Json objects to ripple/json. 2015-03-02 16:49:56 -05:00
Tom Ritchford
c5d673c426 Better integration between JsonObject and Json::Value. 2015-03-02 16:49:56 -05:00
Nik Bougalis
9cc8eec773 Set version to 0.27.2 2015-03-01 14:56:44 -08:00
Nik Bougalis
0b45535061 Calculate deep offer quality 2015-02-28 13:28:54 -08:00
Tom Ritchford
9f64ad8d89 Add WebSocket 04 interface.
* New WebSocket04 traits class implements strategies.
* New "websocket_version" configuration setting selects between 0.2 and 0.4.
2015-02-28 14:57:38 -05:00
Tom Ritchford
e5b0b7e9a7 Expose a method and add a handler in websocketpp.
* Expose websocketpp::transport::asio::connection::get_strand().
* Add new send_empty_handler to websocketpp::endpoint.
2015-02-28 14:57:38 -05:00
Tom Ritchford
9c3522cb70 Isolate WebSocket 0.2-specific code.
* Hide implementation details of the WebSocket server from clients.
* Extract a generic traits class.
2015-02-28 14:57:38 -05:00
Tom Ritchford
b357390215 Remove redundant post to strand in websocket. 2015-02-27 12:11:54 -05:00
Tom Ritchford
c66fc2f656 Rename all WebSocket code into one directory. 2015-02-27 12:11:54 -05:00
Tom Ritchford
64554aca6d Set version to 0.28.0-b11 2015-02-26 21:02:39 -05:00
Nik Bougalis
f1df9a02fa Fix declaration/implementation mismatches 2015-02-26 21:02:38 -05:00
JoelKatz
f3725bdd2e Return a validated ledger if there is one (RIPD-814)
LedgerMaster::getLedgerBySeq should return a validated
ledger (rather than the the open or closed ledger) for
a sequence number for which it has a fully-validated ledger.
2015-02-26 21:02:37 -05:00
Tom Ritchford
cb92b94d55 Remove unused variable. 2015-02-26 21:02:36 -05:00
Vinnie Falco
ef01f82e0c Add nounity targets to msvc projects 2015-02-26 21:02:35 -05:00
Vinnie Falco
4ba7ee8c92 Support per-target ExcludeFromBuild in VSProject 2015-02-26 21:02:35 -05:00
Howard Hinnant
c59633a588 Make SHAMap::fetchNodeFromDB const
When fetchNodeFromDB discovers a missing node in the database it
must reset the ledger sequence to 0.  By treating this as a logically
const operation, even though not physically const, many other member
functions can be made const, including compare.
2015-02-26 21:02:33 -05:00
Vinnie Falco
f56e37398c Always use HTTP handshaking in overlay:
Inbound and outbound peer connections always use HTTP handshakes to
negotiate connections, instead of the deprecated TMHello protocol
message.

rippled versions 0.27.0 and later support both optional HTTP handshakes
and legacy TMHello messages, so always using HTTP handshakes should not
cause disruption. However, versions before 0.27.0 will no longer be
able to participate in the overlay network - support for handshaking
via the TMHello message is removed.
2015-02-26 21:02:32 -05:00
Tom Ritchford
e43ffa6f2b Set version to 0.28.0-b10 2015-02-25 20:26:12 -05:00
Yana
6991bc9723 Spelling corrections 2015-02-25 20:26:12 -05:00
Miguel Portilla
9d6106a80b Require boost 1.57 2015-02-25 20:26:12 -05:00
Tom Ritchford
9e70404411 Get rid of compilation warning. 2015-02-25 20:26:12 -05:00
Nik Bougalis
bc48d299b6 Report server versions when crawling the overlay network 2015-02-25 20:26:12 -05:00
mDuo13
a8db5650a5 Add online_delete reminder to ledger_history in example cfg 2015-02-25 19:56:47 -05:00
Nicholas Dudfield
91871b418b Changes to Universal Port:
* Add tests
* Introduce requestRole helper
* Always honor admin=no
* Welcome guests anywhere admin privileges aren't required
2015-02-25 19:46:56 -05:00
Tom Ritchford
aaf98082e9 Set version to 0.28.0-b9 2015-02-24 20:28:43 -05:00
Tom Ritchford
ac228deeda Replace LEDGER_JSON_ macros with an enum. 2015-02-24 20:28:43 -05:00
Edward Hennis
fc661c83ef Build and run tests on all available build types
* Tests include unit and integration (npm)
2015-02-24 20:28:43 -05:00
Vinnie Falco
a2acffdfa3 New serialized object, public key, and private key interfaces
This introduces functions get and set, and a family of specialized
structs called STExchange. These interfaces allow efficient and
seamless interchange between serialized object fields and user
defined types, especially variable length objects.

A new base class template TypedField is mixed into existing SField
declarations to encode information on the field, allowing template
metaprograms to both customize interchange based on the type and
detect misuse at compile-time.

New types AnyPublicKey and AnySecretKey are introduced. These are
intended to replace the corresponding functionality in the deprecated
class RippleAddress. Specializations of STExchange for these types
are provided to allow interchange. New free functions verify and sign
allow signature verification and signature generation for serialized
objects.

* Add Buffer and Slice primitives
* Add TypedField and modify some SField
* Add STExchange and specializations for STBlob and STInteger
* Improve STBlob and STInteger to support STExchange
* Expose raw data in RippleAddress and Serializer
2015-02-24 20:28:43 -05:00
David Schwartz
79ce4ed226 Document cluster configuration and monitoring (RIPD-732) 2015-02-24 20:28:43 -05:00
Nik Bougalis
e3a7aa0033 Constrain valid inputs for memo fields (RIPD-712) 2015-02-24 20:25:34 -05:00
Vinnie Falco
95973ba3e8 Set version to 0.27.1 2015-02-24 13:31:13 -08:00
Tom Ritchford
fde6303ae6 Set version to 0.28.0-b8 2015-02-24 12:33:59 -05:00
Vinnie Falco
b4a1948951 Use all parts of suite name to detect duplicates 2015-02-24 12:33:59 -05:00
Miguel Portilla
b927028416 Display human readable SSL error codes 2015-02-24 12:33:59 -05:00
Tom Ritchford
fe5d1ff6c5 Set version to 0.28.0-b7 2015-02-23 11:53:21 -08:00
Yana
1308656000 Update README.md file (RIPD-802) 2015-02-23 11:53:20 -08:00
Howard Hinnant
ec1e6b9385 Cleanup and simplifications to SHAMap:
SHAMapTreeNode
* Remove SHAMapTreeNode::pointer and SHAMapTreeNode::ref.
* Add std includes necessary to make the header standalone.
* Remove implementation from the SHAMapTreeNode declaration.
* Make clear what part of SHAMapTreeNode is:
  1) Truly public.
  2) Used only by SHAMap.
  3) Truly private to SHAMapTreeNode.

SHAMapItem
* Remove SHAMapItem::pointer and SHAMapItem::ref.
* Add std includes necessary to make the header standalone.
* Remove implementation from the SHAMapItem declaration.
* Make clear what part of SHAMapItem is:
  1) Truly public.
  2) Used only by SHAMapTreeNode.
  3) Truly private to SHAMapItem.

SHAMapSyncFilter
* Add override for SHAMapSyncFilter-derived functions.
* Add missing header.
* Default the destructor and delete the SHAMapSyncFilter copy members.

SHAMapNodeID
* Remove unused mHash member.
* Remove unused std::hash and boost::hash specializations.
* Remove unused constructor.
* Remove unused comparison with uint256.
* Remove unused getNodeID (int depth, uint256 const& hash).
* Remove virtual specifier from getString().
* Fix operator<= and operator>=.
* Document what API is used outside of SHAMap.
* Move inline definitions outside of the class declaration.

SHAMapMissingNode
* Make SHAMapType a enum class to prevent unwanted conversions.
* Remove needless ~SHAMapMissingNode() declaration/definition.
* Add referenced std includes.

SHAMapAddNode
* Make SHAMapAddNode (int good, int bad, int duplicate) ctor private.
* Move all member function definitions out of the class declaration.
* Remove dependence on beast::lexicalCastThrow.
* Make getGood() const.
* Make get() const.
* Add #include <string>.

SHAMap
* Remove unused enum STATE_MAP_BUCKETS.
* Remove unused getCountedObjectName().
* Remove SHAMap::pointer
* Remove SHAMap::ref
* Remove unused fetchPackEntry_t.
* Remove inline member function definitions from class declaration.
* Remove unused getTrustedPath.
* Remove unused getPath.
* Remove unused visitLeavesInternal.
* Make SHAMapState an enum class.
* Explicitly delete SHAMap copy members.
* Reduce access to nested types as much as possible.
* Normalize member data names to one style.

* Change last of the typedefs to usings under shamap.
* Reorder some includes ripple-first, beast-second.
* Declare a few constructions from make_shared with auto.
* Mark those SHAMap member functions which can be, with const.

* Add missing includes
2015-02-23 11:44:57 -08:00
Tom Ritchford
315a8b6b60 Use jss for many Json fields.
* Document JsonFields.
  * Remove some unused JsonFields values.
2015-02-23 14:36:34 -05:00
Nik Bougalis
558c6b621b Clean up JSON code:
* Remove obsolete files
* Remove obsolete preprocessor configuration tags and decorations
* Remove arcane functionality (YAML compatibility, comment support)
* Enforce strict mode (single root)
* Improve parsing of numerical types
* Misc. cleanups
2015-02-23 14:36:34 -05:00
Edward Hennis
6d91d02c62 Unit test simulated ledgers can do signature verification. 2015-02-23 14:34:37 -05:00
Josh Juran
436ded68b7 Add unit tests for wallet keypair generation:
* Allow `passphrase` to be a seed encoded in any of three formats or a
    literal passphrase.
  * Recognize the absence of `passphrase` as requesting a random seed.

Extract walletPropose() and keypairForSignature() as separately factored
functions (from doWalletPropose() and transactionSign() respectively) to
facilitate unit testing.
2015-02-23 14:34:35 -05:00
JoelKatz
3ec88b3665 Implement getFetchPack using visitDifferences 2015-02-23 14:34:34 -05:00
Tom Ritchford
2caedb38a6 Set version to 0.28.0-b6 2015-02-18 13:31:31 -05:00
Vinnie Falco
49378ab7fe Fix streambuf bug:
The buffers_type::iterator could hold a pointer to a buffers_type that
was destroyed. This changes buffers_type::iterator to point to the
original streambuf instead, which always outlives the iterator.
2015-02-18 13:31:18 -05:00
Vinnie Falco
982dc6aa8c Reject invalid requests on peer port sooner. 2015-02-18 13:31:18 -05:00
Mark Travis
33175187b7 Don't VACUUM SQLite databases on startup with online delete enabled. 2015-02-18 13:31:18 -05:00
Tom Ritchford
0339904920 Update nudb comments. 2015-02-18 13:31:18 -05:00
Vinnie Falco
8bda9487c6 Add shamap::Family injection bundle 2015-02-18 13:31:18 -05:00
seelabs
617d84c0ef BasicConfig support for legacy values:
* A legacy value is a config section with a single-line.
* These values may be read from the BasicConfig interface so
  the deprecated Config class does not need to be exposed to
  clients.
* Made Config class more testable.
2015-02-18 13:31:18 -05:00
Vinnie Falco
ac64731d55 Set version to 0.27.1-rc3 2015-02-12 12:59:48 -08:00
Vinnie Falco
5dc064e971 Revert "Disable Overlay socket handoffs"
This reverts commit 8eb05d0950.
2015-02-12 12:59:48 -08:00
Vinnie Falco
c24732ed4e Fix streambuf bug:
The buffers_type::iterator could hold a pointer to a buffers_type that
was destroyed. This changes buffers_type::iterator to point to the
original streambuf instead, which always outlives the iterator.
2015-02-12 12:59:35 -08:00
Vinnie Falco
ba710bee86 Reject invalid requests on peer port sooner. 2015-02-12 12:43:42 -08:00
Vinnie Falco
c20392ca80 Set version to 0.27.1-rc2 2015-02-11 20:53:27 -08:00
Vinnie Falco
8eb05d0950 Disable Overlay socket handoffs 2015-02-11 20:53:27 -08:00
Tom Ritchford
b11ad375cd Set version to 0.28.0-b5 2015-02-11 20:42:38 -05:00
Josh Juran
7a6d533014 Refactor GenerateDeterministicKey and its call sites:
Remove the use of ec_key parameters and return values from ECDSA crypto
prototypes.  Don't store key data into an ec_key variable only to fetch
it back into the original type again.  Use uint256 and Blob explicitly.

Pass private keys as uint256, and pass public keys as either pointer and
length or Blob in calls to ECDSA{Sign,Verify}() and {en,de}cryptECIES().

Replace GenerateRootDeterministicKey() with separate functions returning
either the public or private key, since no caller needs both at once.

Simplify the use of GenerateDeterministicKey within RippleAddress.  Call
a single routine rather than pass the result of one as input to another.

Add openssl unit with RAII classes for bignum, bn_ctx, and ec_point plus
free utility functions.

Rewrite the functions in GenerateDeterministicKey.cpp to use RAII rather
than explicit cleanup code:
  * factor out secp256k1_group and secp256k1_order for reuse rather than
    computing them each time
  * replace getPublicKey() with serialize_ec_point(), which makes, sets,
    and destroys an ec_key internally (sparing the caller those details)
    and calls i2o_ECPublicKey() directly
  * return bignum rather than ec_key from GenerateRootDeterministicKey()
  * return ec_point rather than EC_KEY* from GenerateRootPubKey()

Move ECDSA{Private,Public}Key() to a new ECDSAKey unit.
Move ec_key.h into impl/ since it's no longer used outside crypto/.

Remove now-unused member functions from ec_key.

Change tabs to spaces; trim trailing whitespace (including blank lines).
2015-02-11 20:42:38 -05:00
Howard Hinnant
be44f75d2d Add missing includes. 2015-02-11 20:42:38 -05:00
Vinnie Falco
ab14123aed Remove obsolete classes:
Legacy workarounds for Visual Studio non thread-safe initialization
of function local objects with static storage duration are removed:

* Remove LeakChecked
* Remove StaticObject
* Remove SharedSingleton
2015-02-11 20:42:38 -05:00
Tom Ritchford
a963a6d10d Add noexcept qualifier to swaps and moves. 2015-02-11 20:42:38 -05:00
Vinnie Falco
69b4cd22a2 Speed up some unit tests:
A few of the slowest unit tests are modified to process a smaller data
set size, to reduce the time required to run all unit tests.
2015-02-11 20:14:44 -05:00
Vinnie Falco
958325653f Add elapsed time report for unit test runner:
When unit tests are complete, the longest running tests if any are logged.
2015-02-11 20:14:44 -05:00
Josh Juran
c5dc419f9e Remove unused source file 2015-02-11 20:14:44 -05:00
Vinnie Falco
2a201f9525 Add RocksDB to nudb import tool (RIPD-781,785):
This custom tool is specifically designed for very fast import of
RocksDB nodestore databases into NuDB.
2015-02-11 20:14:44 -05:00
Vinnie Falco
b7ba509618 NuDB: Use nodeobject codec in Backend (RIPD-793):
This adds codecs for snappy and lz4, and a new nodeobject codec. The
nodeobject codec provides a highly efficient custom compression scheme
for inner nodes, which make up the majority of nodestore databases.
Non inner node objects are compressed using lz4.

The NuDB backend is modified to use the nodeobject codec. This change
is not backward compatible - older NuDB databases cannot be opened or
imported.
2015-02-11 14:41:33 -08:00
Vinnie Falco
f946d7b447 Remove obsolete NodeObject fields:
Legacy fields of NodeObject are removed, as they are no longer
used and there is a space savings from omitting them:

* Remove LedgerIndex
2015-02-11 14:41:32 -08:00
Vinnie Falco
e2a5535ed6 NuDB: Performance improvements (RIPD-793,796):
This introduces changes in nudb to improve speed, reduce database size,
and enhance correctness. The most significant change is to store hashes
rather than entire keys in the key file. The output of the hash function
is reduced to 48 bits, and stored directly in buckets.

The API is also modified to introduce a Codec parameter allowing for
compression and decompression to be supported in the implementation
itself rather than callers.

THe data file no longer contains a salt, as the salt is applicable
only to the key and log files. This allows a data file to have multiple
key files with different salt values. To distinguish physical files
belonging to the same logical database, a new field UID is introduced.
The UID is a 64-bit random value generated once on creation and stored
in all three files.

Buckets are zero filled to the end of each block, this is a security
measure to prevent unintended contents of memory getting stored to
disk. NuDB offers the varint integer type, this is identical to
the varint described by Google.

* Add varint
* Add Codec template argument
* Add "api" convenience traits
* Store hash in buckets
* istream can throw short read errors
* Support std::uint8_t format in streams
* Make file classes part of the public interface
* Remove buffers pessimization, replace with buffer
* Consolidate creation utility functions to the same header
* Zero fill unused areas of buckets on disk
* More coverage and improvements to the recover test
* Fix file read/write to loop until all bytes processed
* Add verify_fast, faster verify for large databases

The database version number is incremented to 2; older databases can
no longer be opened and should be deleted.
2015-02-11 14:41:31 -08:00
Vinnie Falco
0f94e2c0c3 Set version to 0.27.1-rc1 2015-02-10 16:22:14 -08:00
Vinnie Falco
a25508b98d Add RocksDB to nudb import tool (RIPD-781,785):
This custom tool is specifically designed for very fast import of
RocksDB nodestore databases into NuDB.
2015-02-10 16:22:14 -08:00
Vinnie Falco
e825433a38 NuDB: Use nodeobject codec in Backend (RIPD-793):
This adds codecs for snappy and lz4, and a new nodeobject codec. The
nodeobject codec provides a highly efficient custom compression scheme
for inner nodes, which make up the majority of nodestore databases.
Non inner node objects are compressed using lz4.

The NuDB backend is modified to use the nodeobject codec. This change
is not backward compatible - older NuDB databases cannot be opened or
imported.
2015-02-10 16:22:13 -08:00
Vinnie Falco
d1c08889fe Remove obsolete NodeObject fields:
Legacy fields of NodeObject are removed, as they are no longer
used and there is a space savings from omitting them:

* Remove LedgerIndex
2015-02-10 16:22:13 -08:00
Vinnie Falco
0b82b5a0d6 NuDB: Performance improvements (RIPD-793,796):
This introduces changes in nudb to improve speed, reduce database size,
and enhance correctness. The most significant change is to store hashes
rather than entire keys in the key file. The output of the hash function
is reduced to 48 bits, and stored directly in buckets.

The API is also modified to introduce a Codec parameter allowing for
compression and decompression to be supported in the implementation
itself rather than callers.

THe data file no longer contains a salt, as the salt is applicable
only to the key and log files. This allows a data file to have multiple
key files with different salt values. To distinguish physical files
belonging to the same logical database, a new field UID is introduced.
The UID is a 64-bit random value generated once on creation and stored
in all three files.

Buckets are zero filled to the end of each block, this is a security
measure to prevent unintended contents of memory getting stored to
disk. NuDB offers the varint integer type, this is identical to
the varint described by Google.

* Add varint
* Add Codec template argument
* Add "api" convenience traits
* Store hash in buckets
* istream can throw short read errors
* Support std::uint8_t format in streams
* Make file classes part of the public interface
* Remove buffers pessimization, replace with buffer
* Consolidate creation utility functions to the same header
* Zero fill unused areas of buckets on disk
* More coverage and improvements to the recover test
* Fix file read/write to loop until all bytes processed
* Add verify_fast, faster verify for large databases

The database version number is incremented to 2; older databases can
no longer be opened and should be deleted.
2015-02-10 16:22:13 -08:00
Vinnie Falco
a33d0d4fb6 Add general delimiter split() to rfc2616 2015-02-08 19:43:37 -08:00
Vinnie Falco
ba42334d36 Add lz4
Conflicts:
	Builds/VisualStudio2013/RippleD.vcxproj
	Builds/VisualStudio2013/RippleD.vcxproj.filters
2015-02-08 19:43:26 -08:00
Vinnie Falco
dad460dcfc Squashed 'src/lz4/' content from commit e25b51d
git-subtree-dir: src/lz4
git-subtree-split: e25b51de7b51101e04ceea194dd557fcc23c03ca
2015-02-08 19:43:04 -08:00
Vinnie Falco
2e62641aa4 Merge commit 'dad460dcfc8466a8e1c59529d490829fcfaeee73' as 'src/lz4' 2015-02-08 19:43:04 -08:00
Vinnie Falco
3ae23b6a54 Remove spurious call to fetch in NuDBBackend 2015-02-08 19:42:07 -08:00
Vinnie Falco
97126f18b1 Add /crawl cgi request feature to peer protocol (RIPD-729):
This adds support for a cgi /crawl request, issued over HTTPS to the configured
peer protocol port. The response to the request is a JSON object containing
the node public key, type, and IP address of each directly connected neighbor.
The IP address is suppressed unless the neighbor has requested its address
to be revealed by adding "Crawl: public" to its HTTP headers. This field is
currently set by the peer_private option in the rippled.cfg file.
2015-02-08 19:42:01 -08:00
Vinnie Falco
3838d222c2 NuDB: limit size of mempool (RIPD-787):
Insert now blocks when the size of the memory pool exceeds a predefined
threshold. This solves the problem where sustained insertions cause the
memory pool to grow without bound.
2015-02-08 19:41:54 -08:00
Vinnie Falco
96c3292210 Add missing include 2015-02-08 19:41:48 -08:00
Vinnie Falco
b0fd92cb3f Fix unsafe iterator dereference in PeerFinder 2015-02-08 19:41:43 -08:00
Vinnie Falco
62c5b5e570 Add general delimiter split() to rfc2616 2015-02-07 15:19:55 -08:00
Vinnie Falco
feaa0871ac Add lz4 2015-02-07 06:38:37 -08:00
Vinnie Falco
9f41976926 Merge commit '1784f24c5f81e864bf0ad8dcfdf4266ca1108290' as 'src/lz4' 2015-02-05 15:40:04 -08:00
Vinnie Falco
1784f24c5f Squashed 'src/lz4/' content from commit e25b51d
git-subtree-dir: src/lz4
git-subtree-split: e25b51de7b51101e04ceea194dd557fcc23c03ca
2015-02-05 15:40:04 -08:00
Vinnie Falco
fc47d9fc4d Set version to 0.28.0-b4 2015-02-03 16:24:34 -08:00
Vinnie Falco
eade9f8f2b Revert RocksDB backend settings:
This reverts the change that makes RocksDBQuick the default settings for
node_db "type=rocksdb". The quick settings can be obtained by setting
"type=rocksdbquick".

RocksDBQuick settings are implicated in memory over-utilization problems
seen recently.
2015-02-03 16:24:34 -08:00
Vinnie Falco
6276c55cc9 Set version to 0.27.0-sp1 2015-02-03 14:58:02 -08:00
Vinnie Falco
afa6ff7c4b Revert RocksDB backend settings:
This reverts the change that makes RocksDBQuick the default settings for
node_db "type=rocksdb". The quick settings can be obtained by setting
"type=rocksdbquick".

RocksDBQuick settings are implicated in memory over-utilization problems
seen recently.
2015-02-03 14:57:54 -08:00
Vinnie Falco
f4dcbe3a84 Remove spurious call to fetch in NuDBBackend 2015-02-03 12:56:35 -08:00
Vinnie Falco
9c02cc1b17 Add /crawl cgi request feature to peer protocol (RIPD-729):
This adds support for a cgi /crawl request, issued over HTTPS to the configured
peer protocol port. The response to the request is a JSON object containing
the node public key, type, and IP address of each directly connected neighbor.
The IP address is suppressed unless the neighbor has requested its address
to be revealed by adding "Crawl: public" to its HTTP headers. This field is
currently set by the peer_private option in the rippled.cfg file.
2015-02-03 12:56:35 -08:00
seelabs
0cc3ef8f90 Add missing include:
* Compile previously failed on Mac with clang
2015-02-03 12:56:32 -08:00
Tom Ritchford
4cbbacc946 Set version to 0.28.0-b3 2015-02-02 17:01:50 -08:00
Vinnie Falco
9a0c71d4a7 NuDB: limit size of mempool (RIPD-787):
Insert now blocks when the size of the memory pool exceeds a predefined
threshold. This solves the problem where sustained insertions cause the
memory pool to grow without bound.
2015-02-02 17:01:19 -08:00
Vinnie Falco
0f1b831de7 Add missing include 2015-02-02 17:01:18 -08:00
Vinnie Falco
37a7a2aacd Fix unsafe iterator dereference in PeerFinder 2015-02-02 17:01:18 -08:00
Tom Ritchford
635b157b11 Fix C++ guards in beast. 2015-02-02 17:01:18 -08:00
Tom Ritchford
c3ae4da83a Fix include guards in rippled. 2015-02-02 17:01:17 -08:00
Tom Ritchford
c3809ece67 New RPC method "version". 2015-02-02 17:01:17 -08:00
Howard Hinnant
bfc436dccd Add metadata to transaction difference logging: RIPD-775 2015-02-02 17:01:16 -08:00
Nik Bougalis
71d6874236 Set version to 0.28.0-b2 2015-01-28 16:34:33 -08:00
Vinnie Falco
9bf1f994ae Remove buffer_view 2015-01-28 16:34:33 -08:00
Vinnie Falco
bb4127a6fb Refactor Serializer and SerializerIterator interfaces:
* Remove unused members
* SerialIter holds only a pointer and offset now
* Use free functions for some Serializer members
* Use SerialIter in some places instead of Serializer
2015-01-28 16:34:33 -08:00
Edward Hennis
a691632995 Support a "--noserver" command line option in tests:
* Run npm/integration tests without launching rippled, using a
  running instance of rippled (possibly in a debugger) instead.
* Works for "npm test" and "mocha"
2015-01-28 16:34:33 -08:00
Miguel Portilla
5d6ea3d75f Combine history_ledger_index and online_delete (RIPD-774) 2015-01-28 16:34:33 -08:00
Mark Travis
43873b1b2c Initialize canDelete_ properly in the constructor. 2015-01-28 16:34:33 -08:00
Mark Travis
9430f3665b Speed up access to ledger index value that can be deleted. 2015-01-28 16:34:33 -08:00
Vinnie Falco
f3c1f63444 Remove LevelDB and HyperLevelDB backends:
The LevelDB and HyperLevelDB are removed from the backend choices. Neither
were recommended for production environments. As RocksDB is not available
on Windows platforms yet, the recommended backend choice for Windows is NuDB.
2015-01-28 13:43:00 -08:00
Nik Bougalis
b5c7232d6f Set version to 0.28.0-b1 2015-01-27 18:21:54 -08:00
Edward Hennis
2f3677d593 Change timing on "sequence realignment" test. 2015-01-27 18:21:54 -08:00
Howard Hinnant
1e0efaffe8 Add missing includes. 2015-01-27 18:21:54 -08:00
Vinnie Falco
fc79754750 Remove unused SHAMap fields 2015-01-26 19:25:38 -08:00
Miguel Portilla
0e4de42be8 Add RPC metrics (RIPD-705)
Add metrics to record the number of RPC requests received. Record the number of
node store fetches performed per request. Additionally record the byte size of
each request response and measure the response time of each request in
milliseconds.

A new class, ScopedMetrics, uses the Boost Thead Local Storage mechanism to
efficiently record NodeStore metrics within the same thread.
2015-01-26 19:25:38 -08:00
Scott Determan
4e389127b5 Use microsecond granularity for sqlite lock backoff algorithm:
When sql tries to acquire a lock that is already held, it sleeps for some
microseconds using the usleep function and then try to acquire the lock
again. However, if the HAVE_USLEEP macro is not defined then the sleep
function will be used.

This fix will define HAVE_USLEEP even when it is not already defined by
the system. Although some Linux distros may not define HAVE_USLEEP,
all supported versions provide usleep. If the system does not actually
have a usleep function, then the compiler will flag the error.
2015-01-26 19:13:40 -08:00
Nik Bougalis
47593730d6 Modernize code:
* Clean STBase-derived class creation interfaces
* Annotate overriden STBase virtual functions
* Optimize path deserialization
* Prefer range-based for
* Prefer std::unique_ptr
* Remove BOOST_FOREACH
2015-01-26 19:13:40 -08:00
Tom Ritchford
e742da73bd Simplify lookupLedger(). 2015-01-26 19:13:40 -08:00
Vinnie Falco
890bf3cce1 Add PeerFinder Logic backoff unit test 2015-01-26 19:13:40 -08:00
Nik Bougalis
60eb312e3b Fix order of construction of Application members 2015-01-26 19:13:40 -08:00
Tom Ritchford
06207da185 Move Context.h up into rpc/. 2015-01-26 19:13:40 -08:00
Nicholas Dudfield
4dc2cf8a6b Update tests to support latest ripple-lib:
* Update ripple-lib api usage
* Use latest npm ripple-lib
  * Tested with bignumber.js branch and tip of develop
* Use new version of coffee-script
  * Better source maps
* Update mocha
* Add assert-diff for better error reporting
* Add rconsole, enabled via USE_RCONSOLE env var
  * For use with manual installation only
2015-01-26 19:13:40 -08:00
Scott Determan
44450bf644 Enable Amendments from config file or static data (RIPD-746):
* The rippled.cfg file has a new section called "amendments"

* Each line in this section contains two white-space separated items
** The first item is the ID of the amendment (a 256-bit hash)
** The second item is the friendly name

* Replaces config section name macros with variables

* Make addKnown arguments safer

* Added lock to addKnown
2015-01-26 19:13:02 -08:00
Nik Bougalis
312aec79ca Remove WalletAdd (RIPD-725) 2015-01-26 12:39:13 -08:00
Nik Bougalis
a8578c73f8 Remove support for deprecated PreviousTxnID field (RIPD-710):
The PreviousTxnID field has been deprecated and should not be used for
transactions that use the field will now be rejected.

The AccountTxnID feature should be used instead by enabling transaction
tracking and specifying a transaction ID at submission. More details
are available at: https://ripple.com/build/transactions/#accounttxnid
2015-01-26 12:39:13 -08:00
Miguel Portilla
c522ffa6db Eliminate temREDUNDANT_SEND_MAX (RIPD-590):
The rules for when a SendMax is redundant are complicated. It is easier to
always allow a SendMax and eliminate temREDUNDANT_SEND_MAX.
2015-01-26 12:39:13 -08:00
Nik Bougalis
93b7599b1c Fix missing 'else' when handling sfMessageKey:
When clearing out a message key the transactor would incorrectly
create an empty `sfMessageKey` field instead of simply deleting
the field.

Clarify logic by reordering checks.
2015-01-26 12:39:13 -08:00
Nik Bougalis
3ccbd7c9b2 Finalize autobridging implementation (RIPD-179):
Autobridging uses XRP as a natural bridge currency to allow IOU-to-IOU orders
to be satisfied not only from the direct IOU-to-IOU books but also over the
combined IOU-to-XRP and XRP-to-IOU books.

This commit addresses the following issues:

* RIPD-486: Refactoring the taker into a unit-testable architecture
* RIPD-659: Asset-aware offer crossing
* RIPD-491: Unit tests for IOU to XRP, XRP to IOU and IOU to IOU
* RIPD-441: Handle case when autobridging over same owner offers
* RIPD-665: Handle case when autobridging over own offers
* RIPD-273: Groom order books while crossing
2015-01-26 12:39:13 -08:00
Nik Bougalis
385a87db31 Claim a fee when a required destination tag is not specified (RIPD-574) 2015-01-26 12:39:12 -08:00
Nik Bougalis
5530353eef Add simplified explicit interfaces to handle XRP and IOU transfers:
The new interfaces take into account the different semantics of XRP, which
do not have an issuer or transfer fees, and IOUs which have issuers and
(optional) transfer fees.

For XRP, the new `LedgerEntrySet::transfer_xrp` will transfer the specified
amount of XRP between from a given source to a given destination.

For IOU, two new functions are introduced:
* `LedgerEntrySet::issue_iou` which transfers the specified amount of an
IOU from the IOU's issuer to an account.
* `LedgerEntrySet::redeem_iou` which transfers the specified amount of an
IOU from an account to the IOU's issuer.

A transfer from user-to-user (e.g. to fill an order during offer crossing)
requires the use of `redeem_iou` followed by `issue_iou`. This helps to
enforce the Ripple invariant that IOUs never flow directly from user to
user, but only through a gateway. Additionally, this  allows for the
explicit calculation and application of transfer fees by varying the
amounts redeemed and issued.

The new interfaces promote type safety since you cannot use the issue
and redeem APIs with XRP or the transfer API with IOU, and the issuer
to be used is implied by the currency being issued or redeemed.
2015-01-26 12:39:12 -08:00
Nik Bougalis
d1193093ef Require the master key when performing certain operations (RIPD-666):
* When disabling the use of the master key; or
* When enabling 'no freeze'.
2015-01-26 12:39:12 -08:00
David Schwartz
b203db27a4 Fix offer->ACCOUNT->offer 2015-01-26 12:39:12 -08:00
JoelKatz
0a3e1af04c When pathfinding, don't output a redundant account node 2015-01-26 12:39:12 -08:00
Vinnie Falco
c6c8e5d70c Set version to 0.27.0 2015-01-26 10:56:11 -08:00
Nik Bougalis
fa354ec8d9 Set version to 0.27.0-b11 2015-01-23 17:37:18 -08:00
Nik Bougalis
d0375f697d Invoke correct deleter 2015-01-23 17:34:30 -08:00
Vinnie Falco
33c8257d25 Set version to 0.27.0-b10 2015-01-21 15:25:11 -08:00
Scott Determan
f389bc33c3 VSProject: Handle tuples in CPPDEFINES:
The VSProject generator now handles tuples in addition to strings and
dicts when converting environment variables such as CPPDEFINES.
2015-01-21 15:20:06 -08:00
Vinnie Falco
4d5dca71ce Squelch Peerfinder fixed connection attempts 2015-01-21 14:59:47 -08:00
Vinnie Falco
a9c44a1b9c Set version to 0.27.0-b9 2015-01-21 14:23:50 -08:00
Vinnie Falco
4144f800a1 Fix PeerImp concurrent access of socket:
The PeerImp::run launch function is now dispatched on the strand to prevent
undefined behavior resulting from concurrent access to the ssl::stream object.
2015-01-21 14:21:43 -08:00
Vinnie Falco
6ef9a81017 Set version to 0.27.0-b8 2015-01-21 14:21:43 -08:00
Vinnie Falco
8c6722f3c5 Remove use of date and time from rocksdb unity build 2015-01-21 14:21:43 -08:00
Vinnie Falco
40e138627b Fixes to Overlay:
* Make ~Peer virtual
* Call close in ConnectAttempt::stop
* Handle nullptr return in new_outbound_slot
* Check gracefulClose_ in read loop
2015-01-21 10:48:32 -08:00
Vinnie Falco
a470dda4e6 Fix Journal::Stream::active to return the correct value 2015-01-21 10:48:32 -08:00
Edward Hennis
b725410623 Option to specify rippled path on command line.
* --rippled=<absolute or relative path>
* Works for "npm test" and "mocha"
* Remove "rippled_path" from config.js to require CLI path.
2015-01-21 10:48:31 -08:00
Miguel Portilla
a9dfb33126 Log abnormal close time offsets (RIPD-572) 2015-01-21 10:48:31 -08:00
Miguel Portilla
8b848770dc Add config "ledger_history_index" functionality (RIPD-559) 2015-01-21 10:48:31 -08:00
Vinnie Falco
94629edb9b Add NuDB backend:
The NuDB database backend is a high performance key/value store presented
as an alternative to RocksDB on Mac and Linux deployments, and the preferred
backend option for Windows deployments. The LevelDB backend is deprecated for
all platforms.

This includes these changes:

* Add Backend::verify API for doing consistency checks
* Add Database::close so caller can catch exceptions
* Improved Timing test for NodeStore creates a simulated workload
2015-01-21 10:48:30 -08:00
Vinnie Falco
2a3f2ca28d Add NuDB: A Key/Value Store For Decentralized Systems
NuDB is a high performance key/value database optimized for insert-only
workloads, with these features:

* Low memory footprint
* Values are immutable
* Value sizes from 1 2^48 bytes (281TB)
* All keys are the same size
* Performance independent of growth
* Optimized for concurrent fetch
* Key file can be rebuilt if needed
* Inserts are atomic and consistent
* Data file may be iterated, index rebuilt.
* Key and data files may be on different volumes
* Hardened against algorithmic complexity attacks
* Header-only, nothing to build or link
2015-01-21 10:48:30 -08:00
Edward Hennis
8ab1e7d432 Integration test to subscribe to offer books. 2015-01-20 16:45:04 -08:00
Miguel Portilla
b2ba6a0c85 Fix RPC subscribe with multiple books 2015-01-20 16:45:04 -08:00
Tom Ritchford
cca5421aed Fix Subscribe RPC to correctly distinguish bids and asks. 2015-01-20 16:45:04 -08:00
Nik Bougalis
799d9a73e6 Ensure that hash_append will never throw
Conflicts:
	src/beast/beast/net/IPAddress.h
2015-01-20 16:45:03 -08:00
Scott Determan
b0781622b2 Handle nullptr return values to InboundLedgers::findCreate
In normal operation, InboundLedgers::findCreate never returns null, but
during system shutdown, it will return null.

Since this only happens in system shutdown, when findCreate returns null
the calling function stops what it was doing and returns.

During testing, an issue where destroying the application object
and creating a new one caused problems with a static PathTable. This table
is now cleared when re-initialized.
2015-01-20 16:45:03 -08:00
Tom Ritchford
0d0eec6345 Clean up test documentation and a log message. 2015-01-20 16:45:03 -08:00
Nik Bougalis
1af79f7960 Properly validate the configured online delete interval 2015-01-20 16:45:03 -08:00
Vinnie Falco
15b570bbdd Add profile targets for gcc and clang 2015-01-20 16:45:02 -08:00
Tom Ritchford
7aa5599cc2 Remove unused parameter in two lambdas. 2015-01-20 16:45:02 -08:00
JoelKatz
676293ec42 Ensure account_tx queries over and returns correct range 2015-01-20 16:45:02 -08:00
Nik Bougalis
abc4fb81b1 Improve RippleLineCache hashing 2015-01-20 16:45:01 -08:00
Vinnie Falco
53a16f354f Add hardened_hash to basics/:
xxhasher is the default hash function for hardened_hash.
2015-01-20 16:45:01 -08:00
Vinnie Falco
6ab1ecd836 Tidy up container hash functions:
* Add xxhasher
* Move fnv1a, siphash, spookyto hash/
* Move hash_append, uhash to hash/
* Move hash_speed_test to hash/
* Move hash classes to individual header files
* Remove hardened_hash
2015-01-20 16:45:01 -08:00
Vinnie Falco
e7b16e7b47 Add rngfill 2015-01-20 16:45:01 -08:00
Vinnie Falco
14804f81a8 Optimize calls to unit_test::suite::expect:
This changes expect and unexpected to receive the reason text as a
template argument, allowing the std::string conversion of char const*
parameters to take place only if the condition evaluates to false. This
cuts all calls to malloc and free on tests that pass.
2015-01-20 16:45:00 -08:00
Vinnie Falco
9a61b8d77d Declare base_uints with using statements 2015-01-20 16:45:00 -08:00
Vinnie Falco
f42c2763d5 Improve streambuf unit test 2015-01-20 16:45:00 -08:00
Vinnie Falco
98d4e0e1b5 Fix ZeroCopyOutputStream:
Added a destructor that commits the last block of data
if there was no final call to BackUp.
2015-01-20 16:45:00 -08:00
Tom Ritchford
9156633baf Set version to 0.27.0-b7 2015-01-20 17:59:55 -05:00
Tom Ritchford
bcf4f836b4 Use websocketpp_02 namespace. 2015-01-20 17:08:15 -05:00
Vinnie Falco
dbc1d70f99 Set version to 0.27.0-b6 2015-01-20 09:41:27 -08:00
Vinnie Falco
78bc190a85 Merge commit '02855d7fed46d3c1aa1f2cefbcf4a42720575c3f' as 'src/websocketpp' 2015-01-20 09:35:00 -08:00
Vinnie Falco
02855d7fed Squashed 'src/websocketpp/' content from commit 875d420
git-subtree-dir: src/websocketpp
git-subtree-split: 875d420952
2015-01-20 09:35:00 -08:00
Vinnie Falco
6fdd5d32be Rename websocket/ to websocketpp_02 2015-01-20 09:34:54 -08:00
Vinnie Falco
d7f32b105b Set version to 0.27.0-b5 2015-01-13 11:50:58 -08:00
Vinnie Falco
0ac480a0bd Fix extra increment in GenerateRootDeterministicKey 2015-01-13 11:49:59 -08:00
Tom Ritchford
417996de02 Set version to 0.27.0-b4 2015-01-13 11:30:23 -05:00
Tom Ritchford
6c2d60cec2 Prevent RPC handlers from returning non-objects. 2015-01-13 11:30:23 -05:00
Tom Ritchford
743bd6c917 Fix RPC command logrotate to return a Json object. 2015-01-13 11:30:14 -05:00
Edward Hennis
ab61aa41d9 Set version to 0.27.0-b3 2015-01-12 18:00:55 -05:00
Edward Hennis
36396ae29e rippled.cfg [db_node] options for RocksDB
* open_files and compression.
2015-01-12 18:00:54 -05:00
Vinnie Falco
749e083e6e NodeStore improvements:
* Add Backend::verify API for doing consistency checks
* Add Database::close so caller can catch exceptions
* Improved Timing test for NodeStore creates a simulated workload
2015-01-12 18:00:52 -05:00
Vinnie Falco
67b9cf9e82 Improved support for exceptions in threads spawned by unit tests:
Unit tests that wish to spawn threads for testing concurrency may now do so
by using unit_test::thread as a replacement for std::thread. These threads
propagate unhandled exceptions to the unit test, and work with the abort on
failure feature.
2015-01-12 17:17:09 -05:00
Vinnie Falco
27fb20f3ab Add xor_shift_engine 2015-01-12 17:17:07 -05:00
Josh Juran
1c71b274f0 SConstruct: Add ed25519.c
Conflicts:
	Builds/VisualStudio2013/RippleD.vcxproj
	Builds/VisualStudio2013/RippleD.vcxproj.filters
	SConstruct
2015-01-12 12:16:26 -08:00
Vinnie Falco
fcd20b63fe Merge commit '8ec344ac1b6c66d936fa0f7005490e126a434a70' as 'src/ed25519-donna' 2015-01-12 11:27:15 -08:00
Vinnie Falco
8ec344ac1b Squashed 'src/ed25519-donna/' content from commit 04223b0
git-subtree-dir: src/ed25519-donna
git-subtree-split: 04223b04e22f5eff32c6c27e25194d4d984c6f41
2015-01-12 11:27:15 -08:00
Vinnie Falco
df966a9ac6 Set version to 0.27.0-b2 2015-01-05 18:49:18 -08:00
Vinnie Falco
f634666dc6 Make rocksdbquick settings default:
This removes the old default configuration for the "rocksdb" backend and
replaces it with the configuration that was formerly available using
the experimental backend "rocksdbquick".

The new configuration setting improves the performance of the key/value
database by changing the compaction style and tuning the size parameters for
the typical rippled workload. Testing shows a decrease in I/O spikes for both
reading and writing.
2015-01-05 18:49:17 -08:00
Tom Ritchford
e2f9f5d7e5 Fix compilation warnings. 2015-01-05 18:49:17 -08:00
Tom Ritchford
d078b0d143 Extract the git ID into a separate compilation unit. 2015-01-05 18:49:15 -08:00
Nik Bougalis
0ccdea3cd8 Disable Ticket transactions and tests 2015-01-05 14:18:27 -08:00
Vinnie Falco
df54b47cd0 Tidy up includes and add modules to the classic build:
An alternative to the unity build, the classic build compiles each
translation unit individually. This adds more modules to the classic build:

* Remove unity header app.h
* Add missing includes as needed
* Remove obsolete NodeStore backend code
* Add app/, core/, crypto/, json/, net/, overlay/, peerfinder/ to classic build
2015-01-05 13:35:57 -08:00
Vinnie Falco
2e595830b3 Levelize SHAMap:
The SHAMap class is refactored into a separate module where each translation
unit compiles separate without errors. Dependencies on higher level business
logic are removed. SHAMap now depends only on basics, crypto, nodestore,
and protocol:

* Inject NodeStore::Database& to SHAMap
* Move sync filter instances to app/ledger/
* Move shamap to its own module
* Move FullBelowCache to shamap/
* Move private code to shamap/impl/
* Refactor SHAMap treatment of missing node handler
* Inject and use Journal for logging in SHAMap
2015-01-05 11:46:11 -08:00
Vinnie Falco
96fbcc9a5a Refactor NodeStore:
Manager is changed to be a Meyer's singleton, with factories automatically
registering upon construction.
2015-01-05 11:46:11 -08:00
Vinnie Falco
6283801981 Add non-unity build targets:
The SConstruct is modified to provide a new family of targets, ending with
the suffix ".nounity", which compile individual translation units instead of
some of the unity translation units ("classic" builds). Two modules updated
for this treatment are ripple/basics/ and ripple/protocol/, with plans to
update more in the future. A consequence is longer build times in some cases.
A benefit of classic builds is that missing includes can be identified
through compiler errors.
2015-01-05 11:46:11 -08:00
Vinnie Falco
9a3214d46e Normalize files containing unit test code:
Source files are split to place all unit test code into translation
units ending in .test.cpp with no other business logic in the same file,
and in directories named "test".

A new target is added to the SConstruct, invoked by:
    scons count
This prints the total number of source code lines occupied by unit tests,
in rippled specific code and excluding library subtrees.
2015-01-05 11:46:07 -08:00
Vinnie Falco
9eb7c8344f Don't leak track StringPairArray 2015-01-05 11:44:15 -08:00
Vinnie Falco
4140bbb1f7 Set version to 0.27.0-b1 2015-01-05 11:37:01 -08:00
Vinnie Falco
ea44497136 Fix msvc ICE on initializer-list 2015-01-05 11:37:00 -08:00
Nik Bougalis
07737c6e5b Add 'delivered_amount' to Transaction JSON (RIPD-643):
The synthetic field 'delivered_amount' can be used to determine the exact
amount delivered by a Payment without having to check the DeliveredAmount
field, if present, or the Amount field otherwise.

The field is only returned when metadata is available and the data is not
returned in binary format.
2014-12-31 01:55:10 -08:00
JoelKatz
98d5eefc86 Pathfinding bugfixes (RIPD-735):
* Fix specifying paths and search level for ripple_path_find
* Don't modify the pathfinder, it has issuer-neutral paths.
* Handle previous paths correctly
* Compare paths correctly
2014-12-31 01:55:10 -08:00
JoelKatz
4f2d93bb65 Avoid processing transactions if we need a network ledger
Not processing tranasctions without a network ledger makes
initial network synchronization faster.
2014-12-31 01:55:10 -08:00
Edward Hennis
a5df3f1747 Support a "no_server" flag in test config.
* Will use a running instance of rippled (possibly in a debugger).
* Modify all tests to respect the server_default value.
* Fail test if new account already exists and has a balance.
* README.md with instructions for advanced test debugging, particularly using no_server.
2014-12-31 01:55:10 -08:00
Howard Hinnant
7f5f73887d Fix undefined behavior 2014-12-31 01:55:10 -08:00
Nik Bougalis
91ce7807b9 Remove legacy LoadTypes (RIPD-365) 2014-12-31 01:55:10 -08:00
Nik Bougalis
d26fae9875 Reduce Beast dependencies by leveraging C++11 features:
* Remove beast::Atomic (RIPD-728):
  * Use std-provided alternatives
  * Eliminate atomic variables where possible

* Cleanup beast::Thread interface:
  * Use std::string instead of beast::String
  * Remove unused functions and parameters

* Remove unused code:
  * beast::ThreadLocalValue
  * beast::ServiceQueue
2014-12-31 01:55:10 -08:00
Nik Bougalis
60bdc79ec4 Remove unused sitefiles module 2014-12-30 12:33:41 -08:00
Tom Ritchford
253ddf2998 Split off CheckLibraryVersions.test.cpp. 2014-12-30 12:33:41 -08:00
Nik Bougalis
9fa15b390a Always initialize LedgerHandler options field 2014-12-29 11:21:19 -08:00
Josh Juran
e7d6fe6c8b Cull duplicate/unused code in RippleAddress:
Deduplicate a call to GeneratePublicDeterministicKey().
Remove unused member functions.
2014-12-29 11:21:19 -08:00
Tom Ritchford
9650b1aa70 New ripple::TestSuite with method expectEquals(). 2014-12-29 11:21:19 -08:00
Howard Hinnant
eafa6f960f API for improved Unit Testing (RIPD-432):
* Added new test APIs allowing easy ways to create ledgers, apply
  transactions to them, close and advance them.

* Moved Ledger tests from Ledger.cpp to Ledger.test.cpp.

* Changed several TransactionEngine log priorities from lsINFO to lsDEBUG to
  reduce unnecessary verbosity in the log messages while running these tests.

* Moved LedgerConsensus:applyTransactions from a private member function to a
  free function so that it could be accessed externally, and without having to
  reference a LedgerConsensus object.  This was done to facilitate the new
  testing API.
2014-12-29 11:21:19 -08:00
Yana
c62ccf4870 Update README.md (RIPD-601) 2014-12-29 11:21:19 -08:00
Vinnie Falco
ef34439a79 Set version to 0.26.5-rc1 2014-12-22 15:20:03 -08:00
Nik Bougalis
b328ec2462 Prevent passing of non-POD types to POD-only interfaces:
This tidies up the code that produces random numbers to conform
to programming best practices and reduce dependencies.

* Use std::random_device instead of platform-specific code
* Remove RandomNumbers class and use free functions instead
2014-12-22 15:19:48 -08:00
Vinnie Falco
60f27178b8 Levelization, improve structure of source files:
Source files are moved between modules, includes changed and added,
and some code rewritten, with the goal of reducing cross-module dependencies
and eliminating cycles in the dependency graph of classes.

* Remove RippleAddress dependency in CKey_test
* ByteOrder.h, Blob.h, and strHex.h are moved to basics/. This makes
  the basics/ module fully independent of other ripple sources.
* types/ is merged into protocol/. The protocol module now contains
  all primitive types specific to the Ripple protocol.
* Move ErrorCodes to protocol/
* Move base_uint to basics/
* Move Base58 to crypto/
* Remove dependence on Serializer in GenerateDeterministicKey
* Eliminate unity header json.h
* Remove obsolete unity headers
* Remove unnecessary includes
2014-12-22 10:23:49 -08:00
Vinnie Falco
e3fbb83ad0 Tidy up usage of std::begin, std::end 2014-12-19 11:55:43 -08:00
Nik Bougalis
28b70a7b9a Remove 'Proof of Work' code 2014-12-19 11:00:29 -08:00
Nicholas Dudfield
dcdc341d0f Add appveyor 2014-12-19 11:00:29 -08:00
Tom Ritchford
fce77c9372 Configuration for yielding RPC server. 2014-12-19 11:00:28 -08:00
Tom Ritchford
a360c481c2 Refactor out a version of lookupLedger returning Status. 2014-12-19 11:00:28 -08:00
Tom Ritchford
c72db5fa5f Refactor away RPCHandler::doRpcCommand 2014-12-19 11:00:28 -08:00
Tom Ritchford
fc9a23d6d4 Send output incrementally in ServerHandlerImp. 2014-12-19 11:00:27 -08:00
Tom Ritchford
167f4666e2 New generic Ledger RPC handler. 2014-12-19 11:00:27 -08:00
Tom Ritchford
1cbcc7be21 Allow the Ledger to generically output to both Json models. 2014-12-19 11:00:27 -08:00
Tom Ritchford
8053598069 Better interoperation between Json::Value and JsonObject.
* Generic functions to add entries to both object models.
* Add Json::Value into JsonObjects.
* Write Json::Value to string incrementally.
* Get rid of ripple::RPC::New namespace
2014-12-19 11:00:26 -08:00
Tom Ritchford
7cfac1a91a Wrap Output in a coroutine that periodically yields. 2014-12-19 11:00:26 -08:00
Tom Ritchford
192cdd028e Change Output to be a generic std::function. 2014-12-19 11:00:26 -08:00
Tom Ritchford
029c143922 Add a comment to ledger/Ledger.h. 2014-12-19 11:00:26 -08:00
Tom Ritchford
00298cc68c Simplify LedgerData.cpp. 2014-12-19 11:00:25 -08:00
Tom Ritchford
d9c7db51af Make three ErrorCode functions generic. 2014-12-19 11:00:25 -08:00
Vinnie Falco
f12b15d22b Fix logic in HTTP/S server:
These bugs do not affect production code since callers do not invoke
`write` multiple times, but these would become a problem in the future.

* Access to Peer::write_queue_ is synchronized correctly.
* Remove unsafe access to deleted container element.
2014-12-19 11:00:25 -08:00
Vinnie Falco
409b8bac00 Remove unused and obsolete Ripple identifiers and tidy up:
These identifiers were part of a failed set of classes to replace
the functionality combined into RippleAddress. They are not used
and therefore can be removed.

* Remove RippleAccountPrivateKey
* Remove RippleAccountPublicKey
* Remove RippleAccountID
* Remove RipplePrivateKey
* Remove RipplePublicKeyHash
* Remove RippleLedgerHash
* Remove unused withCheck argument
* Remove CryptoIdentifier
* Remove IdentifierStorage
* Remove IdentifierType
* Remove SimpleIdentifier
* Add missing include
2014-12-19 11:00:24 -08:00
Vinnie Falco
28b09bde4b Simplify RipplePublicKey:
This implements the bare minimum necessary to store a 33 byte public
key and use it in ordered containers. It is an efficient and well
defined alternative to RippleAddress when the caller only needs
a node public key.
2014-12-19 11:00:24 -08:00
Vinnie Falco
2f6af906f4 Validators work (RIPD-703):
This replaces the experimental validators module with foundational
code to implement a new system for tracking validators, validations and
the UNL. The code is turned off by default, in BeastConfig.h

* Remove obsolete public Manager interfaces
* Remove obsolete database methods
* Remove obsolete ChosenList concept
* Remove obsolete code
* Add missing includes
* Tidy up STValidation.h
* Move factory function to Validators::make_Manager
* Add Connection object for tracking STValidations
2014-12-19 11:00:23 -08:00
Vinnie Falco
628e3ac1eb Add waitable_executor 2014-12-18 10:26:55 -08:00
Josh Juran
fbf5785e35 Combine STTx::checkSign overloads:
Callers don't need to specify the signing key -- they're just retrieving
the key from the SerializedTransaction and then passing it back.

This simplifies Ed25519 implementation.
2014-12-12 20:14:02 -08:00
Nicholas Dudfield
eeea2b1ff8 Use ppa:afrank/boost 1.57 for Travis 2014-12-12 20:14:02 -08:00
Vinnie Falco
32062e439f Split peer connect logic to another class (RIPD-711):
All of the logic for establishing an outbound peer connection including
the initial HTTP handshake exchange is moved into a separate class. This
allows PeerImp to have a strong invariant: All PeerImp objects that exist
represent active peer connections that have already gone through the
handshake process.
2014-12-12 20:14:02 -08:00
Vinnie Falco
930a0beaf1 Add ZeroCopyOutputStream and tidy up 2014-12-12 20:14:02 -08:00
Nik Bougalis
4a49fefdd9 Various cleanups:
* Replace SYSTEM_NAME and other macros with C++ constructs
* Remove RIPPLE_ARRAYSIZE and use std::extent or ranged for loops
* Remove old-style, unused offer crossing unit test
* Make STAmount::saFromRate free and remove default argument
2014-12-12 20:14:02 -08:00
Nik Bougalis
8e792855e0 Do not use path if path expansion fails 2014-12-10 16:55:06 -08:00
Tom Ritchford
69f5c6987a Whitespace: clean WebSockets to 80 columns. 2014-12-10 16:55:06 -08:00
Nik Bougalis
85fc9e4ecf Revert e4c9822d78 "Enable processor-specific optimizations when available:" 2014-12-08 14:54:03 -08:00
Mark Travis
d5c3f0c9cf Stability bugfixes for online delete SHAMapStore:
The correct ledger age is necessary for checking health
status, and the previous behavior caused the online deletion process to
abort if the process took too long.

The tuning parameter added and the parameter whose default was modified both
minimize impact of SQL DELETE operations by decreasing the default batch size
for deletes and for increasing the backoff period between deletion batches.
These parameters decrease contention for the SQLite and I/O with the trade-off
of longer processing time for online delete. Online-delete is not a
time-critical function, so a little slowness in wall-clock time is not harmful.
2014-12-08 14:54:03 -08:00
JoelKatz
a48120e675 Fix incorrect source issuer for XRP source 2014-12-08 14:54:03 -08:00
Nik Bougalis
36f8e4f2ad Improve hex conversion & parsing routines 2014-12-08 14:54:03 -08:00
David Schwartz
1084a39a45 Improve the humanAccountID cache (RIPD-693)
Profiling indicated some performance issues coming from the
cache of 160-bit account IDs to base58 format. This replaces
the single cache with two caches and rotates out old
entries.
2014-12-08 14:54:03 -08:00
Tom Ritchford
86df482842 Make sure that handlers always return Json::objectValue. 2014-12-01 17:16:24 -05:00
Tom Ritchford
b0d47ebcc6 Use better base64 handling in ServerHandlerImp. 2014-12-01 17:15:23 -05:00
Tom Ritchford
fffdf1dfba Make beast::detail::chunk_encoded_buffers::to_hex() static 2014-12-01 11:12:59 -05:00
Tom Ritchford
3273ed2616 Remove unused BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES. 2014-12-01 10:56:03 -05:00
Vinnie Falco
aa7b0a31b0 Refactor protocol message parsing:
This replaces the stateful class parser with a stateless free function.
The protocol buffer message is parsed using a ZeroCopyInputStream.

* Invoke method is now a free function.
* Protocol handler doesn't need to derive from an abstract interface
* Only up to one message is processed at a time by the invoker.
* Remove error_code return from the handler's message processing functions.
* Add ZeroCopyInputStream implementation that wraps a BufferSequence.
* Free function parses up to one protocol message and calls the handler.
* Message type and size can be calculated from an iterator
  range or a buffer sequence.
2014-11-26 12:23:21 -08:00
Vinnie Falco
fb0d44d403 Use cluster state in Slot instead of PeerImp 2014-11-26 12:23:10 -08:00
Vinnie Falco
cd8ec89cbb Use injections from OverlayImpl in PeerImp 2014-11-26 12:23:02 -08:00
Vinnie Falco
252f271dc5 Fixes to beast::asio::streambuf:
* Fix to_string conversion
* Fix assert on debug invariant checks
* Fix the treatment of the output position when the entire output is committed.
* Add unit test
2014-11-26 12:22:55 -08:00
Vinnie Falco
62d400c3a9 Move the call to cancel_timer to the right place 2014-11-26 12:22:46 -08:00
Scott Schurr
f9aa3e0da5 Add more unit tests to rpc/impl/TransactionSign (RIPD-480):
By adding a mock it is possible to test the transactionSign
function without interacting with the ledger.  This is the
smallest change I could come up with that allows transactionSign
to be unit tested.

The unit tests are white boxed.  Each test case is a result
of examining the code and identifying behavior associated with
different JSON fields.  That means the tests are not based on
requirements, they are based on observed behavior.
2014-11-26 12:07:44 -08:00
Vinnie Falco
685fe5b0fb Don't call std::exit on clean exit 2014-11-25 19:19:56 -08:00
Vinnie Falco
5180e71a0d Remove unused chrono::time_point stream conversions 2014-11-25 19:19:56 -08:00
Vinnie Falco
55637f7508 Template abstract_clock on Clock:
The abstract_clock is now templated on a type meeting the requirements of
the Clock concept. It inherits the nested types of the Clock on which it
is based. This resolves a problem with the original design which broke the
type-safety of time_point from different abstract clocks.
2014-11-25 19:19:56 -08:00
Nicholas Dudfield
7d72dfe0be Updated freeze tests:
* Always run freeze tests (and  enforcement tests)
* book_offers filtering tests are broken
2014-11-25 11:46:34 -08:00
Mark Travis
02529a0fc2 SHAMapStore Online Delete (RIPD-415):
Makes rippled configurable to support deletion of all data in its key-value
store (nodestore) and ledger and transaction SQLite databases based on
validated ledger sequence numbers. All records from a specified ledger
and forward shall remain available in the key-value store and SQLite, and
all data prior to that specific ledger may be deleted.

Additionally, the administrator may require that an RPC command be
executed to enable deletion. This is to align data deletion with local
policy.
2014-11-25 11:44:02 -08:00
JoelKatz
b44974677e Cleanup some stray formatting left in logs 2014-11-21 17:13:13 -08:00
Vinnie Falco
d4fd5e4fce HTTP Handshaking for Peers on Universal Port (RIPD-446):
This introduces a considerable change in the way that peers handshake. Instead
of sending the TMHello protocol message, the peer making the connection (client
role) sends an HTTP Upgrade request along with some special headers. The peer
acting in the server role sends an HTTP response completing the upgrade and
transition to RTXP (Ripple Transaction Protocol, a.k.a. peer protocol). If the
server has no available slots, then it sends a 503 Service Unavailable HTTP
response with a JSON content-body containing IP addresses of other servers to
try. The information that was previously contained in the TMHello message is
now communicated in the HTTP request and HTTP response including the secure
cookie to prevent man in the middle attacks. This information is documented
in the overlay README.md file.

To prevent disruption on the network, the handshake feature is rolled out in
two parts. This is part 1, where new servents acting in the client role will
send the old style TMHello handshake, and new servents acting in the server
role can automatically detect and accept both the old style TMHello handshake,
or the HTTP request accordingly. This detection happens in the Server module,
which supports the universal port. An experimental .cfg setting allows clients
to instead send HTTP handshakes when establishing peer connections. When this
code has reached a significant fraction of the network, these clients will be
able to establish a connection to the Ripple network using HTTP handshakes.

These changes clean up the handling of the socket for peers. It fixes a long
standing bug in the graceful close sequence, where remaining data such as the
IP addresses of other servers to try, did not get sent. Redundant state
variables for the peer are removed and the treatment of completion handlers is
streamlined. The treatment of SSL short reads and secure shutdown is also fixed.

Logging for the peers in the overlay module are divided into two partitions:
"Peer" and "Protocol". The Peer partition records activity taking place on the
socket while the Protocol partition informs about RTXP specific actions such as
transaction relay, fetch packs, and consensus rounds. The severity on the log
partitions may be adjusted independently to diagnose problems. Every log
message for peers is prefixed with a small, unique integer id in brackets,
to accurately associate log messages with peers.

HTTP handshaking is the first step in implementing the Hub and Spoke feature,
which transforms the network from a homogeneous network where all peers are
the same, into a structured network where peers with above average capabilities
in their ability to process ledgers and transactions self-assemble to form a
backbone of high powered machines which in turn serve a much larger number of
'leaves' with lower capacities with a goal to improve the number of
transactions that may be retired over time.
2014-11-21 16:47:12 -08:00
Vinnie Falco
30123eaa4a Add WrappedSink:
This class puts a configured string prefix in front of
each line of Journal output.
2014-11-21 16:46:57 -08:00
Nik Bougalis
454ec97d51 Replace custom exceptions with std::runtime_error 2014-11-21 13:15:41 -08:00
Vinnie Falco
c2ac331e78 Fix unit_test suite matching with full names 2014-11-21 12:59:32 -08:00
Nik Bougalis
be4a35af11 Clarify SetAccount logic and clean up existing code 2014-11-21 12:59:32 -08:00
Tom Ritchford
445b29ad0d Fix RPC handlers to use the results of lookupLedger. 2014-11-21 12:59:32 -08:00
Vinnie Falco
64d0f7fffd Fix DecayingSample treatment of the window 2014-11-21 12:59:32 -08:00
Nik Bougalis
baf0d09455 Simplify the Beast fatal error reporting framework:
* Reduce interface to a single function which reports error details
* Remove unused functions
2014-11-21 12:59:32 -08:00
Vinnie Falco
08a81a0ab9 Tidy up the structure of sources in protocol/:
Split out and rename STValidation
Split out and rename STBlob
Split out and rename STAccount
Split out STPathSet
Split STVector256 and move UintTypes to protocol/
Rename to STBase
Rename to STLedgerEntry
Rename to SOTemplate
Rename to STTx
Remove obsolete AgedHistory
Remove types.h and add missing includes
Remove unnecessary includes in app.h
Remove unnecessary includes in app.h
Remove include app.h from app1.cpp
2014-11-20 20:15:29 -08:00
Nik Bougalis
31110c7fd9 Cleanup ripple::Ledger:
* Convert static member functions to free functions
* Adopt consistent naming convention
* De-inline code
2014-11-20 20:15:29 -08:00
Vinnie Falco
0e1dd92d9b Fix case where slot==nullptr in Overlay:
This changes the Overlay to correctly handle the case when nullptr is
returned by PeerFinder new_inbound_slot on a detected self-connection.
2014-11-20 20:15:29 -08:00
Vinnie Falco
a3204a4df7 Add http::chunk_encode:
This transforms a ConstBufferSequence into a new ConstBufferSequence whose
data is encoded according to the Content transfer encoding rules of RFC2616.
The implementation does not copy any memory.
2014-11-20 20:15:29 -08:00
Donovan Hide
2288ab48b9 Use asio signal handling in Application (RIPD-140):
* Use signal_set as cross platform way of handling SIGINT
* Remove polling on main thread for shutdown.
* Add extra logging for received signal.
* Clean up exit handling on error in setup routines.
* Reuse isStopped() from Stoppable for status (could be isStopping() instead).
* Ctrl-C should now work for standalone mode as well on Windows.

Also small fixes to Resolver:
* Add Resolver prefix to logging.
* Fix AsyncObject::removeReference() logic.
* Fix work remaining logic.
2014-11-20 20:15:29 -08:00
mDuo13
670401884c Improve the human-readable description of the tesSUCCESS code:
Transactions that return tesSUCCESS have only been accepted and
propagated on the Ripple network and should not be considered
final until they have been included in a validated ledger.
2014-11-20 20:14:04 -08:00
Yana
37181c341e Changed doc/rippled-example.cfg to specify default for ssl_verify 2014-11-14 11:19:42 -08:00
wltsmrz
be7e677448 Update integration tests for changes to ripple-lib account request API:
Account requests expect an object as first argument
2014-11-14 11:10:12 -08:00
Josh Juran
b2eeb49a45 Clean up CKey and RippleAddress (RIPD-672)
* Remove CKey dependency on RippleAddress
* Create RAII ec_key wrapper that hides EC_KEY and other OpenSSL details
* Move CKey member logic into free functions
* Delete CKey class
* Rename units that are no longer CKey-related
* Delete code that was unused
2014-11-14 11:10:12 -08:00
Vinnie Falco
9aa040d917 Accept generic arguments in ci_equal 2014-11-14 11:10:11 -08:00
Vinnie Falco
c2043a223b Tidy up split_commas function and use it in Server
Conflicts:
	src/ripple/server/impl/ServerHandlerImp.cpp
2014-11-14 11:10:11 -08:00
Vinnie Falco
f24e859f17 Construct Server after Overlay and WSDoors:
When the ServerHandler is constructed before the Overlay, an incoming
connection received after the server's listening ports have been opened
but before the Overlay object has been created causes a crash.
2014-11-14 11:10:11 -08:00
Vinnie Falco
737b33f9d1 Merge branch 'release' into develop 2014-11-14 10:56:45 -08:00
David Schwartz
00791d2151 Set version to 0.26.4-sp3 2014-11-11 16:33:52 -08:00
David Schwartz
b141598f9b Fix bugs in pathfinding with XRP as the source currency 2014-11-11 16:27:39 -08:00
Tom Ritchford
d1618d79b0 Fix pathfinding with multiple issuers for one currency (RIPD-618).
* Allow pathfinding requests where the starting currency may have
  multiple issuers.

* Cache paths over all issuers to avoid repeating work.

* Clear the ledger checkpoint in one retry case.

* Add an additional node at the front of paths when the starting issuer
  is not the source account.
2014-11-11 16:27:03 -08:00
Tom Ritchford
00c84dfe5c Clean up Pathfinder.
* Restrict to 80-columns and other style cleanups.
* Make pathfinding a free function and hide the class Pathfinder.
* Split off unrelated utility functions into separate files.
2014-11-11 16:26:38 -08:00
Vinnie Falco
95f31b98a8 Set version to 0.26.4-sp2 2014-11-11 14:22:37 -08:00
Miguel Portilla
10d74ed100 Fix account_lines, account_offers and book_offers result (RIPD-682):
The RPC account_lines and account_offers commands respond with the correct ledger info. account_offers, account_lines and book_offers allow admins unlimited size on the limit param. Specifying a negative value on limit clamps to the minimum value allowed. Incorrect types for limit are correctly reported in the result.
2014-11-11 14:21:49 -08:00
Vinnie Falco
8a7f612d5b Revert pathfinding changes:
* 5e7c527 Revert "Fix account_lines, account_offers and book_offers result (RIPD-682):"
* b3417ca Revert "Fix pathfinding with multiple issuers for one currency (RIPD-618)."
* 00db7f5 Revert "Clean up Pathfinder."
2014-11-11 14:21:40 -08:00
Tom Ritchford
0829ee9234 Add missing header needed for boost 1.57 compatibility. 2014-11-10 23:23:53 -05:00
Nik Bougalis
b22e33444b Make Stoppable unit tests manual 2014-11-10 23:23:53 -05:00
David Schwartz
d115a12cbe Remove dead TxQueue code 2014-11-10 23:23:53 -05:00
Nik Bougalis
b7b744de94 Remove sole use of beast::MurmurHash 2014-11-10 15:00:20 -08:00
Nik Bougalis
68e46e406a Remove MurmurHash from Beast 2014-11-10 14:00:54 -08:00
Miguel Portilla
a46ae4efec Set version to 0.26.4-sp1 2014-11-10 16:25:45 -05:00
Miguel Portilla
62777a794e Fix account_lines, account_offers and book_offers result (RIPD-682):
The RPC account_lines and account_offers commands respond with the correct ledger info. account_offers, account_lines and book_offers allow admins unlimited size on the limit param. Specifying a negative value on limit clamps to the minimum value allowed. Incorrect types for limit are correctly reported in the result.
2014-11-10 16:25:14 -05:00
Tom Ritchford
329a969761 Remove unused RPCServer. 2014-11-10 12:53:21 -08:00
Vinnie Falco
30170bc394 Add short_read manual unit test:
This manual unit test explores the outcomes of shutting down
SSL stream connections at various point during a session.
2014-11-10 12:52:57 -08:00
Vinnie Falco
f193302e15 Add WrappedSink 2014-11-10 12:52:57 -08:00
Vinnie Falco
7c4870d641 Add operator<< for basic_streambuf 2014-11-10 12:52:43 -08:00
Vinnie Falco
8b84a76d5d Make ci_equal a function 2014-11-10 12:52:42 -08:00
Vinnie Falco
a4cd761372 Add rfc2616::parse_csv 2014-11-10 12:52:42 -08:00
Miguel Portilla
63d2cfd6ba Fix account_lines, account_offers and book_offers result (RIPD-682):
The RPC account_lines and account_offers commands respond with the correct
ledger info. account_offers, account_lines and book_offers allow admins
unlimited size on the limit param. Specifying a negative value on limit clamps
to the minimum value allowed. Incorrect types for limit are correctly reported
in the result.
2014-11-10 12:46:36 -08:00
Tom Ritchford
bb44bdd047 Fix pathfinding with multiple issuers for one currency (RIPD-618).
* Allow pathfinding requests where the starting currency may have
  multiple issuers.

* Cache paths over all issuers to avoid repeating work.

* Clear the ledger checkpoint in one retry case.

* Add an additional node at the front of paths when the starting issuer
  is not the source account.
2014-11-10 12:07:57 -05:00
Tom Ritchford
6904e66384 Clean up Pathfinder.
* Restrict to 80-columns and other style cleanups.
* Make pathfinding a free function and hide the class Pathfinder.
* Split off unrelated utility functions into separate files.
2014-11-10 12:06:49 -05:00
Vinnie Falco
fbffe2367e Fix weak_fn unit test. 2014-11-09 20:27:05 -08:00
Vinnie Falco
e442a2846d Overlay improvements and bug fixes:
PeerImp::detach had a default argument graceful=true which did not
correctly close the socket and cause the Overlay to often hang on exit.
The logging for Overlay and Peers has been reworked. All the socket activity
is logged to Peers while protocol activity goes to Protocol. Every log line
is prefixed by a small integer ID unique to the connection.
* Removed graceful PeerImp::detach option
* Peer and Protocol log message handle respective types of logging
* Log messages prefixed with peer unique integer
* Prevent call to timer ancel from throwing an exception
2014-11-08 14:39:46 -08:00
Vinnie Falco
f6985586ea Better logging when opening Server ports. 2014-11-08 14:36:45 -08:00
Vinnie Falco
2bae5b0959 Throw if rippled.cfg is missing a [server] section 2014-11-08 14:36:45 -08:00
Vinnie Falco
1e58809fcc Remove obsolete get_pointer 2014-11-08 14:36:44 -08:00
Vinnie Falco
6b1d213cc2 Add weak_fn 2014-11-08 14:36:44 -08:00
David Schwartz
42bec13a83 Add missing include needed for std::bad_cast in LexicalCast.h 2014-11-07 15:23:43 -08:00
Vinnie Falco
4415a179b3 Update freeze test for moved TxFlags.h 2014-11-07 14:12:43 -08:00
Vinnie Falco
5d42604efd Refactor the structure of source files:
* New src/ripple/crypto and src/ripple/protocol directories
* Merged src/ripple/common into src/ripple/basics
* Move resource/api files up a level
* Add headers for "include what you use"
* Normalized include guards
* Renamed to JsonFields.h
* Remove obsolete files
* Remove net.h unity header
* Remove resource.h unity header
* Removed some deprecated unity includes
2014-11-07 13:40:43 -08:00
Vinnie Falco
b134b7d3f6 Add missing includes. 2014-11-07 12:24:02 -08:00
Vinnie Falco
788219fe05 Adjust SSL context generation for Server:
The creation of self-signed certificates slows down the command
line client when launched repeatedly during unit test.
* Contexts are no longer generated for the command line client
* A port with no secure protocols generates an empty context
2014-11-07 06:13:56 -08:00
Tom Ritchford
9a7f66cfe9 Fix compilation errors in RPC/RipplePathFind.cpp 2014-11-06 21:58:13 -05:00
Tom Ritchford
daa4d16e61 Remove unused isXRP(Issue) function. 2014-11-06 20:17:13 -05:00
Tom Ritchford
cf05f87795 Fix pathfinding with multiple issuers for one currency (RIPD-618).
* Allow pathfinding requests where the starting currency may have
  multiple issuers.

* Cache paths over all issuers to avoid repeating work.

* Clear the ledger checkpoint in one retry case.

* Add an additional node at the front of paths when the starting issuer
  is not the source account.
2014-11-06 20:14:01 -05:00
Tom Ritchford
c2f2f83b7c Clean up Pathfinder.
* Restrict to 80-columns and other style cleanups.
* Make pathfinding a free function and hide the class Pathfinder.
* Split off unrelated utility functions into separate files.

Conflicts:
	src/ripple/rpc/handlers/RipplePathFind.cpp
2014-11-06 16:58:10 -08:00
Tom Ritchford
b30b2a523f Fix public member names of RPC::Context.
Conflicts:
	src/ripple/rpc/handlers/AccountTx.cpp
	src/ripple/rpc/handlers/AccountTxOld.cpp
	src/ripple/rpc/handlers/Ledger.cpp
	src/ripple/rpc/handlers/LedgerData.cpp
	src/ripple/rpc/handlers/RipplePathFind.cpp
	src/ripple/rpc/handlers/ServerInfo.cpp
	src/ripple/rpc/handlers/ServerState.cpp
	src/ripple/rpc/handlers/Submit.cpp
	src/ripple/rpc/handlers/Subscribe.cpp
	src/ripple/rpc/handlers/TxHistory.cpp
	src/ripple/rpc/handlers/Unsubscribe.cpp
	src/ripple/rpc/impl/Context.h
2014-11-06 16:55:20 -08:00
Nicholas Dudfield
150a3810a8 Update npm test rippled.cfg to use [server]:
The test now generates a configuration file with the new
configuration sections define by the Universal Port feature.
2014-11-06 16:10:00 -08:00
Vinnie Falco
ac0eaa912b Universal Port (RIPD-160):
This changes the behavior and configuration specification of the listening
ports that rippled uses to accept incoming connections for the supported
protocols: peer (Peer Protocol), http (JSON-RPC over HTTP), https (JSON-RPC)
over HTTPS, ws (Websockets Clients), and wss (Secure Websockets Clients).
Each listening port is now capable of handshaking in multiple protocols
specified in the configuration file (subject to some restrictions). Each
port can be configured to provide its own SSL certificate, or to use a
self-signed certificate. Ports can be configured to share settings, this
allows multiple ports to use the same certificate or values. The list of
ports is dynamic, administrators can open as few or as many ports as they
like. Authentication settings such as user/password or admin user/admin
password (for administrative commands on RPC or Websockets interfaces) can
also be specified per-port.

As the configuration file has changed significantly, administrators will
need to update their ripple.cfg files and carefully review the documentation
and new settings.

Changes:

* rippled-example.cfg updated with documentation and new example settings:
  All obsolete websocket, rpc, and peer configuration sections have been
  removed, the documentation updated, and a new documented set of example
  settings added.

* HTTP::Writer abstraction for sending HTTP server requests and responses
* HTTP::Handler handler improvements to support Universal Port
* HTTP::Handler handler supports legacy Peer protocol handshakes
* HTTP::Port uses shared_ptr<boost::asio::ssl::context>
* HTTP::PeerImp and Overlay use ssl_bundle to support Universal Port
* New JsonWriter to stream message and body through HTTP server
* ServerHandler refactored to support Universal Port and legacy peers
* ServerHandler Setup struct updated for Universal Port
* Refactor some PeerFinder members
* WSDoor and Websocket code stores and uses the HTTP::Port configuration
* Websocket autotls class receives the current secure/plain SSL setting
* Remove PeerDoor and obsolete Overlay peer accept code
* Remove obsolete RPCDoor and synchronous RPC handling code
* Remove other obsolete classes, types, and files
* Command line tool uses ServerHandler Setup for port and authorization info
* Fix handling of admin_user, admin_password in administrative commands
* Fix adminRole to check credentials for Universal Port
* Updated Overlay README.md

* Overlay sends IP:port redirects on HTTP Upgrade peer connection requests:
  Incoming peers who handshake using the HTTP Upgrade mechanism don't get
  a slot, and always get HTTP Status 503 redirect containing a JSON
  content-body with a set of alternate IP and port addresses to try, learned
  from PeerFinder. A future commit related to the Hub and Spoke feature will
  change the response to grant the peer a slot when there are peer slots
  available.

* HTTP responses to outgoing Peer connect requests parse redirect IP:ports:
  When the [overlay] configuration section (which is experimental) has
  http_handshake = 1, HTTP redirect responses will have the JSON content-body
  parsed to obtain the redirect IP:port addresses.

* Use a single io_service for HTTP::Server and Overlay:
  This is necessary to allow HTTP::Server to pass sockets to and from Overlay
  and eventually Websockets. Unfortunately Websockets is not so easily changed
  to use an externally provided io_service. This will be addressed in a future
  commit, and is one step necessary ease the restriction on ports configured
  to offer Websocket protocols in the .cfg file.
2014-11-06 16:10:00 -08:00
Vinnie Falco
05a04aa801 Set version to 0.26.4 2014-11-03 16:53:37 -08:00
Vinnie Falco
e37d4043f6 Add missing includes to make headers compile separately 2014-11-03 16:40:57 -08:00
Vinnie Falco
d073425b44 Improved beast::http::message:
* Add headers::erase
* Set http::message version with std::pair
* Use std::pair for headers::value_type
2014-11-03 16:40:57 -08:00
Nicholas Dudfield
825b18cf71 Add bin/stop-test.js shutdown testing script:
This script launches rippled repeatedly and then issues a stop command
after a variable amount of time. This is to test the shutdown of the
application and catch errors.
2014-11-03 16:31:21 -08:00
Vinnie Falco
549ad3204f Fix race conditions closing HTTP I/O objects:
This fixes a case where stop can sometimes skip calling close on some
I/O objects or crash in a rare circumstance where a connection is in the
process of being torn down at the exact time the server is stopped. When
the acceptor receives errors, it logs the error and continues listening
instead of stopping.
2014-11-03 14:11:06 -08:00
Vinnie Falco
35f9499b67 Fix Overlay stop on exit:
The stop sequence for Overlay had a race condition where autoconnect could
be called after close_all, resulting in a hang on exit. This resolves the
problem by putting the close and timer operations on a strand:
* Rename some Overlay members
* Put close on strand and tidy up members
* Use completion handler instead of coroutine for timer
* Use App io_service in PeerFinder
2014-11-03 14:11:05 -08:00
Vinnie Falco
db82c35c17 Remove spurious assert in ResolverAsioImpl 2014-11-03 14:11:05 -08:00
Vinnie Falco
73c74f753c Change to the Application io_service:
* Simplified the implementation and removed class IoServicePool
* The io_service outlives the components of the Application
2014-11-03 14:11:05 -08:00
JoelKatz
a38fb2a5dc Clear the acquiring ledger when shutting down NetworkOPs:
This solves a circular destruction problem on exit.
2014-11-03 14:11:04 -08:00
Donovan Hide
38e99e01f9 Improve nodestore benchmarking:
* Use more succinct while loops on NodeFactory.
* Better formatting of multiple test results.
* Updated benchmarks.
* Use simpler and faster RNG to generate test data.
2014-11-02 07:16:08 -08:00
Donovan Hide
a1f46e84b8 Add new RocksDBQuickFactory for benchmarking:
This new factory is intended for benchmarking against the existing RocksDBFactory and has the following differences.
* Does not use BatchWriter
* Disables WAL for writes to memtable
* Uses a hash index in blocks
* Uses RocksDB OptimizeFor… functions
See Benchmarks.md for further discussion of some of the issues raised by investigation of RocksDB performance.
2014-11-01 07:12:09 -07:00
Donovan Hide
6540804571 Add repeatable NodeStore timing benchmark:
The timing test is changed to overcome possible file buffer cache effects by creating different read access patterns. The unittest-arg command line arguments allow running the benchmarks against any of the available backends and altering the parameters passed in the same format as rippled.cfg. The num_objects parameter permits variation of the number of key/values inserted. The data is random but matches reasonably well the values that rippled might generate.
2014-11-01 07:12:08 -07:00
Howard Hinnant
ffe6707595 Refactor Stoppable:
The Stoppable interface aids in the enforcement of invariants needed to
successful start and stop a multi-threaded application composed of classes
that depend on each other in complex ways.
* Test written to confirm the current behavior.
* Comments updated to reflect the current behavior.
* Public API reduced to what is currently in use.
* Protected data members made private.
* volatile bool members changed to std::atomic<bool>.
* std::atomic<int> members changed to std::atomic<bool>.
* Name storage uses std::string
2014-10-31 21:29:16 -07:00
Tom Ritchford
9b21740c9f Delete temporary directories at the end of tests (RIPD-460). 2014-10-31 21:21:54 -07:00
Tom Ritchford
bd12e2ab95 New class TempDirectory in UnitTestUtilities. 2014-10-31 21:21:54 -07:00
Donovan Hide
bffb5ef8b4 Avoid zero initialization of Blob:
This seemed to improve the performance of the copy, although there did seem to be some byte by byte copying still present. Further investigation recommended.
2014-10-31 20:12:39 -07:00
Donovan Hide
e4c9822d78 Enable processor-specific optimizations when available:
The SConstruct is modified to enable processor specific optimizations on clang and gcc toolchains. This improves the performance of RocksDB's CRC function. It might also enable other used libraries that are in the codebase now or in the future to apply cpu-specific optimisations. The mtune option ensures that a binary compiled on one machine will function on another,
2014-10-31 20:12:39 -07:00
Vinnie Falco
73187d8832 Remove obsolete multitls and proxy websocket features 2014-10-31 15:15:40 -07:00
Vinnie Falco
8101154d5e Remove obsolete websocket PROXY port 2014-10-31 15:15:40 -07:00
Vinnie Falco
c02937fd6f Remove obsolete sections from rippled-example.cfg:
* peer_port_proxy is obsolete since the MultiSocket was removed.
* peer_ssl_cipher_list has no effect, SSL ciphers are hard coded for security.
2014-10-31 15:15:40 -07:00
Vinnie Falco
3430be4075 Add PeerFinder onRedirects function 2014-10-31 13:27:55 -07:00
Vinnie Falco
3f2b6f771f Add streambuf to_string function 2014-10-31 13:27:38 -07:00
Vinnie Falco
6e39b49cc2 Add Json::stream to write Value to a Streambuf 2014-10-31 13:27:33 -07:00
Vinnie Falco
71c34ed4e0 Remove unused ErrorReply function 2014-10-31 13:25:54 -07:00
Vinnie Falco
477178675c Fix parseIniFile for duplicate sections 2014-10-31 13:25:30 -07:00
Vinnie Falco
dbdf68b248 Refactor HTTP::Server to support Universal Port:
These changes are necessary to support the Universal port feature. Synopsis:

* Persist HTTP peer io_service::work lifetime:
This simplification eliminates any potential for bugs caused by incorrect
lifetime management of the io_service::work object.

* Restructure Door to prevent data races, and handle clean exit:
The Server, Door, Door::detector, and Peer objects work together to
correctly implement graceful stop and destructors that block until
all child objects have been destroyed.

Cleanups:
* De-pimpl HTTP::Server
* Rename ServerImpl data members
* Tidy up HTTP::Port interface
2014-10-30 16:02:19 -07:00
Vinnie Falco
2fd139b307 Refactor Overlay and add [overlay] config section (experimental):
These changes prepare Overlay for the Universal Port and Hub and Spoke
features.

* Add [overlay configuration section:
The [overlay] section uses the new BasicConfig interface that
supports key-value pairs in the section. Some exposition is added to the
example cfg file. The new settings for overlay are related to the Hub and
Spoke feature which is currently in development. Production servers should
not set these configuration options, they are clearly marked experimental
in the example cfg file.

Other changes:
* Use _MSC_VER to detect Visual Studio
* Use ssl_bundle in Overlay::Peer
* Use shared_ptr to SSL context in Overlay:
* Removed undocumented PEER_SSL_CIPHER_LIST configuration setting
* Add Section::name: The Section object now stores its name for better diagnostic messages.
2014-10-30 13:55:01 -07:00
Vinnie Falco
a6c2657062 Add shared_ptr<boost::asio::ssl::context> to ssl_bundle:
This gives the ssl_bundle shared ownership of the underlying ssl context
so that ownership of the bundle may be transferred to other classes without
introduce lifetime issues.
2014-10-30 13:55:00 -07:00
Vinnie Falco
78a0bc0e2c Make streambuf buffers_type iterators default constructible 2014-10-30 13:55:00 -07:00
Edward Hennis
d7116d6867 Enable std::array overloads for boost::asio on clang:
* Remove Boost config option from beast config.
* Define from compiler, or let Boost figure out itself.
2014-10-30 13:55:00 -07:00
Josh Juran
edc15b9fa2 Use a self-signed certificate for peers (RIPD-108):
Generate a new RSA key pair and a self-signed X.509v3 certificate to use
with SSL connections to rippled peers.  New credentials are created each
startup.
2014-10-30 13:54:49 -07:00
Josh Juran
93d4b73b2f RippleSSLContext: Add openssl wrappers 2014-10-30 10:52:37 -07:00
Vinnie Falco
8e3849e591 Create Ripple SSL contexts using std::make_shared. 2014-10-30 10:52:36 -07:00
Vinnie Falco
acaa1098f7 Separate beast::http::body from beast::http::message (RIPD-660):
This changes the http::message object to no longer contain a body. It modifies
the parser to store the body in a separate object, or to pass the body data
to a functor. This allows the body to be stored in more flexible ways. For
example, in HTTP responses the body can be generated procedurally instead
of being required to exist entirely in memory at once.
2014-10-29 19:23:53 -07:00
Vinnie Falco
c1a5e88752 Use beast::asio::streambuf in Overlay 2014-10-29 19:23:53 -07:00
Vinnie Falco
74b99014d2 Add beast::asio::basic_streambuf (RIPD-661):
This is class whose interface is identical to the boost::asio::basic_streambuf,
and uses an implementation that stores the data in multiple discontiguous
linear buffers, expanding and shrinking as needed.
2014-10-29 19:23:53 -07:00
Tom Ritchford
9cba944d21 Add Json::to_string:
This allows the declaration for FastWriter to be hidden and makes
conversion of Json::Value objects to strings a little less clunky.
2014-10-29 19:23:52 -07:00
Tom Ritchford
8c1c2f5d05 Eliminate a copy of the string returned by FastWriter 2014-10-29 19:22:44 -07:00
Tom Ritchford
bf0fa8c562 Add 'sample' npm test:
test/sample-test.js is the smallest possible npm test.
2014-10-28 10:59:59 -07:00
Donovan Hide
3e1fc9ba6c Update unit testing command line parser parameters:
A string passed by the '--unittest-arg' command line parameter is passed to
suites when unit tests run and can be used to customize test behavior.
* Add '--unittest-arg' command line argument
* Remove obsolete '--unittest-format' command line argument
2014-10-28 10:55:44 -07:00
Vinnie Falco
4ceba603e4 Improvements to beast::unit_test framework:
* Some runner member functions are now thread-safe.
* De-inline and tidy up declarations and definitions.
* arg() interface allows command lines to be passed to suites.
2014-10-28 10:41:10 -07:00
Vinnie Falco
6591c21ace Set version to 0.26.4-rc4 2014-10-27 11:49:39 -07:00
Vinnie Falco
e8d03c7b9b Update rocksdb unity file 2014-10-27 11:48:21 -07:00
Vinnie Falco
6fbce4c2f7 Update src/rocksdb2 to rocksdb-3.5.1:
Merge commit 'c168d54495d7d7b84639514f6443ad99b89ce996' into develop
2014-10-27 11:37:01 -07:00
Vinnie Falco
c168d54495 Squashed 'src/rocksdb2/' changes from 25888ae..1fdd726
1fdd726 Hotfix RocksDB 3.5
d67500a Add `make install` to Makefile in 3.5.fb.
4cb631a update HISTORY.md
cfd0946 comments about the BlockBasedTableOptions migration in Options
REVERT: 25888ae Merge pull request #329 from fyrz/master
REVERT: 89833e5 Fixed signed-unsigned comparison warning in db_test.cc
REVERT: fcac705 Fixed compile warning on Mac caused by unused variables.
REVERT: b3343fd resolution for java build problem introduced by 5ec53f3edf62bec1b690ce12fb21a6c52203f3c8
REVERT: 187b299 ForwardIterator: update prev_key_ only if prefix hasn't changed
REVERT: 5ec53f3 make compaction related options changeable
REVERT: d122e7b Update INSTALL.md
REVERT: 986dad0 Merge pull request #324 from dalgaaf/wip-da-SCA-20140930
REVERT: 8ee75dc db/memtable.cc: remove unused variable merge_result
REVERT: 0fd8bbc db/db_impl.cc: reduce scope of prefix_initialized
REVERT: 676ff7b compaction_picker.cc: remove check for >=0 for unsigned
REVERT: e55aea5 document_db.cc: fix assert
REVERT: d517c83 in_table_factory.cc: use correct format specifier
REVERT: b140375 ttl/ttl_test.cc: prefer prefix ++operator for non-primitive types
REVERT: 43c789c spatialdb/spatial_db.cc: use !empty() instead of 'size() > 0'
REVERT: 0de452e document_db.cc: pass const parameter by reference
REVERT: 4cc8643 util/ldb_cmd.cc: prefer prefix ++operator for non-primitive types
REVERT: af8c2b2 util/signal_test.cc: suppress intentional null pointer deref
REVERT: 33580fa db/db_impl.cc: fix object handling, remove double lines
REVERT: 873f135 db_ttl_impl.h: pass func parameter by reference
REVERT: 8558457 ldb_cmd_execute_result.h: perform init in initialization list
REVERT: 063471b table/table_test.cc: pass func parameter by reference
REVERT: 93548ce table/cuckoo_table_reader.cc: pass func parameter by ref
REVERT: b8b7117 db/version_set.cc: use !empty() instead of 'size() > 0'
REVERT: 8ce050b table/bloom_block.*: pass func parameter by reference
REVERT: 53910dd db_test.cc: pass parameter by reference
REVERT: 68ca534 corruption_test.cc: pass parameter by reference
REVERT: 7506198 cuckoo_table_db_test.cc: add flush after delete
REVERT: 1f96330 Print MB per second compaction throughput separately for reads and writes
REVERT: ffe3d49 Add an instruction about SSE in INSTALL.md
REVERT: ee1f3cc Package generation for Ubuntu and CentOS
REVERT: f0f7955 Fixing comile errors on OS X
REVERT: 99fb613 remove 2 space linter
REVERT: b2d64a4 Fix linters, second try
REVERT: 747523d Print per column family metrics in db_bench
REVERT: 56ebd40 Fix arc lint (should fix #238)
REVERT: 637f891 Merge pull request #321 from eonnen/master
REVERT: 827e31c Make test use a compatible type in the size checks.
REVERT: fd5d80d CompactedDB: log using the correct info_log
REVERT: 2faf49d use GetContext to replace callback function pointer
REVERT: 983d2de Add AUTHORS file. Fix #203
REVERT: abd70c5 Merge pull request #316 from fyrz/ReverseBytewiseComparator
REVERT: 2dc6f62 handle kDelete type in cuckoo builder
REVERT: 8b8011a Changed name of ReverseBytewiseComparator based on review comment
REVERT: 389edb6 universal compaction picker: use double for potential overflow
REVERT: 5340484 Built-in comparator(s) in RocksJava
REVERT: d439451 delay initialization of cuckoo table iterator
REVERT: 94997ea reduce memory usage of cuckoo table builder
REVERT: c627595 improve memory efficiency of cuckoo reader
REVERT: 581442d option to choose module when calculating CuckooTable hash
REVERT: fbd2daf CompactedDBImpl::MultiGet() for better CuckooTable performance
REVERT: 3c68006 CompactedDBImpl
REVERT: f7375f3 Fix double deletes
REVERT: 21ddcf6 Remove allow_thread_local
REVERT: fb4a492 Merge pull request #311 from ankgup87/master
REVERT: 611e286 Merge branch 'master' of https://github.com/facebook/rocksdb
REVERT: 0103b44 Merge branch 'master' of ssh://github.com/ankgup87/rocksdb
REVERT: 1dfb7bb Add block based table config options
REVERT: cdaf44f Enlarge log size cap when printing file summary
REVERT: 7cc1ed7 Merge pull request #309 from naveenatceg/staticbuild
REVERT: ba6d660 Resolving merge conflict
REVERT: 51eeaf6 Addressing review comments
REVERT: fd7d3fe Addressing review comments (adding a env variable to override temp directory)
REVERT: cf7ace8 Addressing review comments
REVERT: 0a29ce5 re-enable BlockBasedTable::SetupForCompaction()
REVERT: 55af370 Remove TODO for checking index checksums
REVERT: 3d74f09 Fix compile
REVERT: 53b0039 Fix release compile
REVERT: d0de413 WriteBatchWithIndex to allow different Comparators for different column families
REVERT: 57a32f1 change target_file_size_base to uint64_t
REVERT: 5e6aee4 dont create backup_input if compaction filter v2 is not used
REVERT: 49b5f94 Merge pull request #306 from Liuchang0812/fix_cast
REVERT: 787cb4d remove cast, replace %llu with % PRIu64
REVERT: a7574d4 Update logging.cc
REVERT: 7e0dcb9 Update logging.cc
REVERT: 57fa3cc Merge pull request #304 from Liuchang0812/fix-check
REVERT: cd44522 Merge pull request #305 from Liuchang0812/fix-logging
REVERT: 6a031b6 remove unused variable
REVERT: 4436f17 fixed #303: replace %ld with % PRId64
REVERT: 7a1bd05 Merge pull request #302 from ankgup87/master
REVERT: 423e52c Merge branch 'master' of https://github.com/facebook/rocksdb
REVERT: bfeef94 Add rate limiter
REVERT: 32f2532 Print compression_size_percent as a signed int
REVERT: 976caca Skip AllocateTest if fallocate() is not supported in the file system
REVERT: 3b897cd Enable no-fbcode RocksDB build
REVERT: f445947 RocksDB: Format uint64 using PRIu64 in db_impl.cc
REVERT: e17bc65 Merge pull request #299 from ankgup87/master
REVERT: b93797a Fix build
REVERT: adae3ca [Java] Fix JNI link error caused by the removal of options.db_stats_log_interval
REVERT: 90b8c07 Fix unit tests errors
REVERT: 51af7c3 CuckooTable: add one option to allow identity function for the first hash function
REVERT: 0350435 Fixed a signed-unsigned comparison in spatial_db.cc -- issue #293
REVERT: 2fb1fea Fix syncronization issues
REVERT: ff76895 Remove some unnecessary constructors
REVERT: feadb9d fix cuckoo table builder test
REVERT: 3c232e1 Fix mac compile
REVERT: 54cada9 Run make format on PR #249
REVERT: 27b22f1 Merge pull request #249 from tdfischer/decompression-refactoring
REVERT: fb6456b Replace naked calls to operator new and delete (Fixes #222)
REVERT: 5600c8f cuckoo table: return estimated size - 1
REVERT: a062e1f SetOptions() for memtable related options
REVERT: e4eca6a Options conversion function for convenience
REVERT: a7c2094 Merge pull request #292 from saghmrossi/master
REVERT: 4d05234 Merge branch 'master' of github.com:saghmrossi/rocksdb
REVERT: 60a4aa1 Test use_mmap_reads
REVERT: 94e43a1 [Java] Fixed 32-bit overflowing issue when converting jlong to size_t
REVERT: f9eaaa6 added include for inttypes.h to fix nonworking printf statements
REVERT: f090575 Replaced "built on on earlier work" by "built on earlier work" in README.md
REVERT: faad439 Fix #284
REVERT: 49aacd8 Fix make install
REVERT: acb9348 [Java] Include WriteBatch into RocksDBSample.java, fix how DbBenchmark.java handles WriteBatch.
REVERT: 4a27a2f Don't sync manifest when disableDataSync = true
REVERT: 9b8480d Merge pull request #287 from yinqiwen/rate-limiter-crash-fix
REVERT: 28be16b fix rate limiter crash #286
REVERT: 04ce1b2 Fix #284
REVERT: add22e3 standardize scripts to run RocksDB benchmarks
REVERT: dee91c2 WriteThread
REVERT: 540a257 Fix WAL synced
REVERT: 24f034b Merge pull request #282 from Chilledheart/develop
REVERT: 49fe329 Fix build issue under macosx
REVERT: ebb5c65 Add make install
REVERT: 0352a9f add_wrapped_bloom_test
REVERT: 9c0e66c Don't run background jobs (flush, compactions) when bg_error_ is set
REVERT: a9639bd Fix valgrind test
REVERT: d1f24dc Relax FlushSchedule test
REVERT: 3d9e6f7 Push model for flushing memtables
REVERT: 059e584 [unit test] CompactRange should fail if we don't have space
REVERT: dd641b2 fix RocksDB java build
REVERT: 53404d9 add_qps_info_in cache bench
REVERT: a52cecb Fix Mac compile
REVERT: 092f97e Fix comments and typos
REVERT: 6cc1286 Added a few statistics for BackupableDB
REVERT: 0a42295 Fix SimpleWriteTimeoutTest
REVERT: 06d9862 Always pass MergeContext as pointer, not reference
REVERT: d343c3f Improve db recovery
REVERT: 6bb7e3e Merger test
REVERT: 88841bd Explicitly cast char to signed char in Hash()
REVERT: 5231146 MemTableOptions
REVERT: 1d284db Addressing review comments
REVERT: 55114e7 Some updates for SpatialDB
REVERT: 171d4ff remove TailingIterator reference in db_impl.h
REVERT: 9b0f7ff rename version_set options_ to db_options_ to avoid confusion
REVERT: 2d57828 Check stop level trigger-0 before slowdown level-0 trigger
REVERT: 659d2d5 move compaction_filter to immutable_options
REVERT: 048560a reduce references to cfd->options() in DBImpl
REVERT: 011241b DB::Flush() Do not wait for background threads when there is nothing in mem table
REVERT: a2bb7c3 Push- instead of pull-model for managing Write stalls
REVERT: 0af157f Implement full filter for block based table.
REVERT: 9360cc6 Fix valgrind issue
REVERT: 02d5bff Merge pull request #277 from wankai/master
REVERT: 88a2f44 fix comments
REVERT: 7c16e39 Merge pull request #276 from wankai/master
REVERT: 8237738 replace hard-coded number with named variable
REVERT: db8ca52 Merge pull request #273 from nbougalis/static-analysis
REVERT: b7b031f Merge pull request #274 from wankai/master
REVERT: 4c2b1f0 Merge remote-tracking branch 'upstream/master'
REVERT: a5d2863 typo improvement
REVERT: 9f8aa09 Don't leak data returned by opendir
REVERT: d1cfb71 Remove unused member(s)
REVERT: bfee319 sizeof(int*) where sizeof(int) was intended
REVERT: d40c1f7 Add missing break statement
REVERT: 2e97c38 Avoid off-by-one error when using readlink
REVERT: 40ddc3d add cache bench
REVERT: 9f1c80b Drop column family from write thread
REVERT: 8de151b Add db_bench with lots of column families to regression tests
REVERT: c9e419c rename options_ to db_options_ in DBImpl to avoid confusion
REVERT: 5cd0576 Fix compaction bug in Cuckoo Table Builder. Use kvs_.size() instead of num_entries in FileSize() method.
REVERT: 0fbb3fa fixed memory leak in unit test DBIteratorBoundTest
REVERT: adcd253 fix asan check
REVERT: 4092b7a Merge pull request #272 from project-zerus/patch-1
REVERT: bb6ae0f fix more compile warnings
REVERT: 6d31441 Merge pull request #271 from nbougalis/cleanups
REVERT: 0cd0ec4 Plug memory leak during index creation
REVERT: 4329d74 Fix swapped variable names to accurately reflect usage
REVERT: 45a5e3e Remove path with arena==nullptr from NewInternalIterator
REVERT: 5665e5e introduce ImmutableOptions
REVERT: e0b99d4 created a new ReadOptions parameter 'iterate_upper_bound'
REVERT: 51ea889 Fix travis builds
REVERT: a481626 Relax backupable rate limiting test
REVERT: f7f973d Merge pull request #269 from huahang/patch-2
REVERT: ef5b384 fix a few compile warnings
REVERT: 2fd3806 Merge pull request #263 from wankai/master
REVERT: 1785114 delete unused Comparator
REVERT: 1b1d961 update HISTORY.md
REVERT: 703c3ea comments about the BlockBasedTableOptions migration in Options
REVERT: 4b5ad88 Merge pull request #260 from wankai/master
REVERT: 19cc588 change to filter_block std::unique_ptr support RAII
REVERT: 9b976e3 Merge pull request #259 from wankai/master
REVERT: 5d25a46 Merge remote-tracking branch 'upstream/master'
REVERT: dff2b1a typo improvement
REVERT: 343e98a Reverting import change
REVERT: ddb8039 RocksDB static build Make file changes to download and build the dependencies .Load the shared library when RocksDB is initialized

git-subtree-dir: src/rocksdb2
git-subtree-split: 1fdd726a8254c13d0c66d8db8130ad17c13d7bcc
2014-10-27 11:36:32 -07:00
Vinnie Falco
2cce22052b Update SQLite to 3.8.7:
sha1: 3e23079f062fc06705eead4db108ee429878b532
2014-10-27 11:04:46 -07:00
Tom Ritchford
4e19d5f625 Adjust paths and costs in Pathfinder. 2014-10-27 11:03:19 -07:00
Tom Ritchford
5b667da526 Squelch some warnings in rippled and third-party code. 2014-10-27 10:00:03 -07:00
Nik Bougalis
f9fc9a3518 Reduce RippleD dependencies on Beast:
* Use static_assert where appropriate
* Use std::min and std::max where appropriate
* Simplify RippleD error reporting
* Remove use of beast::RandomAccessFile
2014-10-27 09:55:58 -07:00
Nik Bougalis
e005cfd70e Reduce Beast public interface and eliminate unused code:
Beast includes a lot of code for encapsulating cross-platform differences
which are not used or needed by rippled. Additionally, a lot of that code
implements functionality that is available from the standard library.

This moves away from custom implementations of features that the standard
library provides and reduces the number of platform-specific interfaces
andfeatures that Beast makes available.

Highlights include:
* Use std:: instead of beast implementations when possible
* Reduce the use of beast::String in public interfaces
* Remove Windows-specific COM and Registry code
* Reduce the public interface of beast::File
* Reduce the public interface of beast::SystemStats
* Remove unused sysctl/getsysinfo functions
* Remove beast::Logger
2014-10-27 09:55:43 -07:00
Vinnie Falco
feb997481c Refactor the structure of ServerHandler:
This is a cleanup to the structure of the sources.
* Rename to ServerHandler
* Move private implementation declaration to separate header
* De-inline function definitions in the class declaration.
2014-10-27 09:50:03 -07:00
Vinnie Falco
2c8e90c9d8 Remove obsolete RPCServerHandler:
This removes the legacy RPCServerHandler, which has been replaced by the
asynchronous RPC-HTTP/S server and corresponding RPCHTTPHandler.
2014-10-27 09:50:03 -07:00
Vinnie Falco
ec96d5afa0 Remove unused and obsolete classes and tidy up:
Many classes required to support type-erasure of handlers and boost::asio
types are now obsolete, so these classes and files are removed:
HTTPClientType, FixedInputBuffer, PeerRole, socket_wrapper,
client_session, basic_url, abstract_socket, buffer_sequence, memory_buffer,
enable_wait_for_async, shared_handler, wrap_handler, streambuf,
ContentBodyBuffer, SSLContext, completion-handler based handshake detectors.
These structural changes are made:
* Some missing includes added to headers
* asio module directory flattened
2014-10-26 08:40:52 -07:00
Vinnie Falco
8be8853c33 Remove obsolete classes, disable unused code, and tidy up:
* Removed MultiSocket. Code that previously used the MultiSocket now uses
  a combination of boost::asio coroutines and CRTP.
* Sitefiles headers rolled up and directory flattened.
* Disabled Sitefiles use of deprecated HTTPClient.
* Validators headers tidied up.
* Disabled Validators use of deprecated HTTPClient.
2014-10-26 08:38:37 -07:00
Vinnie Falco
c228f5a244 Set version to 0.26.4-rc3 2014-10-25 08:07:40 -07:00
Vinnie Falco
d4c8b4e3ac Merge branch 'release' into develop 2014-10-25 08:07:30 -07:00
Vinnie Falco
6564f6c164 Fix incorrect socket closure in Overlay peers:
On Application exit, Overlay was calling PeerImp::close for each peer.
The implementation of PeerImp::close only canceled all pending I/O and did not
call functions necessary for proper transition of Peer state during socket
closure. The correct transition is ensured by calling PeerImp::detach. This
changes PeerImp::close to call PeerImp::detach instead, ensuring that Overlay
invariants are maintained. Specifically, that reference counts for pending I/O
on peers will be correctly unwound by canceling operations and that the Peer
object will be destroyed, thus allowing the Overlay to stop correctly.
2014-10-25 08:01:57 -07:00
Vinnie Falco
1e37a5509c Add missing includes 2014-10-24 08:13:55 -07:00
Vinnie Falco
1e9503deaa Set version to 0.26.2-rc2 2014-10-23 13:49:22 -07:00
Vinnie Falco
ab1f36c565 Revert "Add [overlay] configuration section (experimental):"
This reverts commit 856fd9d69f.
2014-10-23 13:48:52 -07:00
Vinnie Falco
5a212cd626 Set version to 0.26.4-rc1 2014-10-23 13:01:12 -07:00
Vinnie Falco
856fd9d69f Add [overlay] configuration section (experimental):
This configuration section uses the new BasicConfig interface that supports
key-value pairs in the section. Some exposition is added to the example cfg
file. The new settings for overlay are related to the Hub and Spoke feature
which is currently in development. Production servers should not set
these configuration options, they are clearly marked experimental in the
example cfg file.

Conflicts:
	src/ripple/overlay/impl/OverlayImpl.cpp
	src/ripple/overlay/impl/OverlayImpl.h
	src/ripple/overlay/impl/PeerImp.cpp
	src/ripple/overlay/impl/PeerImp.h
2014-10-23 12:56:16 -07:00
Vinnie Falco
4606d99951 Don't use MultiSocket in Overlay:
The MultiSocket is obsolete technology which is superceded by a more
straightforward, template based implementation that is compatible with
boost::asio::coroutines. This removes support for the unused PROXY handshake
feature. After this change a large number of classes and source files may be
removed.
2014-10-23 12:56:16 -07:00
Tom Ritchford
dbd75169e5 New JsonWriter for improved client performance (RIPD-439):
When JSON-RPC and Websocket responses are calculated, the result is stored
in intermediate Json::Value objects and later composed in a single linear
memory buffer before being sent to the socket.  These classes support a
new model for building responses that supports incremental construction
of JSON replies in constant time and removes the requirement that all
data returned be located in continuguous memory.
* New JsonWriter incrementally writes JSON with O(1) granularity and memory.
* Array, Object are RAII wrappers for the O(1) JsonWriter.
2014-10-23 07:04:47 -07:00
Vinnie Falco
f5b39ee911 Remove HTTP::ScopedStream:
This class was used to allow stream style operator<< to write to the
HTTP::Session. This is being superceded by a more robust object-based model
that supports coroutines.
2014-10-22 19:36:28 -07:00
Vinnie Falco
db5d52b4b2 Keep a list of section config values that are not key/value pairs:
This change to BasicConfig stores all appended lines which are not key/value
pairs in a separate values vector which can be retrieved later. This is to
support sections containing both key/value pairs and a list of values.
2014-10-22 19:36:28 -07:00
Vinnie Falco
dfeb9967b8 Return error_code from beast::http::basic_parser:
This changes the HTTP parser interface to return an error_code instead
of a bool. This eliminates the need for the error() member function and
simplifies calling code.
2014-10-22 19:36:28 -07:00
Vinnie Falco
673e860c18 Add beast::asio::ssl_bundle workaround:
This works around the limitation that 1.56 boost::asio::ssl::stream objects
do not support r-value move or construction. It is required when the stream
does not own the socket.
2014-10-22 19:36:28 -07:00
Vinnie Falco
9deae34b20 Workaround for MSVC stdlib and coroutine interaction:
If beast::Time::currentTimeMillis is first called from a coroutine launched
using boost::asio::spawn, Win32 throws an exception. This workaround calls
getCurrentTime once in main to prevent the exception.
Reference:
    https://svn.boost.org/trac/boost/ticket/10657
2014-10-22 19:36:27 -07:00
Vinnie Falco
ec92344fb4 Use autotls instead of multitls in websocket:
The MultiSocket class implements a socket that handshakes in multiple
protocols including SSL and PROXY. Unfortunately the way it type-erases the
handlers and buffers is incompatible with boost::asio coroutines. To pave the
way for coroutines this is part of a larger set of changes that roll back the
usage of MultiSocket to older code, and some custom implementations that use
templates. The custom implementations are more simple since they use
coroutines. Removing MultiSocket will make many other classes and source files
unused, a big win for trimming down the codebase size.
2014-10-22 19:34:48 -07:00
Donovan Hide
44c68d6174 Change NodeStore::Backend tests to reflect observed patterns:
Empirical evidence shows a database access pattern with few hits
and many misses (objects that don't exist). This changes the timing
tests so they more accurately reflect rippled's actual usage:
* Add read missing keys test
* Increase numObjectsToTest to 1,000,000
* Alter PredictableObjectFactory to seed RNG once only
* Make NodeStoreTiming a manual test
2014-10-22 19:29:29 -07:00
Howard Hinnant
5b7f172d03 Fix OS X version parsing/error related to OS X 10.10 update. 2014-10-22 19:29:28 -07:00
JoelKatz
65125eac87 Add "deferred" flag to transaction relay message
If we receive a deferred transaction from a server in our
cluster, treat it as if it wasn't received from a server
in our cluster.

This currently has no effect but is needed for server to
interoperate with future code that will relay deferred
transactions.
2014-10-22 19:29:28 -07:00
Scott Schurr
761902864a Refactor STParsedJSON to parse an object or array [RIPD-480]
The implementation of multi-sign has a SigningAccounts array as a
member of the outermost object.  This array could not be parsed
by the previous implementation of STParsedJSON, which only knew
how to parse objects.  This refactor supports the required parsing.

The refactor divides the parsing into three separate functions:

 o parseNoRecurse() which parses most rippled data types.
 o parseObject() which parses object types that may contain
   arbitrary other types.
 o parseArray() which parses object types that may contain
   arbitrary other types.

The change is required by the multi-sign implementation, but is
independent.  So the parsing change is going in as a separate
commit.

The parsing is still far from perfect.  But this was as much as
needs doing to accomplish the ends and mitigate risk of breaking
the parser.
2014-10-22 19:29:28 -07:00
Vinnie Falco
af24d541d1 Workaround for MSVC move special members. 2014-10-18 08:16:12 -07:00
Donovan Hide
3ad68a617e Fix dependency on boost::thread on OS/X. 2014-10-16 21:44:36 -04:00
Nik Bougalis
9e1a6589d4 Return descriptive error message from memo validation (RIPD-591). 2014-10-16 21:44:36 -04:00
Josh Juran
da8ceed07e RippleSSLContext.cpp cleanup.
* These cleanups precede work on RIPD-108.
2014-10-16 21:44:36 -04:00
Nik Bougalis
35935adc98 Fix URL compositing in Beast (RIPD-636). 2014-10-16 21:44:36 -04:00
Howard Hinnant
5b4a501f68 Detab beast 2014-10-15 19:39:30 -04:00
Tom Ritchford
5425a90f16 Fix tabs and trailing whitespace. 2014-10-15 19:39:30 -04:00
Donovan Hide
7eaca149c1 Remove boost_thread dependency (RIPD-216).
Fixes RIPD-216
2014-10-15 19:37:25 -04:00
Mark Travis
4b5fd95657 Disable SSLv3 2014-10-15 19:37:25 -04:00
Nik Bougalis
96dedf553e Refactor SerializedTransaction:
* Use boost:tribool instead of two intertwined bool variables
* Trim down public interface, reduce member variables
2014-10-15 19:37:25 -04:00
sublimator
23219f2662 Disable transaction submission tests under Travis. 2014-10-15 19:37:25 -04:00
Vinnie Falco
af78ed608e Call Stoppable::stopped in PeerFinder onStop. 2014-10-15 19:37:25 -04:00
Vinnie Falco
51dc59e019 Fix outgoing bytes calculation in HTTP server. 2014-10-15 19:37:25 -04:00
Tom Ritchford
afc102e90a New class RPC::Status enforces JSON-RPC 2.0 error format.
* Relevant issues:
  * RIPD-92
  * RIPD-97
  * RIPD-98
  * RIPD-439
2014-10-15 19:37:25 -04:00
David Schwartz
fc560179e0 SHAMap performance improvements (RIPD-434)
This reworks the way SHAMaps are stored, flushed, backed, and
traversed. Rather than storing the linkages in the SHAMap itself,
that information is now stored in the nodes. This makes
snapshotting much cheaper and also allows traverse work done on
behalf of one SHAMap to be used by other SHAMaps that share inner
nodes with that SHAMap.

When a SHAMap is modified, nodes are modified all the way up to the
root. This means that the modified nodes in a SHAMap can easily be
traversed for flushing. So they don't need to be separately tracked.

Summary
* Remove mTNByID
* Remove mDirtyNodes
* Much faster traverses
* Much Faster snapshots
* New algorithm for flushing
* New vistNodes/visitLeaves
* Avoid I/O if a map is unbacked
2014-10-14 13:32:17 -04:00
sublimator
d26241de0e Remove Og from debug mode
Last time I used gdb, iterating over a directory's `Indexes`, each uint256 printed as `<optimized out>`.

Debug mode is for debugging ...
2014-10-14 12:57:41 -04:00
Howard Hinnant
00310f4f10 Silence clang warnings 2014-10-14 12:35:17 -04:00
Howard Hinnant
8caae219cf Gracefully cast from std:🧵:hardware_concurrency 2014-10-14 12:35:17 -04:00
Howard Hinnant
2264ae9247 Guarantee C locale
*  Remove all calls to setlocale to ensure that the global
   locale is always C.

*  Also replace beast::SystemStats::getNumCpus() with
   std:🧵:hardware_concurrency()
2014-10-14 12:35:17 -04:00
Nicholas Dudfield
29225bbe75 Attempt to fix spurious travis failures 2014-10-14 12:35:17 -04:00
Vinnie Falco
4b5625fd59 Load PeerFinder database in Stoppable::onPrepare:
OverlayImpl::onStart calls into PeerFinder before PeerFinder::Manager::onStart,
causing tests to sometimes fail and the application to intermittently not start.
The order of calls to Stoppable::onStart is implementation defined and not
predictable.

This changes PeerFinder to load the database in Stoppable::onPrepare, before
threads are launched. In general, creation and initialization of resources that
are shared between classes should happen in onPrepare rather than onStart,
to solve this problem.
2014-10-10 19:38:52 -07:00
Vinnie Falco
7c0c2419f7 Refactor PeerFinder:
Previously, the PeerFinder manager constructed with a Callback object
provided by the owner which was used to perform operations like connecting,
disconnecting, and sending messages. This made it difficult to change the
overlay code because a single call into the PeerFinder could cause both
OverlayImpl and PeerImp to be re-entered one or more times, sometimes while
holding a recursive mutex. This change eliminates the callback by changing
PeerFinder functions to return values indicating the action the caller should
take.

As a result of this change the PeerFinder no longer needs its own dedicated
thread. OverlayImpl is changed to call into PeerFinder on a timer to perform
periodic activities. Furthermore the Checker class used to perform connectivity
checks has been refactored. It no longer uses an abstract base class, in order
to not type-erase the handler passed to async_connect (ensuring compatibility
with coroutines). To allow unit tests that don't need a network, the Logic
class is now templated on the Checker type. Currently the Manager provides its
own io_service. However, this can easily be changed so that the io_service is
provided upon construction.

Summary
* Remove unused SiteFiles dependency injection
* Remove Callback and update signatures for public APIs
* Remove obsolete functions
* Move timer to overlay
* Steps toward a shared io_service
* Templated, simplified Checker
* Tidy up Checker declaration
2014-10-10 15:04:37 -07:00
Vinnie Falco
5f59282ba1 Clean up Overlay and PeerFinder sources:
* Tidy up identifiers and declarations
* Merge PeerFinder headers into one file
* Merge handout classes and functions into one file
2014-10-10 15:04:36 -07:00
Vinnie Falco
db03ce939c Add pending_handlers 2014-10-10 13:26:08 -07:00
Vinnie Falco
68bcbbb701 Add missing include in beast header 2014-10-10 13:26:08 -07:00
David Schwartz
8bdf7b3983 Remove unused file 2014-10-10 10:27:47 -07:00
Vinnie Falco
4ab427d315 Cleanup: Combine Section and BasicConfig, move to basics 2014-10-09 14:49:10 -07:00
Vinnie Falco
9a0a434dd8 Fix incorrect address in connectivity check report:
The remoteAddress is the address as seen on the socket, which for
incoming connections has a random port chosen by the remote implementation
that is different from the port number used to accept connections by the
remote listening socket. The checkedAddress is the remote address as seen
on the socket, combined with the port advertised in the TMEndpoints message.
This fixes the reporting and metadata associated with addresses tested
for connectivity.

The README has been updated to reflect that uptime is no longer part of
the metadata associated with IP addresses saved for bootstrapping.
2014-10-09 14:48:54 -07:00
Nik Bougalis
33d1dda954 Handle BIGNUM conversion failure 2014-10-06 11:24:42 -07:00
Howard Hinnant
8e9efb4ceb Remove unused transaction code. 2014-10-06 11:18:15 -07:00
Nik Bougalis
8835af11d5 Cleanups and surface reduction:
* Don't use friendship unless needed
* Trim down interfaces
* Make classes feel more like std containers
2014-10-06 11:18:15 -07:00
Nik Bougalis
cfb6b678f1 Remove HashMaps 2014-10-02 14:58:14 -07:00
miguelportilla
365500da98 Create orderbook integration test (RIPD-483) 2014-10-02 14:58:14 -07:00
Miguel Portilla
f14d75e798 Optimize account_lines and account_offers (RIPD-587)
Conflicts:
	src/ripple/app/ledger/Ledger.h
2014-10-02 14:58:14 -07:00
Tom Ritchford
0f71b4a378 Fix most compilation warnings for gcc, clang, release, debug. 2014-10-02 14:58:14 -07:00
JoelKatz
b651e0146d Fix some fee logic: (RIPD-614)
* fee_default sets cost in drops of reference transaction
* Offline signing uses fee_default
* Signing multiplier maximum works correctly
* Fix bugs in load fee track
* Remove dead code, add comments
2014-10-02 14:58:14 -07:00
Tom Ritchford
a0dbbb2d84 Update and sort ErrorCode descriptions 2014-10-02 14:57:31 -07:00
Torrie Fischer
a85fbf69e0 Update rocksdb 2014-10-02 14:57:31 -07:00
Torrie Fischer
92b8c7961b Squashed 'src/rocksdb2/' changes from 37c6740..25888ae
25888ae Merge pull request #329 from fyrz/master
89833e5 Fixed signed-unsigned comparison warning in db_test.cc
fcac705 Fixed compile warning on Mac caused by unused variables.
b3343fd resolution for java build problem introduced by 5ec53f3edf62bec1b690ce12fb21a6c52203f3c8
187b299 ForwardIterator: update prev_key_ only if prefix hasn't changed
5ec53f3 make compaction related options changeable
d122e7b Update INSTALL.md
986dad0 Merge pull request #324 from dalgaaf/wip-da-SCA-20140930
8ee75dc db/memtable.cc: remove unused variable merge_result
0fd8bbc db/db_impl.cc: reduce scope of prefix_initialized
676ff7b compaction_picker.cc: remove check for >=0 for unsigned
e55aea5 document_db.cc: fix assert
d517c83 in_table_factory.cc: use correct format specifier
b140375 ttl/ttl_test.cc: prefer prefix ++operator for non-primitive types
43c789c spatialdb/spatial_db.cc: use !empty() instead of 'size() > 0'
0de452e document_db.cc: pass const parameter by reference
4cc8643 util/ldb_cmd.cc: prefer prefix ++operator for non-primitive types
af8c2b2 util/signal_test.cc: suppress intentional null pointer deref
33580fa db/db_impl.cc: fix object handling, remove double lines
873f135 db_ttl_impl.h: pass func parameter by reference
8558457 ldb_cmd_execute_result.h: perform init in initialization list
063471b table/table_test.cc: pass func parameter by reference
93548ce table/cuckoo_table_reader.cc: pass func parameter by ref
b8b7117 db/version_set.cc: use !empty() instead of 'size() > 0'
8ce050b table/bloom_block.*: pass func parameter by reference
53910dd db_test.cc: pass parameter by reference
68ca534 corruption_test.cc: pass parameter by reference
7506198 cuckoo_table_db_test.cc: add flush after delete
1f96330 Print MB per second compaction throughput separately for reads and writes
ffe3d49 Add an instruction about SSE in INSTALL.md
ee1f3cc Package generation for Ubuntu and CentOS
f0f7955 Fixing comile errors on OS X
99fb613 remove 2 space linter
b2d64a4 Fix linters, second try
747523d Print per column family metrics in db_bench
56ebd40 Fix arc lint (should fix #238)
637f891 Merge pull request #321 from eonnen/master
827e31c Make test use a compatible type in the size checks.
fd5d80d CompactedDB: log using the correct info_log
2faf49d use GetContext to replace callback function pointer
983d2de Add AUTHORS file. Fix #203
abd70c5 Merge pull request #316 from fyrz/ReverseBytewiseComparator
2dc6f62 handle kDelete type in cuckoo builder
8b8011a Changed name of ReverseBytewiseComparator based on review comment
389edb6 universal compaction picker: use double for potential overflow
5340484 Built-in comparator(s) in RocksJava
d439451 delay initialization of cuckoo table iterator
94997ea reduce memory usage of cuckoo table builder
c627595 improve memory efficiency of cuckoo reader
581442d option to choose module when calculating CuckooTable hash
fbd2daf CompactedDBImpl::MultiGet() for better CuckooTable performance
3c68006 CompactedDBImpl
f7375f3 Fix double deletes
21ddcf6 Remove allow_thread_local
fb4a492 Merge pull request #311 from ankgup87/master
611e286 Merge branch 'master' of https://github.com/facebook/rocksdb
0103b44 Merge branch 'master' of ssh://github.com/ankgup87/rocksdb
1dfb7bb Add block based table config options
cdaf44f Enlarge log size cap when printing file summary
7cc1ed7 Merge pull request #309 from naveenatceg/staticbuild
ba6d660 Resolving merge conflict
51eeaf6 Addressing review comments
fd7d3fe Addressing review comments (adding a env variable to override temp directory)
cf7ace8 Addressing review comments
0a29ce5 re-enable BlockBasedTable::SetupForCompaction()
55af370 Remove TODO for checking index checksums
3d74f09 Fix compile
53b0039 Fix release compile
d0de413 WriteBatchWithIndex to allow different Comparators for different column families
57a32f1 change target_file_size_base to uint64_t
5e6aee4 dont create backup_input if compaction filter v2 is not used
49b5f94 Merge pull request #306 from Liuchang0812/fix_cast
787cb4d remove cast, replace %llu with % PRIu64
a7574d4 Update logging.cc
7e0dcb9 Update logging.cc
57fa3cc Merge pull request #304 from Liuchang0812/fix-check
cd44522 Merge pull request #305 from Liuchang0812/fix-logging
6a031b6 remove unused variable
4436f17 fixed #303: replace %ld with % PRId64
7a1bd05 Merge pull request #302 from ankgup87/master
423e52c Merge branch 'master' of https://github.com/facebook/rocksdb
bfeef94 Add rate limiter
32f2532 Print compression_size_percent as a signed int
976caca Skip AllocateTest if fallocate() is not supported in the file system
3b897cd Enable no-fbcode RocksDB build
f445947 RocksDB: Format uint64 using PRIu64 in db_impl.cc
e17bc65 Merge pull request #299 from ankgup87/master
b93797a Fix build
adae3ca [Java] Fix JNI link error caused by the removal of options.db_stats_log_interval
90b8c07 Fix unit tests errors
51af7c3 CuckooTable: add one option to allow identity function for the first hash function
0350435 Fixed a signed-unsigned comparison in spatial_db.cc -- issue #293
2fb1fea Fix syncronization issues
ff76895 Remove some unnecessary constructors
feadb9d fix cuckoo table builder test
3c232e1 Fix mac compile
54cada9 Run make format on PR #249
27b22f1 Merge pull request #249 from tdfischer/decompression-refactoring
fb6456b Replace naked calls to operator new and delete (Fixes #222)
5600c8f cuckoo table: return estimated size - 1
a062e1f SetOptions() for memtable related options
e4eca6a Options conversion function for convenience
a7c2094 Merge pull request #292 from saghmrossi/master
4d05234 Merge branch 'master' of github.com:saghmrossi/rocksdb
60a4aa1 Test use_mmap_reads
94e43a1 [Java] Fixed 32-bit overflowing issue when converting jlong to size_t
f9eaaa6 added include for inttypes.h to fix nonworking printf statements
f090575 Replaced "built on on earlier work" by "built on earlier work" in README.md
faad439 Fix #284
49aacd8 Fix make install
acb9348 [Java] Include WriteBatch into RocksDBSample.java, fix how DbBenchmark.java handles WriteBatch.
4a27a2f Don't sync manifest when disableDataSync = true
9b8480d Merge pull request #287 from yinqiwen/rate-limiter-crash-fix
28be16b fix rate limiter crash #286
04ce1b2 Fix #284
add22e3 standardize scripts to run RocksDB benchmarks
dee91c2 WriteThread
540a257 Fix WAL synced
24f034b Merge pull request #282 from Chilledheart/develop
49fe329 Fix build issue under macosx
ebb5c65 Add make install
0352a9f add_wrapped_bloom_test
9c0e66c Don't run background jobs (flush, compactions) when bg_error_ is set
a9639bd Fix valgrind test
d1f24dc Relax FlushSchedule test
3d9e6f7 Push model for flushing memtables
059e584 [unit test] CompactRange should fail if we don't have space
dd641b2 fix RocksDB java build
53404d9 add_qps_info_in cache bench
a52cecb Fix Mac compile
092f97e Fix comments and typos
6cc1286 Added a few statistics for BackupableDB
0a42295 Fix SimpleWriteTimeoutTest
06d9862 Always pass MergeContext as pointer, not reference
d343c3f Improve db recovery
6bb7e3e Merger test
88841bd Explicitly cast char to signed char in Hash()
5231146 MemTableOptions
1d284db Addressing review comments
55114e7 Some updates for SpatialDB
171d4ff remove TailingIterator reference in db_impl.h
9b0f7ff rename version_set options_ to db_options_ to avoid confusion
2d57828 Check stop level trigger-0 before slowdown level-0 trigger
659d2d5 move compaction_filter to immutable_options
048560a reduce references to cfd->options() in DBImpl
011241b DB::Flush() Do not wait for background threads when there is nothing in mem table
a2bb7c3 Push- instead of pull-model for managing Write stalls
0af157f Implement full filter for block based table.
9360cc6 Fix valgrind issue
02d5bff Merge pull request #277 from wankai/master
88a2f44 fix comments
7c16e39 Merge pull request #276 from wankai/master
8237738 replace hard-coded number with named variable
db8ca52 Merge pull request #273 from nbougalis/static-analysis
b7b031f Merge pull request #274 from wankai/master
4c2b1f0 Merge remote-tracking branch 'upstream/master'
a5d2863 typo improvement
9f8aa09 Don't leak data returned by opendir
d1cfb71 Remove unused member(s)
bfee319 sizeof(int*) where sizeof(int) was intended
d40c1f7 Add missing break statement
2e97c38 Avoid off-by-one error when using readlink
40ddc3d add cache bench
9f1c80b Drop column family from write thread
8de151b Add db_bench with lots of column families to regression tests
c9e419c rename options_ to db_options_ in DBImpl to avoid confusion
5cd0576 Fix compaction bug in Cuckoo Table Builder. Use kvs_.size() instead of num_entries in FileSize() method.
0fbb3fa fixed memory leak in unit test DBIteratorBoundTest
adcd253 fix asan check
4092b7a Merge pull request #272 from project-zerus/patch-1
bb6ae0f fix more compile warnings
6d31441 Merge pull request #271 from nbougalis/cleanups
0cd0ec4 Plug memory leak during index creation
4329d74 Fix swapped variable names to accurately reflect usage
45a5e3e Remove path with arena==nullptr from NewInternalIterator
5665e5e introduce ImmutableOptions
e0b99d4 created a new ReadOptions parameter 'iterate_upper_bound'
51ea889 Fix travis builds
a481626 Relax backupable rate limiting test
f7f973d Merge pull request #269 from huahang/patch-2
ef5b384 fix a few compile warnings
2fd3806 Merge pull request #263 from wankai/master
1785114 delete unused Comparator
1b1d961 update HISTORY.md
703c3ea comments about the BlockBasedTableOptions migration in Options
4b5ad88 Merge pull request #260 from wankai/master
19cc588 change to filter_block std::unique_ptr support RAII
9b976e3 Merge pull request #259 from wankai/master
5d25a46 Merge remote-tracking branch 'upstream/master'
9b58c73 call SanitizeDBOptionsByCFOptions() in the right place
a84234a Ignore missing column families
8ed70fc add assert to db Put in db_stress test
7f19bb9 Merge pull request #242 from tdfischer/perf-timer-destructors
8438a19 fix dropping column family bug
6614a48 Refactor PerfStepTimer to stop on destruct
076bd01 Fix compile
990df99 Fix ios compile
7dcadb1 Don't let flush preempt compaction in certain cases
dff2b1a typo improvement
985a31c Merge pull request #251 from nbougalis/master
f09329c Fix candidate file comparison when using path ids
7e9f28c limit max bytes that can be read/written per pread/write syscall
d20b8cf Improve Cuckoo Table Reader performance. Inlined hash function and number of buckets a power of two.
0f9c43e ForwardIterator: reset incomplete iterators on Seek()
722d80c reduce recordTick overhead in compaction loop
22a0a60 Merge pull request #250 from wankai/master
be25ee4 delete unused struct Options
0c26e76 Merge pull request #237 from tdfischer/tdfischer/faster-timeout-test
1d23b5c remove_internal_filter_policy
2a8faf7 Compact SpatialDB as we go, not at the end
7f71448 Implementing a cache friendly version of Cuckoo Hash
d977e55 Don't let other compactions run when manual compaction runs
d5bd6c7 Fix ios compile
6b46f78 Merge pull request #248 from wankai/master
528a11c Update block_builder.h
536e997 Remove assert in vector rep
4142a3e Adding a user comparator for comparing Uint64 slices.
1913ce2 more concurrent flushes in SpatialDB
808e809 Adjust SpatialDB column family options
0c39f54 Use Vector memtable when bulk loading SpatialDB
b6fd781 Don't do memtable lookup in db_impl_readonly if memtables are empty while opening db.
9dcb75b Add is-file-deletions-enabled property
1755581 improve OptimizeForPointLookup()
d9c0785 Fix assertion in PosixRandomAccessFile
bda6f33 fix valgrind error in c_test caused by BlockBasedTableOptions
0db6b02 Update timeout to 50ms instead of 3.
ff6ec0e Optimize SpatialDB
2386185 ReadOptions.total_order_seek to allow total order seek for block-based table when hash index is enabled
a98badf print table options
66f62e5 JNI changes corresponding to BlockBasedTableOptions migration
3844001 move block based table related options BlockBasedTableOptions
17b54ae Merge pull request #243 from andybons/patch-1
0508691 Add missing include to use std::unique_ptr
42ea795 Fix concurrency issue in CompactionPicker
bb530c0 Merge pull request #240 from ShaoYuZhang/master
f76eda7 Fix compilation issue on OSX
08be7f5 Implement Prepare method in CuckooTableReader
47b452c Fix the error of c_test.c
562b7a1 Add missing implementaiton of SanitizeDBOptions in simple_table_db_test.cc
63a2215 Improve Options sanitization and add MmapReadRequired() to TableFactory
e173bf9 Eliminate VersionSet memory leak
10720a5 Revert the unintended change that DestroyDB() doesn't clean up info logs.
01cbdd2 Optimize storage parameters for spatialDB
045575a Add CuckooHash table format to table_reader_bench
7c5173d test: db: fix test to have a smaller timeout for when it runs on faster hardware
6929b08 Remove BitStream* tests
50b790c Removing BitStream* functions
162b815 Adding Column Family support in db_bench.
28b5c76 WriteBatchWithIndex: a wrapper of WriteBatch, with a searchable index
5585e00 Update release note of 3.4
343e98a Reverting import change
ddb8039 RocksDB static build Make file changes to download and build the dependencies .Load the shared library when RocksDB is initialized
68eed8c Bump up version
36e759d Adding Cuckoo Table SST option to db_bench
a6fd14c Fix valgrind error in c_test
c703715 attempt to fix auto_roll_logger_test
c8ecfae Merge pull request #230 from cockroachdb/spencerkimball/send-user-keys-to-v2-filter
570ba5a Avoid retrying to read property block from a table when it does not exist.
625b9ef Merge pull request #234 from bbiao/master
59a2763 Fix typo huage => huge
f611935 Fix autovector iterator increment/decrement comments
58b0f9d Support purging logs from separate log directory
2da53b1 [Java] Add purgeOldBackups API
6c4c159 fix_sst_dump_for_old_sst_format
8dfe2fd fix compile error under Mac OS X
58c4946 Allow env_posix to lower background thread IO priority
6a2be31 fix_valgrind_error_caused_in_db_info_dummper
e91ebf1 print compaction_filter name in Options.Dump
5a5953b Add histogram for DB_SEEK
5e64240 log db path info before open
0c9dc9f Remove malloc from FormatFileNumber
bcefede Update HISTORY.md
4808177 Revert "Include candidate files under options.db_log_dir in FindObsoleteFiles()"
0138b8e Fixed compile errors (signed / unsigned comparison) in cuckoo_table_db_test on Mac
1562653 Fixed a signed-unsigned comparison error in db_test
218857b remove tailing_iter.h/cc
5d0074c set bytes_per_sync to 1MB if rate limiter is enabled
3fcf7b2 Pass parsed user key to prefix extractor in V2 compaction
2fa6434 Add scope guard
06a52bd Flush only one column family
9674c11 Integrating Cuckoo Hash SST Table format into RocksDB

git-subtree-dir: src/rocksdb2
git-subtree-split: 25888ae0068c9b8e3d9421ea8c78a7be339298d8
2014-10-02 10:47:26 -07:00
Torrie Fischer
225f8ac12f Merge commit '92b8c7961b433d12d9d77da5d61c26a920bbd370' into updated-rocksdb 2014-10-02 10:47:26 -07:00
Howard Hinnant
1161511207 Fix two Wunused-private-field warnings. 2014-10-01 08:47:56 -07:00
Nicholas Dudfield
ca8eda412e Make travis build and use debug variants for tests 2014-10-01 08:47:56 -07:00
Mark Travis
ec4ec48fb8 Add counters to track nodestore read and write activities. 2014-10-01 08:47:56 -07:00
Nik Bougalis
c0b69e8ef7 Remove the use of beast::String from rippled (RIPD-443) 2014-10-01 08:47:55 -07:00
Tom Ritchford
4241dbb600 Clean and harden Transaction.
* Replace boolean parameter with enumerated type.
* Get rid of std::ref.
* 80-column cleanups.
* Replace an std::bin with a lambda.
2014-10-01 08:47:55 -07:00
Tom Ritchford
f54280aaad New DatabaseReader reads ledger numbers from database. 2014-10-01 08:47:55 -07:00
Tom Ritchford
6069400538 Fix compiler warnings under gcc. 2014-10-01 08:47:55 -07:00
Howard Hinnant
616be1d76c Miscellaneous cleanups:
* Limit HashPrefix construction and disallow assignment

* Give KnownFormats deleted copy members so that derived
  classes will give the right answers if queried with the
  std::is_copy_constructible/assignable traits.

* Replace SharedSingleton with a local static in
  LedgerFormats::getInstance() to be consistent with
  similar code in other places.  This also allows the
  LedgerFormats default constructor to be marked private
  so that the compiler enforces the design that
  LedgerFormats is a singleton type.

* Change return types of LedgerFormats::getInstance() and
  TxFormats::getInstance() from pointer to non-const to
  reference to const so as follow more established design
  guidelines for singletons.  This prevents pointers being
  mistaken for heap-allocated objects, and the const
  ensures the singleton isn't mutable.

* Change RippleAddress to inherit privately from
  CBase58Data instead of publicly.  This lets the compiler
  enforce that there are no unintended conversions from
  RippleAddress to CBase58Data.  This change allows us
  to remove a comment warning about unwanted conversions.
2014-10-01 08:47:54 -07:00
Nik Bougalis
8e91ce67c5 Allow beast::lexicalCast to parse 'true' & 'false' into a bool 2014-10-01 08:47:54 -07:00
JoelKatz
c1ecd661c3 Fix broken assert in built/validated ledger mismatch handler 2014-10-01 08:47:54 -07:00
JoelKatz
b27e2aad07 Improve transaction security
* Check signatures of every transaction on every validator
* Remove obsolete code
* Check transaction status in submit/sign RPC handler
2014-10-01 08:47:54 -07:00
MarkusTeufelberger
5ce508e09d Change output range names of ledger_cleaner
The input parameters are called "min_ledger" and "max_ledger", they are also called "minRange" and "maxRange" in the code BUT "ledger_min" and ledger_max" if printed. This is inconsistent and should be changed, as it might lead to confusion on how to call this module via RPC.
2014-10-01 08:47:53 -07:00
Nik Bougalis
3cfa5a41b1 Improve BuildInfo interface:
* Remove unnecessary beast::String dependency
* Explicitly cast to result type while packing a version
* Add unit tests for version formatting
2014-10-01 08:47:53 -07:00
Vinnie Falco
6c072f37ef Remove unused testoverlay module 2014-10-01 08:47:53 -07:00
Nik Bougalis
dbd993ed2b Use namespaces instead of static-only classes 2014-10-01 08:47:52 -07:00
Nik Bougalis
45b5c4ba7a Use deleted members to prevent copying in Beast (RIPD-268) 2014-10-01 08:47:52 -07:00
Nik Bougalis
7933e5d1f9 Use deleted members to prevent copying in rippled (RIPD-268) 2014-10-01 06:28:32 -07:00
Vinnie Falco
01e52e6f9f Use trusted validators median fee
Conflicts:
	src/ripple/app/misc/Validations.cpp
2014-10-01 06:28:32 -07:00
Vinnie Falco
40a955e192 Consume handshake data in HTTP/S server 2014-10-01 06:28:12 -07:00
Vinnie Falco
a8296f7301 Set version to 0.26.3-sp4 2014-09-30 18:04:59 -07:00
Vinnie Falco
590c3b876b Use trusted validators median fee 2014-09-30 18:03:53 -07:00
Vinnie Falco
6dfc805eaa Rewrite HTTP/S server to use coroutines:
* Fix bug with more than one complete request in a read buffer
* Use stackful coroutines for simplified control flow
* Door refactored to detect handshakes
* Remove dependency on MultiSocket
* Remove dependency on handshake detect logic framework
2014-09-30 13:29:32 -07:00
Vinnie Falco
5ce6068df5 Remove obsolete SharedArg 2014-09-29 07:18:51 -07:00
Nik Bougalis
bf9b8f4d1b Use secure RPC connections when configured 2014-09-28 04:39:49 -07:00
Vinnie Falco
d618581060 Config improvements:
* More fine-grained Section mutators
* Add remap for mapping legacy single sections to key value pairs
* Add output stream operators for BasicConfig and Section
* Allow section values to be overwritten from command line
* Update rpc key/value configs from command line
* Add RPC::Setup with defaults and remap legacy rpc sections
2014-09-28 04:39:49 -07:00
David Schwartz
2936bbfae8 Make path filtering smarter (RIPD-561)
* Break path liquidity checking into its own function
* Measure initial quality over minimum destination amount
* Test for available liquidity
2014-09-24 11:54:12 -07:00
Nik Bougalis
47b08bfc02 Add --quorum command line argument (RIPD-563) 2014-09-24 11:19:39 -07:00
Nik Bougalis
da4f77ca1f Return correct error message for invalid fields 2014-09-24 11:19:38 -07:00
David Schwartz
1c0a75d467 Distinguish Byzantine failure from tx bug (RIPD-523) 2014-09-24 11:19:38 -07:00
Nik Bougalis
659cf0c221 Decouple LedgerMaster from configuration 2014-09-24 11:19:38 -07:00
Howard Hinnant
430229fd84 Mark several Ledger member functions as const. 2014-09-24 11:19:37 -07:00
Howard Hinnant
81699a0971 Add +DEBUG to the raw version string for DEBUG builds.
This will show up in the rpc server_info command.
There is no impact on the version string for release builds.
2014-09-24 11:19:37 -07:00
MarkusTeufelberger
c54aff74b3 Build gcc.debug using -Og flag
Since gcc 4.8 is required anyways, it might be nice to use its features.

Intro to feature (second bullet point):
https://gcc.gnu.org/gcc-4.8/changes.html

-g (line 328) is still needed:
http://stackoverflow.com/questions/12970596/gcc-4-8-does-og-imply-g
2014-09-24 11:19:37 -07:00
Mark Travis
7f43ab9097 Improvements to SConstruct:
* Default target is release instead of debug (scons with no arguments).
* All targets now include debug symbols, including release.
Rationale: "out of the box" builds of rippled using plain "scons" or "scons -j4" will produce
a debug instead of a release build, which could underperform.
2014-09-24 11:19:36 -07:00
Miguel Portilla
d78f740250 Add account_offers paging (RIPD-344) 2014-09-19 16:38:10 -07:00
Miguel Portilla
cd1bd18a49 Add account_lines paging (RIPD-343) 2014-09-19 16:18:50 -07:00
sublimator
f81b084448 Set page sizes for ledger_data correctly (RIPD-249) 2014-09-19 16:16:49 -07:00
Vinnie Falco
02d9c77402 Set version to 0.26.3-sp2 2014-09-19 11:57:22 -07:00
Howard Hinnant
a0c903c68c Add needed #include <istream>
This is needed for the combination of boost 1.56 and libc++
2014-09-19 10:29:14 -07:00
JoelKatz
6aa325d3da On missing node in consensus, bow out (RIPD-567) 2014-09-18 15:12:45 -07:00
JoelKatz
041f874d4c Improve transaction security
* Check signatures of every transaction on every validator
* Remove obsolete code
* Check transaction status in submit/sign RPC handler
2014-09-18 14:25:09 -07:00
Nik Bougalis
526ecd6a81 Detect invalid inputs during STAmount conversion (RIPD-570):
* More robust validation of input
* XRP may not be specified using fractions
* Prevent creating native amounts larger than max possible value
* Add unit tests to verify correct parsing
2014-09-18 12:46:21 -07:00
Nik Bougalis
d373054fc4 Templetize and improve beast string-to-integer conversions:
* Properly handle numbers at the edge of precision
* Improve and expand unit test coverage
2014-09-18 12:46:16 -07:00
Vinnie Falco
b6d9f1d4b2 Add fee voting configuration and docs (RIPD-564) 2014-09-17 12:22:51 -07:00
Vinnie Falco
3fef916972 Move some constants to core/SystemParameters.h 2014-09-17 12:22:49 -07:00
Vinnie Falco
89a51e5b91 Split Section to its own header and add convenience accessors 2014-09-17 12:22:49 -07:00
miguelportilla
f87a6ccc7a Fix missing includes for boost 1.56.0 2014-09-16 15:22:00 -07:00
Nik Bougalis
f65cea66ef Remove unused macros, config variables, and file 2014-09-16 14:15:13 -07:00
Vinnie Falco
4239880acb Clean up and restructure sources 2014-09-16 14:15:12 -07:00
Vinnie Falco
1dcd06a1c1 Add missing includes and tidy up 2014-09-16 14:03:50 -07:00
Vinnie Falco
0f30191d10 Refactor STAmount:
* Remove unused functions
* Remove unused constructor
* Use delegating constructors
* Mark some observers deprecated
* Clean up declaration parameter names
* Add checked and unchecked constructors
* De-inline unnecessary inlined functions
* Reorder and regroup members into sections
* Move globals from the unity file to the .cpp
* Change some member functions to be free functions
* Put implementation in one .cpp and the test in another .cpp

Remove unused STAmount constructor and delegate two others No change in functionality.
2014-09-16 07:39:50 -07:00
Vinnie Falco
8fb9d5daaa Set version to 0.26.4-alpha 2014-09-15 18:20:47 -07:00
Nik Bougalis
ed3c942ff1 Inject JobQueue in NetworkOPs 2014-09-15 16:05:01 -07:00
Nik Bougalis
80436d4a8b Cleanups:
* Remove obsolete string formatting function
* Remove unused ADDRESS macro
* Re-scope functions
2014-09-15 16:04:48 -07:00
Howard Hinnant
cfc702c766 Fix beast::http::headers move members 2014-09-15 16:03:36 -07:00
Vinnie Falco
88ae15ea8e Add base64 conversions and tests 2014-09-15 14:52:42 -07:00
Vinnie Falco
6bafca7386 Use transform_iterator in http::headers 2014-09-15 14:52:42 -07:00
Vinnie Falco
379e842080 Add BasicConfig simplified config interface 2014-09-15 12:46:04 -07:00
Vinnie Falco
c41ce469d0 Cleanup:
* Move QUALITY_ONE to Quality.h
* Move functional files up one level
* Remove core.h
* Merge routines into Config.cpp
* Rename Section to IniFileSections
* Rename IniFileSections routines
2014-09-15 12:21:36 -07:00
Vinnie Falco
a1ca68473d Merge branch 'release' into develop 2014-09-14 15:39:09 -07:00
Nik Bougalis
3345d03433 Avoid conversions whenever possible during RippleState lookups 2014-09-13 11:06:38 -07:00
Nik Bougalis
81a426608a Make log partitions case-insensitive 2014-09-13 11:06:19 -07:00
Vinnie Falco
2ad6f0a65e Set version to 0.26.3-sp1 2014-09-12 15:22:54 -07:00
Vinnie Falco
ee8bd8ddae Fix handling of HTTP/S keep-alives (RIPD-556):
* Proper shutdown for ssl and non-ssl connections
* Report session id in history
* Report histogram of requests per session
* Change print name to 'http'
* Split logging into "HTTP" and "HTTP-RPC" partitions
* More logging and refinement of logging severities
* Log the request count when a session is destroyed

Conflicts:
	src/ripple/http/impl/Peer.cpp
	src/ripple/http/impl/Peer.h
	src/ripple/http/impl/ServerImpl.cpp
	src/ripple/module/app/main/Application.cpp
	src/ripple/module/app/main/RPCHTTPServer.cpp
2014-09-12 15:19:17 -07:00
Vinnie Falco
319ac14e7d Add is_short_read() 2014-09-12 15:19:04 -07:00
Vinnie Falco
0215a7400d Fix handling of HTTP/S keep-alives (RIPD-556):
* Proper shutdown for ssl and non-ssl connections
* Report session id in history
* Report histogram of requests per session
* Change print name to 'http'
* Split logging into "HTTP" and "HTTP-RPC" partitions
* More logging and refinement of logging severities
* Log the request count when a session is destroyed
2014-09-12 14:20:30 -07:00
Vinnie Falco
79db0ca7a6 Add is_short_read() 2014-09-12 14:10:33 -07:00
JoelKatz
1a7eafb699 Add ledger cleaner documentation (RIPD-555) 2014-09-09 22:33:42 -07:00
Nik Bougalis
81a06ea6cd Cleanups:
* Remove obsolete config variables
* Reduce coupling
* Use C++11 ownership containers
* Use auto when it makes sense
* Detect edge-case in unit tests
* Reduce the number of LedgerEntrySet public members
2014-09-09 22:33:42 -07:00
Nik Bougalis
de4be649ab Refactor string-to-integer conversions 2014-09-09 21:38:09 -07:00
sublimator
d90ec5f06c Normalize sort paths in Visual Studio project generator 2014-09-08 11:17:40 -07:00
Vinnie Falco
32065ced6e Add peer count to HTTP server properties 2014-09-08 11:17:39 -07:00
Scott Schurr
b5224a2227 Improve regularity of STObject and STArray (RIPD-448, RIPD-544):
* reduce duplicated code using templates
* replace BOOST_FOREACH with C++11 for loops
* remove most direct calls to new
* limit line length to 80 characters
* clearly identify virtual and overridden methods
* split STObject and STArray into their own files
* name files after the class they contain
2014-09-05 13:02:07 -07:00
Nik Bougalis
c55777738f Refactor LedgerEntrySet:
* Split adjustOwnerCount to increment and decrement paths.
* Move pathfinding-specific functions out of LedgerEntrySet
* Convert members to free functions
2014-09-05 11:50:17 -07:00
JoelKatz
c72dff5a24 Make more RocksDB tunables
Add support for universal compaction
2014-09-05 11:50:17 -07:00
JoelKatz
6b09e49c08 Increase the size of the tree cache:
This change will not significantly increase memory consumption
because most entries are pinned anyway.
2014-09-05 11:48:00 -07:00
Nik Bougalis
413218c4c4 Create the directory for the debug_logfile (RIPD-551) 2014-09-04 16:51:31 -07:00
Miguel Portilla
16c04b50ee Add date to tx command (RIPD-542) 2014-09-04 16:51:31 -07:00
Nik Bougalis
56c18f7768 Cleanups and fixes (RIPD-532):
* Properly handle sfWalletLocator field
* Plug a tiny memory leak
* Avoid naked pointers
* Remove unused variables
* Other small cleanups
2014-09-04 16:51:31 -07:00
Tom Ritchford
22ca13bc78 Cleanups to RPC code 2014-09-04 16:51:31 -07:00
Nicholas Dudfield
4c7fd18230 Ticket integration tests 2014-09-04 16:51:31 -07:00
Nik Bougalis
39730fc13e Ticket issuing (RIPD-368):
* New CreateTicket transactor to create tickets
* New CancelTicket transactor to cancel tickets
* Ledger entries for tickets & associated functions
* First draft of M-of-N documentation
2014-09-04 16:11:44 -07:00
Nik Bougalis
889c0a0d0f Transactor refactor:
* Allocate transactors on the stack instead of the heap.
* Remove header files and reduce transactor public interface.
2014-09-04 16:11:44 -07:00
Nik Bougalis
624a803955 Handle whitespace separating an 'ip port' correctly (RIPD-552) 2014-09-04 12:26:27 -07:00
Vinnie Falco
9f5c21f80e Set version to 0.26.3 2014-09-03 16:15:07 -07:00
Nik Bougalis
a3fe089367 Fix missing return value error check 2014-09-02 08:45:19 -07:00
Nik Bougalis
85d5cd3118 Fix missing return value error check 2014-09-01 21:11:31 -07:00
Vinnie Falco
61006e626d Also report mismatched built ledger 2014-08-28 18:03:50 -07:00
Nik Bougalis
15aad1cb24 Optimize pathfinding operations (RIPD-537):
* Calculate and cache Account hashes without holding locks.
* Fast hash-based path element comparison.
* Use emplace instead of find/insert
2014-08-28 15:57:29 -07:00
Tom Ritchford
95c1c5f54e Stream generated JSON. 2014-08-28 12:38:21 -07:00
Vinnie Falco
c65fb91878 Fix special members for http classes 2014-08-28 12:38:03 -07:00
Vinnie Falco
d5a7e1331e Set version to 0.26.3-rc3 2014-08-27 15:58:41 -07:00
Vinnie Falco
04bcd93ba3 HTTP(S)-RPC server improvements (RIPD-489, RIPD-533):
* Correct handling of Keep-Alive in socket handlers
* Report session history in print command
2014-08-27 18:06:30 -04:00
Vinnie Falco
f97ef7039a HTTP message and parser improvements:
* streambuf wrapper supports rvalue move
* message class holds a complete HTTP message
* body class holds the HTTP content body
* headers class holds RFC-compliant HTTP headers
* basic_parser provides class interface to joyent's http-parser
* parser class parses into a message object
* Remove unused http get client free function
* unit test for parsing malformed messages
2014-08-27 18:06:30 -04:00
Tom Ritchford
9160b46c1e Bug fixes and new features for LedgerTool:
* Fix RIPD-509, RIPD-514, RIPD-519, RIPD-525, RIPD-527, RIPD-529,
  RIPD-530 and RIPD-531.
* Protect people from ledger-spew and remove cruft.
* Better error messages and handling.
* Cache command lists or clears ledger cache.
* Better ledger summaries.
* Offline mode.
2014-08-27 18:05:44 -04:00
Edward Hennis
aa4b116498 Wrap RippleCalc into a single function (RIPD-500):
* Change public members of Input and Output to remove trailing _.
* Remove Input constructor and separate flags in RippleCalc to reduce
  duplication and confusion.
* Make calculation result private; add getter.
* Narrow scope of some of the results of calls to rippleCalculate.
2014-08-27 18:05:30 -04:00
Edward Hennis
612bb71165 Add enable_if_lvalue 2014-08-27 17:10:24 -04:00
Torrie Fischer
5c67f99ef9 Remove old rocksdb/ 2014-08-27 12:37:13 -07:00
Torrie Fischer
101a4808a0 Update includes and scons 2014-08-27 12:37:05 -07:00
Torrie Fischer
1d38671f5e Squashed 'src/rocksdb2/' content from commit 37c6740
git-subtree-dir: src/rocksdb2
git-subtree-split: 37c6740c383bb9a6ee2747b04f08bc77fcfa10c5
2014-08-27 12:36:50 -07:00
Torrie Fischer
7f25d88f02 Merge commit '1d38671f5edc2322bc58417816674cc629ae7a70' as 'src/rocksdb2' 2014-08-27 12:36:50 -07:00
Vinnie Falco
be830d3dad Set version to 0.26.3-rc2 2014-08-26 10:00:03 -07:00
Nik Bougalis
5bc949d70f Fix a unit test warning 2014-08-26 10:00:03 -07:00
Vinnie Falco
43817bd722 Merge remote-tracking branch 'upstream/release' into tmp 2014-08-26 09:46:29 -07:00
JoelKatz
61623d6d75 Improve parallelization of getRippleLines 2014-08-26 09:28:10 -07:00
David Schwartz
9aad60f56d Make sure we update mTNByID when we replace the root 2014-08-26 09:28:09 -07:00
Vinnie Falco
e7cf3e8084 Add ledger.history.mismatch insight statistic 2014-08-26 09:28:07 -07:00
Tom Ritchford
e024e7c2ec Compile git tags now include name and branch. (RIPD-493) 2014-08-22 18:10:17 -04:00
Edward Hennis
6fc136ae9a Update npm tests & config to pass in Windows. (RIPD-209)
* Extend timeout for WebSocket test.
* Windows networking doesn't like connecting to 0.0.0.0. Use 127.0.0.1
* Additional command line options in config. Can potentially be used to run rippled in a debugger.
2014-08-22 18:10:17 -04:00
Edward Hennis
2b69ded1ea Convert rvalue to an lvalue. (RIPD-494)
* The rvalue gets destructed as soon as "rc" is constructed.
2014-08-22 18:10:17 -04:00
Tom Ritchford
8dd799aa6f New command line LedgerTool. (RIPD-243)
* Retrieve and process summary or full ledgers.
* Search using arbitrary criteria (any Python function).
* Search using arbitrary formats (any Python function).
* Caches ledgers as .gz files to avoid repeated server requests.
* Handles ledger numbers, ranges, and special names like validated or closed.
2014-08-22 18:10:11 -04:00
Vinnie Falco
7230ef41ee Fix warnings and compile errors 2014-08-20 17:44:00 -07:00
Edward Hennis
a86f0a743c Clean up some docs
* Consistent line endings in rippled-example.cfg
* Rewrite CodingStyle.md. Get down to top priorities
2014-08-20 16:20:15 -07:00
Josh Juran
af75b55ef7 src/README.md: s/addded/added/ 2014-08-20 16:19:28 -07:00
Vinnie Falco
9ecb37dd4f Add validators aged container test 2014-08-20 16:09:52 -07:00
Vinnie Falco
2e3784a914 Tidy up sources 2014-08-20 16:09:51 -07:00
Scott Schurr
019c1af435 Use aged containers in Validators module (RIPD-349) 2014-08-20 16:09:51 -07:00
Vinnie Falco
5322955f2b Fix exception safety in aged containers 2014-08-20 16:09:50 -07:00
Howard Hinnant
a8ea4ce283 Fix move constructor of aged_unordered_container (RIPD-490) 2014-08-20 16:08:59 -07:00
Mark Travis
c12862f60d Enable heap profiling with jemalloc:
The jemalloc library (which must be downloaded and installed separately)
is required to perform heap profiling. Instructions on how to enable heap
profiling with rippled are available in doc/HeapProfiling.md
2014-08-13 20:36:38 -07:00
Tom Ritchford
e889183fc5 JSON cleanups:
* Fix Json headers to include what they use.
* Get rid of ripple/json/api directory.
2014-08-13 20:36:36 -07:00
Jeff Trull
7be695c6bd Handle changes to boost::optional in newly released boost 1.56:
To improve compatibility with the proposed std::optional a number
of changes were made, one of which is the removal of the implicit
conversion to bool.  As a result, returning boost::optional as a
bool value now fails.  Explicit conversion to bool used for clarity.
2014-08-13 19:00:17 -07:00
Nik Bougalis
956901ae02 Properly handle edge-cases when parsing JSON integers (RIPD-470):
* Properly handle both unsigned and signed integers
* Return parsing error for overlong JSON numbers
* Implement unit test checking the edge cases that are of interest
2014-08-13 18:46:32 -07:00
Nik Bougalis
d562c5b2d5 Account for high-ascii (RIPD-464) 2014-08-13 18:46:32 -07:00
Nik Bougalis
d7b054c3f6 When compiling debug builds with GCC use _FORTIFY_SOURCE=2:
This gcc/glibc feature adds some (supposedly) lightweight checks which can
help detect errors such as buffer overflows.
2014-08-13 18:33:30 -07:00
Tom Ritchford
901ccad0cf Clarify unfunded offer deletion strategy. 2014-08-13 18:33:03 -07:00
Vinnie Falco
b9454e0f0c Set version to 0.26.2 2014-08-12 12:19:13 -07:00
Vinnie Falco
26181907fc Merge branch 'release-next' into release
Conflicts:
	src/ripple/module/app/paths/cursor/ForwardLiquidity.cpp
	src/ripple/overlay/tests/peer_info.test.cpp
	src/ripple/unity/http.h
2014-08-12 12:19:04 -07:00
Miguel Portilla
8368798ad2 Add owner_funds to subscription streams (RIPD-377) 2014-08-12 11:56:07 -07:00
Miguel Portilla
ed597e5e99 Add owner_funds to subscription streams (RIPD-377) 2014-08-12 11:54:49 -07:00
Miguel Portilla
2c88c15f7f Fix unhandled exception in async HTTP server (RIPD-475) 2014-08-12 11:54:02 -07:00
Miguel Portilla
af7cd3cc04 Fix unhandled exception in async HTTP server (RIPD-475) 2014-08-12 11:46:45 -07:00
Howard Hinnant
9552551f9a Refactor SField (RIPD-431)
* Restrict access to SField constructors.
* Make all SField access const.
* Hide and simplify databases used to hold SField constants.
* Separate the two concerns of representing a field,
  and maintaining a database of fields.
2014-08-08 19:16:51 -07:00
Edward Hennis
1c73a0f649 Remove unused code:
* StringConcat was only being referenced by unit test.
* `runall.sh` is no longer needed. Use `npm test` instead.
2014-08-08 19:16:42 -07:00
Tom Ritchford
e3698b2a07 Fix Pathfinder::getPathsOut to use Issue 2014-08-08 19:16:34 -07:00
Tom Ritchford
c841f8b360 Add the git tag to the compile (RIPD-238) 2014-08-08 19:16:33 -07:00
wltsmrz
50f9b68d61 Bump ledger_wait timeout for Travis 2014-08-08 14:57:39 -07:00
Nik Bougalis
27b48bc16e Refactor beast::SemanticVersion (RIPD-199) 2014-08-08 14:57:39 -07:00
Edward Hennis
bccdbaed2b Update Doxyfile (RIPD-175):
* Clean up the include path to reflect updated code structure.
* Update PROJECT_BRIEF to more accurate title.
* Fix location of logo graphic.
* Hide all undocumented classes.
2014-08-08 14:57:39 -07:00
Nik Bougalis
398095a667 Cleanups and performance optimizations (RIPD-450):
* Remove AccountItems and AccountItem
* Restructure RippleLineCache to not require shared_ptr
* Avoid expensive copies of base_uint<160> in RippleState
2014-08-08 14:57:39 -07:00
Nik Bougalis
80095824b9 Remove obsolete nickname support 2014-08-08 14:57:39 -07:00
Nik Bougalis
d91c1f96cc Detect node store batch write failures (RIPD-270):
* Raise open file limit from the soft max to the hard max.
2014-08-08 14:57:39 -07:00
Howard Hinnant
1c005a0292 Fix macro setting for rocksdb unity file 2014-08-08 14:50:15 -07:00
miguelportilla
c7ced496ac Update rocksdb unity file (RIPD-352) 2014-08-08 15:42:41 -04:00
Vinnie Falco
d4ff18834c Merge commit 'f86d9fd626df1cee55bce4c577d06bb064dc827b' as 'src/rocksdb' 2014-08-08 11:57:41 -07:00
Vinnie Falco
f86d9fd626 Squashed 'src/rocksdb/' content from commit 224932d
git-subtree-dir: src/rocksdb
git-subtree-split: 224932d4d0
2014-08-08 11:57:41 -07:00
Vinnie Falco
854604f724 Remove rocksdb in preparation for subtree add 2014-08-08 11:57:29 -07:00
Vinnie Falco
cfd3642cb1 Set version to 0.26.2-alpha-4 2014-08-07 17:13:55 -07:00
Tom Ritchford
f493590604 Logic fix for multiquality issues. 2014-08-07 17:10:38 -07:00
Vinnie Falco
8c084a3de8 Set version to 0.26.2-alpha-3 2014-08-07 10:13:22 -07:00
Tom Ritchford
985aa803a4 Fix error with multi-quality paths. 2014-08-07 10:12:09 -07:00
Vinnie Falco
9e319d7bd6 Set version to 0.26.2-alpha-2 2014-08-06 10:16:13 -07:00
David Schwartz
a122e176d7 Pathfinding fixes:
* Don't consider global freeze if not enforcing
 * Log if a covering path fails to cover
2014-08-06 10:16:12 -07:00
Tom Ritchford
88a6f2931e Fix local variable unfundedOffers that was shadowing a class variable. 2014-08-06 09:26:22 -07:00
Vinnie Falco
54f3a83e25 Fix missing return values in headers_t 2014-08-05 16:43:13 -07:00
Vinnie Falco
0955c0d8d3 Set version to 0.26.2-alpha-1 2014-08-05 15:40:34 -07:00
JoelKatz
6bb5be5216 Avoid a mutex 99+% of the time in SField::getField 2014-08-05 15:36:12 -07:00
JoelKatz
c9cd7e4be0 Rewrite STObject::setType for improved performance 2014-08-05 15:36:05 -07:00
Miguel Portilla
ce2cecf046 Add owner_funds to client subscription data (RIPD-377)
Conflicts:
	src/ripple/module/app/ledger/AcceptedLedger.cpp
2014-08-05 15:04:50 -07:00
Vinnie Falco
6e934ee6a1 HTTP handshake in peer protocol (RIPD-351):
* New I/O paths for client and server role
* New handshake_analyzer detects the peer protocol
* New basic_message class for parsing and storing HTTP messages
* Conditional compilation for selective feature enabling.
* Server supports both current handshake and HTTP handshake
2014-08-05 13:17:02 -07:00
Vinnie Falco
723d7d1263 HTTP support improvements:
* RFC2616 compliance
* Case insensitive equality, inequality operators for strings
* Improvements to http::parser
* Tidy up HTTP method enumeration
2014-08-05 13:17:01 -07:00
Scott Schurr
298572893e Improvements to aged_containers (RIPD-363)
- Added unit tests for element erase
- Added unit tests for range erase
- Added unit tests for touch
- Added unit tests for iterators and reverse_iterators
- Un-inlined operator== for unordered containers
- Fixed minor problems with ordered_container erase()
- Made ordered_container...
  - erase (reverse_iterator pos) not compile
  - erase (reverse_iterator first, reverse_iterator last) not compile
  - touch (reverse iterator pos) not compile
- Verified that ordered container...
  - insert() already rejects reverse_iterator
  - emplace_hint() already rejects reverse_iterator
- Made set/multiset iterators const

Regarding the set/multiset iterators, see section 1.5 of
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2913.pdf
as pointed out by Vinnie.
2014-08-04 15:25:30 -07:00
Mark Travis
405f6f7368 Make NetworkOPs::isFull() thread-safe 2014-08-04 11:19:07 -07:00
Tom Ritchford
648ccc7c17 Replace const Type& with Type const& for common types.
* std::string
* RippleAccount
* Account
* Currency
* uint256
* STAmount
* Json::Value
2014-08-04 11:18:44 -07:00
Mark Travis
f5afe0587f Fix filter_policy object leak in NodeStore backends 2014-08-04 11:16:44 -07:00
Tom Ritchford
91a227a475 Correct Pathfinder::getPaths out to handle order books (RIPD-427) 2014-08-02 10:38:57 -07:00
Tom Ritchford
4b905fe9ff Clean OrderBookDB::getBooksBy methods. 2014-08-02 10:38:57 -07:00
Howard Hinnant
0f409b7bec ASCII clean 2014-08-02 10:38:56 -07:00
Vinnie Falco
295c8de858 Detect inconsistency in PeerFinder self-connects (RIPD-411) 2014-07-31 16:10:54 -07:00
Nik Bougalis
e5252f90af Remove LedgerBase and decongest Ledger locks 2014-07-31 16:05:08 -07:00
Miguel Portilla
c2276155bf Add pubkey_node and hostid to server stream messages (RIPD-407) 2014-07-31 16:05:08 -07:00
Miguel Portilla
dbe49bcd87 Remove TRUST_NETWORK directive (RIPD-331) 2014-07-31 16:04:59 -07:00
David Schwartz
7b936de32c Freeze enforcing: (RIPD-399)
* Set enforce date: September 15, 2014
 * Enforce in stand alone mode
 * Enforce at source
 * Enforce intermediary nodes
 * Enforce global freeze in get paths out
 * Enforce global freeze in create offer
 * Don't consider frozen links a path out
 * Handle in getBookPage
 * Enforce in new offer transactors
2014-07-30 23:28:48 -07:00
evhub
9eb34f542c More fixes to VSProject sorting algorithm 2014-07-30 08:56:54 -07:00
Tom Ritchford
194304e544 Refactor RippleCalc:
* Rationalize method and filenames, move to subdirectory.
* Use Issue in Node.
* Restrict access to PathState variables.
* Line length and readability cleanups.
* New PathCursor stores path calculation data during rippleCalc.
* Extract methods PathCursor::node(), PathCursor::previousNode()
  and RippleCalc::addPath
2014-07-30 08:29:29 -07:00
Howard Hinnant
c59fc332d5 Make CBase58Data/RippleAddress movable (RIPD-428):
This significantly increases the performance in returning
these types from factory functions.
2014-07-30 07:25:24 -07:00
Nik Bougalis
b43832fe57 Use std::atomic 2014-07-29 21:50:58 -04:00
Howard Hinnant
c24a497a23 Further documentation improvements to Ledger Consensus. 2014-07-29 21:41:19 -04:00
Tom Ritchford
4096fcd1bf Reduce scope of RPC locks and general cleanup (RIPD-458) 2014-07-29 16:24:44 -04:00
Vinnie Falco
9a0e806f78 Set version to 0.26.1 2014-07-28 12:05:01 -07:00
Vinnie Falco
20c9632996 Enable asynchronous handling of HTTP-RPC (RIPD-390)
* Activate async code path
* Tidy up HTTP server code
* Use shared_ptr in HTTP server
* Remove check for unspecified IP
* Remove hairtrigger
* Fix missing HTTP authorization check
* Fix multisocket flags in RPC-HTTP server
* Fix authorization failure when no credentials required
* Addresses RIPD-159, RIPD-161, RIPD-390
2014-07-28 12:05:01 -07:00
Vinnie Falco
65a628ca88 Add HTTPHeaders::build_map 2014-07-28 12:05:00 -07:00
Vinnie Falco
d82dbba096 Make bind_handler variadic ctor explicit 2014-07-28 12:05:00 -07:00
Howard Hinnant
58547f6997 Tidy up hardened containers (RIPD-380):
* Rename hardened containers for clarity
* Fixes https://ripplelabs.atlassian.net/browse/RIPD-380
2014-07-28 09:06:35 -07:00
Howard Hinnant
e6f4eedb1e Tidy up hardened_hash:
* Added siphash as a HashAlgorithm
* Refactored class responsibilities
2014-07-28 09:06:22 -07:00
Vinnie Falco
c5b963141f Fix intrinsic calls in static_initializer 2014-07-28 09:04:41 -07:00
Nik Bougalis
5df40bd746 Fix auth handling during OfferCreate (RIPD-414) 2014-07-28 08:57:22 -07:00
Howard Hinnant
403f15dc48 Documentation for Ledger Consensus implementation (RIPD-405) 2014-07-28 08:56:23 -07:00
Nik Bougalis
704d7451a0 Fix auth handling during OfferCreate (RIPD-414) 2014-07-25 11:42:42 -07:00
Vinnie Falco
fa11071443 Enable asynchronous handling of HTTP-RPC (RIPD-390)
* Activate async code path
* Tidy up HTTP server code
* Use shared_ptr in HTTP server
* Remove check for unspecified IP
* Remove hairtrigger
* Fix missing HTTP authorization check
* Fix multisocket flags in RPC-HTTP server
* Fix authorization failure when no credentials required
* Addresses RIPD-159, RIPD-161, RIPD-390
2014-07-24 20:22:55 -07:00
Vinnie Falco
87351c8a0c Add HTTPHeaders::build_map 2014-07-24 20:18:51 -07:00
Vinnie Falco
2f5fb1e68e Make bind_handler variadic ctor explicit 2014-07-24 20:18:51 -07:00
Tom Ritchford
96e1ec6d31 Fix build warnings and .gitignore.
* Comment out unused local function for both clang and g++.
* Get rid of numerous Boost warnings for clang.
* Remove some unused local variables.
* Put TAGS into the .gitignore.
2014-07-24 20:18:51 -07:00
Nik Bougalis
ac3cf05f1a Properly order warning suppression flags during compile 2014-07-24 20:18:51 -07:00
Tom Ritchford
6335e34395 Simplify locking and move a typedef.
* Make DatabaseCon's lock private and expose a scoped lock_guard.
* Get rid of DeprecatedRecursiveMutex and DeprecatedScopedLock entirely.
* Move CancelCallback to Job where it logically belongs.
2014-07-23 19:38:52 -07:00
Scott Schurr
02c2029ac1 Add more documentation of ledger acquisition (RIPD-373)
Capturing information from a seminar on the topic into the source tree.
2014-07-23 19:29:13 -07:00
David Schwartz
6914aa3e27 Check for payment increments that make no progress. (RIPD-374) 2014-07-23 19:27:55 -07:00
David Schwartz
f4fcb1cc9a Remove some dead SHAMapMissingNode code 2014-07-23 19:27:50 -07:00
David Schwartz
b6eec21ec0 Pathfinder cleanups, more efficient 'd' handling (RIPD-156) 2014-07-23 19:27:46 -07:00
David Schwartz
0ce3aeb189 Stop finding paths when enough are found (RIPD-156) 2014-07-23 19:27:42 -07:00
Nicholas Dudfield
713c8efcbe Fix intermittently failing send test 2014-07-23 02:27:19 -07:00
Vinnie Falco
9fa5e39872 Set version to 0.26.0 2014-07-22 09:59:45 -07:00
Vinnie Falco
ace53fa405 Set version to 0.26.0-rc2 2014-07-21 10:39:48 -07:00
Vinnie Falco
3c06980107 Merge branch 'release' into develop 2014-07-21 10:25:23 -07:00
Vinnie Falco
1f26fbb5af Set version to 0.26.0-rc1 2014-07-21 10:00:16 -07:00
Howard Hinnant
84c6622122 Fix bugs, typo in SHAMapNodeID 2014-07-18 17:45:51 -07:00
Miguel Portilla
63f099f2f6 Fix book_offers limit parameter (RIPD-295)
Conflicts:
	src/ripple/module/app/misc/NetworkOPs.cpp
2014-07-18 10:37:45 -07:00
Nicholas Dudfield
373ce72984 Update freeze tests
* Conditionally skip freeze enforcement tests
* Honour remote.fee_cushion setting
* Workaround ripple-lib regression
* Don't use mocha features from wrong version
2014-07-18 10:35:06 -07:00
JoelKatz
4cf29455e4 Freeze flags: (RIPD-394)
* Define all flags
 * Set/clear bits in transactors
 * Frozen line counts towards reserve, is non-default
 * Report trust line state
2014-07-18 10:35:06 -07:00
David Schwartz
07db5d497c Remove SHAMapNodeID from SHAMapTreeNode (RIPD-347)
This resolves the "right data, wrong ID" issue in the
tree node cache.
2014-07-18 10:35:06 -07:00
JoelKatz
f1bb0afc4e Improve transaction fee and execution logic (RIPD-323):
* tecINSUFF_FEE if balance doesn't cover fee
* Ensure transaction recovery is deterministic
* Reduce transaction retries
2014-07-18 10:35:06 -07:00
Vinnie Falco
d791fe3013 Fix msvc static initialization in SHAMapNodeID 2014-07-17 20:05:39 -07:00
Miguel Portilla
c16e22a5c6 Fix book_offers limit parameter (RIPD-295) 2014-07-17 18:01:20 -07:00
Miguel Portilla
db7a720445 Fix static initializers in RippleSSLContext (RIPD-375) 2014-07-17 18:01:19 -07:00
Miguel Portilla
6c09a02099 Workaround gcc bug with static_initializer default ctor 2014-07-17 18:00:43 -07:00
Howard Hinnant
1b3356cafd Remove calls to SHAMapNode::getID (RIPD-347):
Calls in SHAMap::getCache and SHAMap::canonicalize are
purposefully left in place at this time (to be removed
later).
2014-07-17 15:58:03 -07:00
Scott Schurr
5869902f2c Tidy up Resource::Manager (RIPD-362):
* Style improvements
* More documentation
2014-07-17 14:18:18 -07:00
Howard Hinnant
28898031f0 Eliminate spurious SHAMap::getFetchPack failure (RIPD-379) 2014-07-17 10:38:07 -07:00
Vinnie Falco
1ce0f94638 Define OPENSSL_NO_SSL2 2014-07-17 10:18:37 -07:00
Vinnie Falco
f876ad973f Fix static_initializer: …
* Prevents double construction, invalid access
* Unit test works on MSVC and non MSVC
2014-07-16 16:43:17 -07:00
Tom Ritchford
6014b13234 Use Books in Ledger. 2014-07-15 21:16:42 -07:00
Vinnie Falco
3e9c702c47 Support stream composition of testcase names 2014-07-15 18:23:01 -07:00
Vinnie Falco
3ff919ccf1 Fix version to say 'rippled' 2014-07-15 13:03:40 -07:00
evhub
8dc0844c79 Fix VSProject item sorting (again)
Conflicts:
	src/beast/site_scons/site_tools/VSProject.py
2014-07-15 12:51:57 -07:00
David Schwartz
a2764b68ca Rate-limit SSL client renegotiation (RIPD-360) 2014-07-14 10:42:29 -07:00
Tom Ritchford
bbbae072ea Simplify initialization of Pathfinder using C++11 constructs. 2014-07-14 10:04:27 -07:00
evhub
b4735b5931 Fix VSProject item sorting:
* Use object type in the sort key
* Call _key recursively over containers
* Prevent passing of iterators to xsorted
* Fix VSProject generator with new sorting
2014-07-14 10:04:07 -07:00
Tom Ritchford
418638ad16 Serialization code improvements:
* Add generics to eliminate duplicate code in STHash
* Use generics in Serializer and callers
2014-07-11 12:00:49 -07:00
Scott Schurr
9fb09d3109 Pass and use time_point in DecayingSample ctor (RIPD-359)
Switches a number of places in Resource::Logic to use abstract_clock::now()
which returns a time_point.  Unfortunately Resource::Logic tracks time
locally also, but with ints, not time_point.  So Resource::Logic uses a
delicate mix of abstract_clock::now() and abstract_clock::elapsed() with
this commit.  That inconsistency could be addressed in a second commit.
2014-07-11 12:00:39 -07:00
Tom Ritchford
d7e08f96a5 Various tidying:
* Fix unused variable warnings.
* Clean unused items from TER.
* Improvement to LES use of shared_ptr.
2014-07-10 15:11:33 -07:00
JoelKatz
4d49d272eb Fix account_tx resume (RIPD-314) 2014-07-10 15:11:33 -07:00
JoelKatz
faa6890950 Find 'sabfd' paths (RIPD-335)
This permits USD/GW1 to be bridged to USD/GW2 by BTC/GW3 or
USD/GW1 to be bridged to BTC/GW2 by CNY/GW3.
2014-07-10 15:11:33 -07:00
David Schwartz
9c390f6da4 Impose a local limit on path lengths (RIPD-350) 2014-07-10 15:09:06 -07:00
Scott Schurr
6842277977 Add documentation for ledger entries (RIPD-361) 2014-07-10 15:08:07 -07:00
Mark Travis
ddf68d464d Set version to 0.25.2 2014-07-07 12:41:46 -07:00
JoelKatz
b2f19e8dc6 Find 'sabfd' paths
This permits USD/GW1 to be bridged to USD/GW2 by BTC/GW3 or
USD/GW1 to be bridged to BTC/GW2 by CNY/GW3. See RIPD-335.
2014-07-07 12:41:46 -07:00
David Schwartz
5714b42975 Impose a local limit on path lengths 2014-07-07 11:42:24 -07:00
David Schwartz
c4e9c49c10 Set version to 0.25.2-rc2 2014-07-07 11:33:26 -07:00
Mark Travis
9210efb051 In JSON, output unprintable currency codes as hex 2014-07-07 11:33:26 -07:00
Tom Ritchford
b9f1b05625 Use swapWith to save CPU; edit comment. 2014-07-07 11:33:26 -07:00
sublimator
828c2e3c71 Restore checkpointed ledger under all paths in PathFind. 2014-07-07 11:33:12 -07:00
Nik Bougalis
10150a7352 Patch Boost to suppress warnings on clang 2014-07-06 15:17:58 -07:00
Scott Schurr
baaa45f8c7 SHAMap Documentation 2014-07-06 14:57:59 -07:00
Tom Ritchford
322af30d6a Pathfinding Documentation 2014-07-06 14:57:59 -07:00
Tom Ritchford
206efbf30d Rename RippleAsset to Issue and RippleBook to Book:
* Split STAmount out of SerializedTypes.h
* New concept of "Issue consistency": when either both or neither of its
  currency and account are XRP.
* Stop checking for consistency of Issue in its constructor.
* Clarification of mIsNative logic in STAmount.
* Usual cleanups.
2014-07-06 14:57:59 -07:00
Tom Ritchford
a96dee85d2 Remove recursions from computeLiquidity 2014-07-06 14:57:58 -07:00
Vinnie Falco
d307568cbc Update rocksdb unity file 2014-07-03 17:49:17 -07:00
Vinnie Falco
0ee27b143c Merge commit '7bfb4a9ba5a2822f7d9ef7122b1388aea4be9404' as 'src/rocksdb' 2014-07-03 17:49:00 -07:00
Vinnie Falco
7bfb4a9ba5 Squashed 'src/rocksdb/' content from commit 78b8a7d
git-subtree-dir: src/rocksdb
git-subtree-split: 78b8a7d908
2014-07-03 17:49:00 -07:00
Vinnie Falco
110c73fc8d Remove rockdb subtree 2014-07-03 17:43:48 -07:00
Vinnie Falco
424d9b8385 Add preliminary Structured Overlay docs 2014-07-03 14:34:38 -07:00
Vinnie Falco
1b48ccc868 Fix base log partition severity 2014-07-03 11:57:14 -07:00
Howard Hinnant
fac82204b6 Remove boost::hash_value() overloads.
This addresses https://ripplelabs.atlassian.net/browse/RIPD-102
2014-07-02 15:33:11 -07:00
David Schwartz
61f114e655 Cleanup confusion of ledger base versus ledger header
The "ledger header" is the chunk of data that hashes to the
ledger's hash. It contains the sequence number, parent hash,
hash of the previous ledger, hash of the root node of the
state tree, and so on.

The term "ledger base" refers to a particular type of query
and response used in the ledger fetch process that includes
the ledger header but may also contain other information
such as the root node of the state tree.
2014-07-02 15:33:10 -07:00
MarkusTeufelberger
24410bf1bb Update Sconstruct 2014-07-01 19:12:47 -07:00
Vinnie Falco
aa24969eee Add README.md for ledger process 2014-07-01 12:42:41 -07:00
David Schwartz
a5297d13c4 Add new memo restrictions 2014-07-01 12:13:47 -07:00
David Schwartz
b06bdb83cb Fix a case where we put an extra node in the SHAMapDiff 2014-07-01 12:13:13 -07:00
David Schwartz
d06092212f Tighten up some serialization checks 2014-06-30 16:53:38 -07:00
David Schwartz
914778eae1 In JSON, output unprintable currency codes as hex 2014-06-30 16:40:53 -07:00
Nicholas Dudfield
e14c700c60 New integration tests:
* New tests for autobridging and freeze
* Discrepancy detection tests
* Don't let Mocha suppress load time errors
2014-06-28 18:27:33 -07:00
wltsmrz
0848e348bb Update ripple-lib integration tests 2014-06-28 13:17:31 -07:00
Vinnie Falco
3d5ae42660 Structured Overlay support:
* Add Peer Protocol detector
* Add RIPPLE_SINGLE_IO_SERVICE_THREAD setting
* Preliminary HTTP header parsing logic (disabled)
2014-06-26 18:24:50 -07:00
Vinnie Falco
f207b6b4c9 Improvements to HTTP parsing 2014-06-26 17:41:12 -07:00
David Schwartz
ed2c5078ad Tighten up some serialization checks 2014-06-26 17:16:34 -07:00
sublimator
aec792f5b8 Restore checkpointed ledger under all paths in PathFind. 2014-06-26 17:16:34 -07:00
Nik Bougalis
17d64de3d5 During playback close ledger before accepting 2014-06-26 17:16:34 -07:00
Tom Ritchford
f6bea08535 Update state during pathfinding 2014-06-26 17:16:33 -07:00
Tom Ritchford
feab6c39b3 New types Account, Currency, Directory:
* New tagged uint types.
* Extract to_string functions from header to hide dependencies.
* Include what you use and C++11 for cleanups.
2014-06-26 17:16:30 -07:00
Nik Bougalis
e999c76882 Autobridging:
* Remove legacy OfferCreate transactor
* Misc. cleanups on LedgerEntrySet
* Fix a subtle bug with arithmetic operations on Quality
* Sanity check offers after taking
2014-06-26 12:03:52 -07:00
Miguel Portilla
686cc599a2 Add ASIO strand to StatsDCollector 2014-06-26 12:03:51 -07:00
Vinnie Falco
92983556a0 Fix bug in VSProject when no LIBPATH in env 2014-06-26 12:03:51 -07:00
Scott Schurr
837872c3f3 Move static treeNodeCache from SHAMap to the Application
These changes address two JIRA issues:

 - 291 unittest reported leaked objects
 - 292 SHAMap::treeNodeCache should be a dependency injection

The treeNodeCache was a static member of SHAMap.  It's now a
non-static member of the Application accessed through
getTreeNodeCache().  That addressed JIRA 291

The SHAMap constructors were adjusted so the treeNodeCache is
passed in to the constructor.  That addresses JIRA 292,  It required
that any code constructing a SHAMap needed to be edited to pass
the new parameter to the constructed SHAMap.

In the mean time, SHAMap was examined for dead/unused code and
interfaces that could be made private.  Dead and unused interfaces
were removed and methods that could be private were made private.
2014-06-26 11:10:51 -07:00
Tom Ritchford
55222dc5d1 New types Account, Currency, Directory:
* New tagged uint types.
* Extract to_string functions from header to hide dependencies.
* Include what you use and C++11 for cleanups.
2014-06-24 11:11:25 -07:00
David Schwartz
adce6ae851 Ledger loading cleanups:
* Fix close time settings for ledger load
* More info in ledger_request and inbound ledger JSON replies
2014-06-23 20:19:53 -07:00
Howard Hinnant
9dc32cb791 SHAMap refactoring:
* Rename SHAMapNode to SHAMapNodeID.
* Cleanups
2014-06-23 20:19:53 -07:00
Howard Hinnant
23dc08c925 Improve Journal logging framework:
* Allow partition log levels to be adjusted
* Cleanups
2014-06-23 20:19:53 -07:00
Vinnie Falco
488a44b88e Fix case-sensitivity for NOLOGO in booltable 2014-06-18 17:04:31 -07:00
evhub
530bdf975e Fix VSProject generation issues with SConstruct:
* Always describe the Visual Studio targets
* Prevent checking nonexistant enviro vars
* Prevent pkg-config protobuf env vars if not clang/gcc
* Don't use any pkg-config enviro vars unless clang/gcc
* Make all VSProject/config directories windows-style
* Prevent beastobjc.mm from showing up in vcxproj
* Remove duplicate \src\protobuf\src
* Consistent quoting
2014-06-18 16:41:34 -07:00
evhub
d7a6627a1f Fixes to VSProject generator:
* Canonical sorting for all platforms
* Fix incorrect path separator
* Filter predefined duplicate environment switches
2014-06-18 16:38:26 -07:00
Vinnie Falco
d6066183b9 Refactor Overlay for Structured Network support:
* Move overlay up one directory
* Add abstract_protocol_handler, message_stream
* Add peer_protocol_detector
* Tidy up some declarations
* Use strand::running_in_this_thread instead of bool
* Update README.md
* Replace protocol message read loop:
  - Process data in arbitrary size chunks
  - message_stream extracts individual messages
  - peer_protocol_detector identifies the handshake
  - abstract_protocol_handler used for dispatching messages
* Remove unused protocol message types:
  - mtACCOUNT
  - mtCONTACT
  - mtERROR
  - mtGET_ACCOUNT
  - mtGET_CONTACTS
  - mtGET_VALIDATIONS
  - mtSEARCH_TRANSACTION
  - mtUNUSED_FIELD

Conflicts:
	src/ripple/module/app/main/Application.cpp
	src/ripple/module/app/misc/NetworkOPs.cpp
	src/ripple/module/app/peers/PeerSet.cpp
2014-06-18 15:17:18 -07:00
Vinnie Falco
3e2c3ba035 Add missing beast includes 2014-06-18 14:07:18 -07:00
Tom Ritchford
e24cba8c35 Better types and more comments in RippleCalc.
* Better automatic conversions to and from tagged uint160 varints.
* Start using tagged variants of uint160 for Currency, Account.
* Comments from 2014/6/11 RippleCalc session.
2014-06-18 12:38:06 -07:00
Tom Ritchford
a23013abc1 Tidy up rpc module:
* Move directory up to ripple/module/rpc
* Use C++11 idioms and best practices
2014-06-18 12:37:53 -07:00
evhub
27a4f44de5 Process switches with regex in VSProject generator:
* Handles "DisableSpecificWarnings" switches
2014-06-16 19:01:28 -07:00
Vinnie Falco
4e07dbbefc Fix state check in PeerImp::recvHello 2014-06-16 18:14:25 -07:00
David Schwartz
dcf4ad2c21 Ledger load and ledger replay fixes:
* Stash the loaded ledger where consensus can find it.
 * When loading a ledger for startup, try the backend too
 * Apply replay transactions to a mutable snapshot
2014-06-16 17:29:11 -07:00
Nik Bougalis
04dd861fe3 Cleanup:
* Remove is_bit_set and use regular bitwise operations instead.
* Remove the function-like macro "nothing".
2014-06-16 17:29:11 -07:00
Vinnie Falco
c8ee6c6f6d Use std::thread instead of boost::thread 2014-06-16 16:18:10 -07:00
Vinnie Falco
a57e4263d7 Fix MSVC workaround in basic_seconds_clock 2014-06-16 16:18:09 -07:00
Vinnie Falco
3d58f0d941 Add static_initializer 2014-06-16 16:18:09 -07:00
Vinnie Falco
a52c9232c4 Tidy up basics module:
* Move directory up
* Remove unity includes and "include what you use"
2014-06-15 18:51:05 -07:00
Vinnie Falco
7a059c7a73 Remove ScopedPointer, ContainerDeletePolicy 2014-06-15 18:35:12 -07:00
Vinnie Falco
506910147f Tidy up includes:
* Replace boost with std equivalents:
  - bind, ref, cref, function, placeholders
* More "include what you use"
* Remove unnecessary includes
2014-06-15 18:26:50 -07:00
Vinnie Falco
cf3eb24eb0 Move nodestore to its own module 2014-06-15 12:50:44 -07:00
Vinnie Falco
d965b23b2a Add missing beast includes 2014-06-15 12:37:52 -07:00
Vinnie Falco
f660743065 Remove unused SHAMap::getItem 2014-06-13 14:00:17 -07:00
David Schwartz
4559bd9030 Improve the way we declare a close time consensus 2014-06-12 10:20:48 -07:00
David Schwartz
3ac98fb101 SyncUnorderedMap cleanup 2014-06-12 10:14:47 -07:00
David Schwartz
aff52db289 Re-use the serializer 2014-06-12 10:14:47 -07:00
David Schwartz
ea27dfe08d Find 'sbfd' paths. 2014-06-12 09:41:52 -07:00
Tom Ritchford
27620af1bf Further cleanups of RippleCalc.
* Rename many variables.
* Make most of PathState private.
* Extract out common Node::isAccount() code.
* Rename bConsumed to allLiquidityConsumed_.
* Extract out code into PathState::clear().
2014-06-09 12:57:26 -07:00
Tom Ritchford
bf116308d4 Add newer validators to validators-example.txt 2014-06-09 12:41:27 -07:00
Tom Ritchford
3fb27d98ab Clean up LookupLedger and resolve issue 278.
* Use beast::zero to resolve issue 278.
* Rename variables and simplify logic.
* Restrict to 80 columns.
2014-06-09 12:40:38 -07:00
Tom Ritchford
7e45c17730 Rename ledger_get to ledger_request. 2014-06-09 12:37:24 -07:00
Tom Ritchford
626533d4a7 Clean up RPC messages from Main 2014-06-09 12:37:23 -07:00
Tom Ritchford
39719f4c17 Rearrange branch in accordance with new practices. 2014-06-09 12:37:23 -07:00
JoelKatz
526bd88dc4 Add ledger_get RPC command to fetch a ledger from the network
Conflicts:
	Builds/VisualStudio2013/RippleD.vcxproj
	Builds/VisualStudio2013/RippleD.vcxproj.filters
	Builds/VisualStudio2013/RippleD2.vcxproj
	Builds/VisualStudio2013/RippleD2.vcxproj.filters
	src/ripple_rpc/impl/Handlers.cpp
2014-06-09 12:37:22 -07:00
Vinnie Falco
37201ecaa6 Include BeastConfig.h from the root include path 2014-06-09 12:35:16 -07:00
Vinnie Falco
02ed879837 Update VS project file 2014-06-06 07:39:55 -07:00
Vinnie Falco
8b881d3a77 Add CBase58Data::hash_append 2014-06-05 20:00:24 -07:00
Miguel Portilla
f25456ce25 Fix VSProject.py extra dot 2014-06-05 17:47:46 -07:00
mDuo13
dfb1db4ab3 Return correct error for missing pathfinding request. Fixes RIPD-293 2014-06-05 17:47:28 -07:00
Vinnie Falco
4362cb660b Replace boost::shared_ptr with std::shared_ptr 2014-06-05 13:04:23 -07:00
Vinnie Falco
1aa0749ba8 Update rocksdb unity build 2014-06-04 17:20:43 -07:00
Vinnie Falco
c7f1f6a91f RocksDB changes to support unity build:
* Remove extra definition of TotalFileSize
* Remove extra definition of ClipToRange
* Move EncodedFileMetaData out from anonymous namespace
* Move version_set Saver to its own namespace
* Move some symbols into a named namespace
* Move symbols out of anonymous namespace (prevents warning)
* Make BloomHash inline
2014-06-04 17:15:28 -07:00
Vinnie Falco
888a3fec21 Merge commit '8514b88974c71c0fa85bb154507536ee49c33458' as 'src/rocksdb' 2014-06-04 16:10:38 -07:00
Vinnie Falco
8514b88974 Squashed 'src/rocksdb/' content from commit 457bae6
git-subtree-dir: src/rocksdb
git-subtree-split: 457bae6911
2014-06-04 16:10:38 -07:00
Vinnie Falco
724ec46129 Use per-file include directories for external code subtrees:
* leveldb, hyperleveldb, rocksdb, snappy
* SConstruct OSX fix regarding OpenSSL version check
2014-06-04 13:28:43 -07:00
Vinnie Falco
4f1d1d2a8a Reorganize source file hierarchy:
* Rename unity files
* Move some modules to new subdirectories
* Remove obsolete Visual Studio project files
* Remove obsolete coding style and TODO list
2014-06-03 21:43:59 -07:00
Tom Ritchford
39a387b54c Check for openSSL version in SConstruct.
* Uses the platform specific openssl binary to detect the current version.
2014-06-02 10:56:21 -07:00
Roberto Catini
2b0034667d Add Dockerfile:
* The ports are not automatically exposed.
* No test is performed after the build.
2014-06-02 10:27:09 -07:00
Tom Ritchford
98202c56ae base_uint now compares and assigns with beast::Zero.
Conflicts:
	src/ripple/types/api/base_uint.h
	src/ripple_basics/ripple_basics.h
2014-06-02 10:15:45 -07:00
Vinnie Falco
1e06ddf13c Refactor MultiSocket:
* Variadic constructor argument list
* Tidy up sources and filenames
2014-06-02 10:07:05 -07:00
Vinnie Falco
560071bb68 Make all include paths relative to a root directory:
* Better include path support in the VSProject scons tool.
* Various manual fixes to include paths.
2014-06-02 09:16:28 -07:00
Nik Bougalis
2e49ec47a3 Revert "Ste version to 0.25.2-rc1"
This reverts commit 3f10924594.
2014-06-01 16:32:41 -07:00
Mark Travis
e70d618aff Set version to 0.25.2-rc1 2014-06-01 22:51:13 +00:00
Mark Travis
3e4cf426bd Detect paths with illegal bridging offers 2014-06-01 22:45:55 +00:00
Mark Travis
3f10924594 Ste version to 0.25.2-rc1 2014-06-01 22:35:12 +00:00
Mark Travis
f8182c335a Detect paths with illegal bridging offers 2014-06-01 01:26:11 +00:00
Vinnie Falco
1d8d6a6d68 Revert "Improve checking of library versions."
This reverts commit 69fccdf5c6.
2014-05-28 19:04:37 -07:00
Tom Ritchford
69fccdf5c6 Improve checking of library versions.
* Correctly handle openSSL version checking on Ubuntu, Debian, OS/X.
* Also check versions of openSSL, Boost, GCC and MSVC at C++ compile time.
* Get rid of over-engineered runtime CheckLibraryVersions.
2014-05-28 17:07:35 -07:00
Nik Bougalis
27e8d44a56 Autobridging:
Complete implementation of bridged offers crossings. While processing an offer
A:B we consider both the A:B order book and the combined A:XRP and XRP:B books
and pick the better offers. The net result is better liquidity and potentially
better rates.

* Rearchitect core::Taker to perform direct and bridged crossings.
* Compute bridged qualities.
* Implement a new Bridged OfferCreate transactor.
* Factor out common code from the Bridged and Direct OfferCreate transactors.
* Perform flow calculations without losing accuracy.
* Rename all transactors.
* Cleanups.
2014-05-28 16:35:03 -07:00
Vinnie Falco
72bc4ebf37 Fix VSProject generator item sort 2014-05-28 16:35:02 -07:00
Tom Ritchford
353f32e6af Fix a few warnings 2014-05-28 09:28:50 -07:00
Howard Hinnant
9bbaa9a2ae Report whether a ledger is validated:
This addresses https://ripplelabs.atlassian.net/browse/RIPD-275
Use Json::StaticString to improve performance.
Use inject_error instead of manually adding errors.
2014-05-28 09:27:22 -07:00
Nicholas Dudfield
096fcefae9 Fix clang/travis, prefer static libs when BOOST_ROOT is set. 2014-05-28 08:32:11 -07:00
Vinnie Falco
0f1e292e34 New http::client_session for making requests:
- Add 10,000 popular URL data set for unit tests
2014-05-28 08:31:45 -07:00
Vinnie Falco
195957a7cc Add ci_char_traits 2014-05-28 07:30:02 -07:00
Vinnie Falco
eb122f45f9 Tidy up includes 2014-05-28 07:29:59 -07:00
Vinnie Falco
c51ac9d6da Fix rocksdb relative include 2014-05-27 15:23:50 -07:00
Vinnie Falco
97c9d02c43 Improved SConstruct:
* Automatic source list built via directory iteration
* Build multiple toolchains and flavors simulaneously:
    - Toolchains: gcc, clang, msvc
    - Flavors: debug, release
* Documentation on aliases (top of the SConstruct file)
2014-05-27 15:23:50 -07:00
Vinnie Falco
0c06939f38 Beast SCons tools:
* Add VSProject SCons Builder
* Add Protoc SCons Builder
* Add Beast build utilities python module
2014-05-27 15:23:49 -07:00
Vinnie Falco
5db677d74d Tidy up some source filenames:
* Add .unity suffix to mark unity sources
* Fix some relative include paths
2014-05-27 15:23:48 -07:00
Nik Bougalis
251ce4efbc base_uint cleanups:
* Remove unused and broken reverse iterators
* Use charUnHex to reduce code duplication
2014-05-27 09:26:18 -07:00
Nik Bougalis
386eabb61f Convert a unit test to manual 2014-05-26 15:29:48 -07:00
Nik Bougalis
b35eabe161 Optimize SQL query composition 2014-05-26 15:29:48 -07:00
Tom Swirly
9ad9845d69 Initialize unassigned variable bConsumed.
* Assigned in the code, but only to false.
* Someday will get assigned to true.
2014-05-23 12:16:24 -07:00
Tom Swirly
74eb25f9b5 RippleCalc: Stop using reference that might have been invalidated. 2014-05-23 12:16:22 -07:00
Nik Bougalis
044f390fe0 Properly standardize RFC1751 inputs 2014-05-23 11:06:43 -07:00
Miguel Portilla
06d6e4901e Complete NodeStore documentation
* Complete README.md
* Add missing doxygen
* Fix getHitRate bug
2014-05-19 10:53:40 -07:00
Tom Swirly
3ca9646329 Refactor the structure of RippleCalc
* Split code into multiple files
* Rename and move things
2014-05-19 10:53:40 -07:00
Tom Ritchford
4b3e629dfd Allow ledgers to be loaded from the command line.
Conflicts:

	src/ripple_data/protocol/BuildInfo.cpp
2014-05-19 10:53:39 -07:00
Tom Swirly
568fae9878 Add documentation comments 2014-05-19 10:53:39 -07:00
Tom Swirly
a844026f6b Clean up pre C++1 idioms:
* Use auto for in some loops
* Fix shadowing iterator declaration
* Rename NUMBER to ARRAYSIZE.
* Use placeholders instead of macros
* Replace macro BIND_TYPE with std::bind
* Replace BOOST_FOREACH with range-for
2014-05-19 10:53:38 -07:00
Vinnie Falco
b677cacb8c Set version to 0.25.1 2014-05-15 11:13:54 -07:00
Nik Bougalis
1d66169ef1 Fix rippled-example.cfg to list 'peers_max' 2014-05-15 11:11:16 -07:00
Vinnie Falco
74653e57e6 Use std::string in lexicalCast 2014-05-15 11:11:15 -07:00
Vinnie Falco
29d1d5f062 Set version to 0.25.0 2014-05-14 09:01:44 -07:00
Vinnie Falco
d8e8693d9a Update rippled-example.cfg 2014-05-13 20:43:39 -07:00
Miguel Portilla
be737e0047 Enable Snappy compression for NodeStore backends.
* Configured via config.cfg
2014-05-13 12:21:01 -07:00
Vinnie Falco
83ef06748d Add snappy compression integration 2014-05-13 12:16:39 -07:00
Vinnie Falco
5a93f9991a Merge commit '8b0602a5824199d495f6720ef2447f695179257a' as 'src/snappy/snappy' 2014-05-13 12:16:31 -07:00
Vinnie Falco
8b0602a582 Squashed 'src/snappy/snappy/' content from commit 1ff9be9
git-subtree-dir: src/snappy/snappy
git-subtree-split: 1ff9be9b8fafc8528ca9e055646f5932aa5db9c4
2014-05-13 12:16:31 -07:00
Vinnie Falco
eb24ca6def Update .gitattributes 2014-05-13 12:15:59 -07:00
Nik Bougalis
22af79606a Fix lexicographical compare during tfRequireAuth processing 2014-05-13 12:10:39 -07:00
Nik Bougalis
bee12fb89d Autobridging future support:
* Refactor and cleanup transactors
* Introduce new direct and bridged transactors
* Rename existing transactor to indicate legacy status
* New direct transactor defaults to being turned off (preserve legacy behavior)
2014-05-13 12:09:47 -07:00
Nik Bougalis
1a9fbab165 CBase58Data Refactoring:
* Remove unnecessary functions.
* Load from a base_uint const& - don't use void pointers.
* Free comparison functions.
* Explicitly specify encoding alphabet.
* Miscellaneous cleanups.
2014-05-13 08:48:53 -07:00
David Schwartz
9a4b9aa69f Remove redundant checkAccept call 2014-05-13 08:48:52 -07:00
David Schwartz
227043e51f Make I/O latency available through server_info 2014-05-13 08:48:51 -07:00
JoelKatz
db3a387224 Fetch pack cleanups:
* Limit backed up fetch pack requests
* Cleanups
* Dispatch fetch packs sooner
2014-05-13 08:48:50 -07:00
David Schwartz
0075f36bbc At level 64, only leaves are allowed 2014-05-13 08:48:49 -07:00
David Schwartz
52f45669d1 Dispatch incoming TX set data 2014-05-13 08:48:48 -07:00
JoelKatz
294a13d653 Put newly-created nodes in the treeNodeCache 2014-05-13 08:48:48 -07:00
JoelKatz
eed66894db SHAMap::canonicalize must return a node with the correct ID 2014-05-13 08:48:47 -07:00
Vinnie Falco
1434695c47 Fix vs2013 availability of make_reverse_iterator 2014-05-13 08:38:02 -07:00
Tom Swirly
390ea65e15 Refactor RippleCalc.cpp:
* Add comments
* Restrict code to 80 colums
* Remove boost::format
* Remove BOOST_FOREACH
* Make members private
* Add ripple_unordered_set to UnorderedContainers.h
* Replace boost::unordered_set with ripple::unordered_set
2014-05-09 12:03:57 -07:00
David Schwartz
6f2bcc6fb0 Keep SHAMapNodes that fault in handling client requests. 2014-05-09 11:46:24 -07:00
David Schwartz
66a762d504 Rework handling of modified ledger nodes:
* Track dirty nodes in a set
* Make flushDirty a member function
* Don't write deleted nodes
* Make sure new nodes are shareable
* Put new nodes in the treeNodeCache
2014-05-09 11:46:15 -07:00
David Schwartz
aaabec0b55 Use last closed ledger for old pathfinding 2014-05-09 11:46:05 -07:00
Nik Bougalis
6339800946 Refactor base_uint<> and STAmount::getText:
base_uint<>:
* Remove unnecessary typedefs and derived classes
* Factor out common code and eliminate redundancies
* Add tag support to improve type safety
* base_uint::ToString() -> to_string(base_uint const&)
* base_uint::GetHex() -> to_string(base_uint const&)

STAmount::getText:
* Don't overallocate
* Eliminate unnecessary copying
2014-05-09 11:45:44 -07:00
Nik Bougalis
a3e4a34021 Implement C++14 std::make_reverse_iterator 2014-05-09 11:45:10 -07:00
David Schwartz
6fcf3fedb6 Use Json::StaticString to improve performance:
* Move JSON-RPC fields to jsonrpc_fields.h
2014-05-07 13:04:35 -07:00
David Schwartz
34cbb26e47 Improved performance monitoring of NodeStore backends:
* Add multi-sample interface to LoadMonitor
* Instrument fetch operations and completions for reporting in server_info
2014-05-05 14:17:23 -07:00
David Schwartz
07d0379edd Reduce number of async fetches 2014-05-05 14:17:23 -07:00
Tom Swirly
96e8cddfc2 New strConcat concatenates strings in O(n) time.
* Accepts std::string and char const*.
* Also accepts numbers, bools and chars.
* New ripple::toString function augments std::to_string to handle
  bools and chars.
2014-05-05 14:17:23 -07:00
Tom Swirly
3c5e4e440b Clean up of TransactionSign and friends. 2014-05-05 14:17:22 -07:00
Tom Swirly
5ffcbb9b65 Add documentation to SHAMap 2014-05-05 14:17:21 -07:00
Nik Bougalis
ec0fe312af Simplify and improve performance of STAmount::createHumanCurrency 2014-05-05 14:17:21 -07:00
Miguel Portilla
3025d8611b Rename Feature to Amendment:
* Added a README.md describing an Amendment
2014-05-05 13:50:00 -07:00
Miguel Portilla
98612a7cd6 Cleanup nodestore backend classes:
* Add README.md
* Add missing std::move calls
* Refactor visitAll in backend
2014-05-05 13:50:00 -07:00
MarkusTeufelberger
6e428054ef Update RPM spec file to version 0.24.0 2014-05-05 13:49:59 -07:00
Vinnie Falco
3eb1c7bd6f Set version to 0.24.0 2014-05-05 10:20:46 -07:00
Vinnie Falco
2ed2158309 Set version to 0.24.0-rc2 2014-05-02 13:01:17 -07:00
JoelKatz
112d383698 Pathfinding dispatch improvements
* Simplify decision whether to update a path
* Prevent pathfinding threads from blocking each other
2014-05-02 13:01:17 -07:00
Vinnie Falco
11d0c89a59 Set version to 0.24.0-rc1 2014-05-01 16:14:20 -07:00
JoelKatz
7cffd0e0f5 Add comments to LedgerHistory 2014-05-01 16:14:14 -07:00
JoelKatz
d1f5006e44 Validation timing fixes:
* Log whether consensus built a ledger we already had or were acquiring
* Don't trigger an acquire for a validation for a ledger we might be building
* When we finish building a ledger, try to accept that ledger
* If we cannot accept a built ledger, check held validations
* Correctly set isCurrent for untrusted validations
* Add appropriate logging

This fixes a race condition that could cause spurious and expensive
ledger fetches across the network and delayed recognition of
fully-validated ledger.
2014-05-01 16:14:09 -07:00
Vinnie Falco
a10c48182f Move .proto and generated sources 2014-05-01 09:53:42 -07:00
Howard Hinnant
b5348980e2 Improve Json::Value special members (fixes RIPD-215):
* Add move special members
* Fix Json::Value::swap
2014-04-30 13:01:00 -07:00
Nik Bougalis
73c5a867c6 Fix out-of-order initialization 2014-04-30 11:32:18 -07:00
miguelportilla
b8162884d9 Finish implementation of Ledger process/Features logic:
* Defining RIPPLE_PROPOSE_FEATURES enables ledger features
* Reduce dependence on getApp via dependency injection
* Converted uint32 members to use Clock::time_point
* Inject Journal, tidy up classes:
    - Features
    - FeaturesImpl
    - FeeVote
    - FeeVoteImpl
2014-04-28 14:54:17 -07:00
David Schwartz
ebae927a3e Allow range-based for to work on STVector256 2014-04-28 14:54:17 -07:00
David Schwartz
3dde8b4345 If RocksDB high threads are configured, use them for flushes 2014-04-28 14:54:16 -07:00
Nik Bougalis
6f6720b346 Optimize composition of HTTP/RPC reply strings 2014-04-28 14:54:16 -07:00
JoelKatz
1ba0d40bb4 Small Ledger cleanups and improvements:
* Remove call to updateHash in LedgerConsensus::accept
 * Correct serialization size in updateHash
 * Add some comments to setImmutable and setAccepted
2014-04-28 14:54:15 -07:00
Nik Bougalis
3b87b140c9 Update README.md 2014-04-28 14:54:15 -07:00
Nik Bougalis
912d74e805 Tidy up some STAmount and base_uint operations:
* Constrain use of arithmetic operators in STAmount
* Prevent constructor conversion of uint256 to uint128 - make intent clear
* Prevent implicit conversion of uint64_t to uint256
* Prevent implicit conversion of uint64_t to uint160
2014-04-28 14:54:15 -07:00
JoelKatz
6ae329f4a6 Universal flags need to be added to tfAccountSetMask 2014-04-24 20:39:16 -07:00
Tom Swirly
360db3c7ca Fix RIPD-166:
* Allow RPC commands sign and submit to sign using the regular key.
* Allow command line RPC command submit to take an "offline" flag.
* Mark SerializedObject.getFlags() as const.
2014-04-24 20:27:45 -07:00
Tom Swirly
c39fd4e64d RPC: Improve wallet_propose, deprecate wallet_seed:
* Add master_key, public_key and public_key_hex to wallet_propose's JSON response.
* Report an error if we can't understand wallet_propose's passphrase.
* Deprecate wallet_seed by adding a "deprecated" parameter directing the user to wallet_propose.
2014-04-24 10:21:55 -07:00
Nik Bougalis
f4aec40fc1 Fix display formatting of STAmount 2014-04-22 12:39:43 -07:00
Tom Swirly
7fed69fc13 Split RPCHandler into a large number of small parts:
* Handler methods of RPCHandler are extracted into individual files.
* Helper methods of RPCHandler are converted into free functions, and
  extracted into individual files.
* Much code leaves ripple_app/rpc/RPCHandler.cpp and enters ripple_rpc/.
2014-04-18 11:22:29 -07:00
Nik Bougalis
f26d95d0bb Quality tests aren't manual 2014-04-18 09:31:22 -07:00
Vinnie Falco
29ee4899bc Fix VS2013 warnings about integer conversions 2014-04-17 13:06:06 -07:00
Howard Hinnant
6596c94eb9 Refactoring of container usage:
* New ripple container aliases use hardened_hash
* Use std::tuple instead of boost::tuple
* Use std unordered containers instead of boost
* Fix Destroyer for new containers
* Fix warning for fnv1a on 32-bit arch
* Validator fixes for new containers
2014-04-16 19:00:13 -07:00
Vinnie Falco
6f8145b696 Add [max_peers] doc to example cfg 2014-04-16 12:23:26 -07:00
Miguel Portilla
65f496fefb Fix 64-bit Visual Studio build 2014-04-16 12:19:32 -07:00
Vinnie Falco
3ca8bf5f98 Remove obsolete TODO files 2014-04-16 07:48:56 -07:00
Vinnie Falco
62354350a3 Refactor ripple_overlay:
* Use rvalue move to receive accepted sockets
  * Split asio dependent APIs to their own class and file
  * Update documentation
  * Organize code into different files
  * Make some members private
  * Rename things for clarity
2014-04-16 07:48:56 -07:00
Tom Swirly
898b7eb6f0 Add CleanCCPFiles.py, a utility for tidying up whitespace 2014-04-15 11:52:02 -07:00
Nik Bougalis
398edd39f8 Add beast::tagged_integer:
* Wraps standard integer types to provide type-safety
 * Named types provide self-documenting semantics
 * Catches programmer errors involving mismatched types at compile time
 * Operators restrict mutation to only safe and meaningful operations
2014-04-15 11:48:35 -07:00
Nik Bougalis
5fddf374f4 Refactor usage of boost::format 2014-04-15 11:48:34 -07:00
Nik Bougalis
2ed8edc19d Make is_set_bit a universal template function 2014-04-15 11:40:58 -07:00
Tom Swirly
feb88c4f7f Enforce minimum version requirements on OpenSSL and Boost 2014-04-15 10:22:51 -07:00
Vinnie Falco
ebcedcbe93 Fix Visual Studio 2013 build 2014-04-15 08:13:53 -07:00
The Doctor
e3995ac776 Updated example cfg for new validator public keys.
Signed-off-by: The Doctor <drwho@virtadpt.net>
2014-04-14 18:21:06 -07:00
Tom Swirly
64ee0d07d0 New Zero struct implements "compare with zero."
* Zero lets classes efficiently compare with 0, so
  you can use constructors like x < zero or y != zero.
* New BEAST_CONSTEXPR to handle Windows/C++11 differences
  regarding the constexpr specifier.
2014-04-14 11:14:11 -07:00
Tom Ritchford
524f41177c Improvements to scons build for beast.
* Common code extracted to Python directories.
* Read ~/.scons file for scons environment defaults.
* Override scons settings with shell environment variables.
* New "tags" for debug, nodebug, optimize, nooptimize builds.
* Universal platform detection.
* Default value of environment variables set through prefix dictionaries.
* Check for correct Boost value and fail otherwise.
* Extract git describe --tags into a preprocesor variable, -DTIP_BRANCH
* More colors - blue for unchanged defaults, green for changed defaults, red for error.
* Contain unit tests for non-obvious stuff.
* Check to see that boost libraries have been built.
* Right now, we accept both .dylib and .a versions but it'd be easy to enforce .a only.
2014-04-11 10:40:26 -07:00
Vinnie Falco
04ea9ff74c New classes for processing offers in order books:
* BookTip provides consume-and-step offer traversal
* OfferStream applies offer business rules and presents offers to callers
* Taker class manages state for the active party during order processing
* Offer class wraps book offers for presentation
2014-04-10 17:49:19 -07:00
Vinnie Falco
53bf5e7f36 New classes and types for handling asset amounts:
* Quality opaque type for order book quality
  * Amount replacement for STAmount
  * Amounts, in/out amount pair for offers
  * 'core' namespace with type aliases for Ripple primitives.
2014-04-10 17:49:19 -07:00
Nik Bougalis
bd60a93cd6 Fix conversion of binary data to hexadecimal strings in some cases. 2014-04-07 14:56:37 -07:00
The Doctor
8a608b5829 Configuration file improvements:
* Set default node_db to RocksDB from HyperlevelDB, to match gateway
  appliances and Ripple Labs server configurations.
* Set some rpc_startup options to reduce logging and save disk space.
* More sensible documentation regarding WebSocket SSL directives

Signed-off-by: The Doctor <drwho@virtadpt.net>
2014-04-07 13:19:21 -07:00
David Schwartz
151388692a Add bg_threads and high_threads RocksDB tunables 2014-04-04 19:01:01 -07:00
Nik Bougalis
bec876d062 Remove unused legacy code 2014-04-04 19:00:58 -07:00
Howard Hinnant
81238e21a5 Force BOOST_ASIO_HAS_STD_ARRAY to 1
for the clang / gcc libstdc++ 4.8 combination
2014-04-03 14:58:28 -04:00
Howard Hinnant
cc354ee9f2 Sub in std::array for boost::array and beast::FixedArray 2014-04-03 14:02:34 -04:00
JoelKatz
90842073bf Must set flags before signing validation. 2014-04-02 18:39:59 -07:00
Nik Bougalis
a5488c3727 Autobridging hooks and cleanups:
- Detect when we should autobridge and get bridge books.
- Move applyOffer from STAmount into the OfferCreate transactor.
2014-04-02 18:39:59 -07:00
Nik Bougalis
166b8963bb Don't create peer doors in standalone mode 2014-04-02 14:16:24 -07:00
Nik Bougalis
c51644f1b9 More robustly validate signature inputs, closes #313 2014-04-02 14:16:07 -07:00
Vinnie Falco
f124a34730 Fix assert invariant in Peers::close_all 2014-04-01 10:24:55 -07:00
Howard Hinnant
30e882196f New hash_append robust container hash function framework:
* is_contiguous_hashable trait identifies optimizable types
* hash_append() function overloads for basic types:
  - scalars, floats
  - array, C array
  - pair, tuple
  - boost array and tuple (if configured)
* Provided Spooky hash wrapper for use with hash_append
* Use hash_append in hardened_hash and other places
* New Utility meta functions for working with variadics:
  - static_and
  - static_sum
* Added type_name utility function for diagnostics
* hash_metrics suite of functions to evalulate hash functions
* Test suites to measure hash function performance
* Various fixes
2014-03-31 15:49:23 -07:00
David Schwartz
14830c7cb4 Avoid redundant unlock 2014-03-31 09:11:52 -07:00
JoelKatz
5a21269da4 mRecentPositions must be protected by the master lock. 2014-03-28 13:45:53 -07:00
JoelKatz
cc5466d450 Reject expired transactions immediately 2014-03-28 10:33:53 -07:00
JoelKatz
a068bff9c1 Set fully-canonical flag in transactions and validations. 2014-03-28 09:34:22 -07:00
David Schwartz
1e54472a1d Clean local transaction checks. Check account field size 2014-03-25 16:20:22 -07:00
David Schwartz
be9e18ddb8 Track and re-appply LocalTransactions as needed 2014-03-25 16:20:22 -07:00
JoelKatz
5d1aec6280 Charge for pathfinding updates. 2014-03-25 16:20:22 -07:00
JoelKatz
0442b3a683 Change resource costs. 2014-03-25 16:20:22 -07:00
Vinnie Falco
bbc8a8fdc4 Move hardened_hash to container/ 2014-03-25 15:22:34 -07:00
Vinnie Falco
428872731a Add beast SConstruct and .travis.yml 2014-03-25 15:22:34 -07:00
Nik Bougalis
015d91b50d OfferCreateTransactor cleanups:
- Use std containers instead of their boost counterparts
- Reduce transactor console verbosity
- Remove unneeded parameter shadowing member variable
- Remove BOOST_FOREACH
- Add comments
- Small cleanups
2014-03-25 15:22:33 -07:00
Nik Bougalis
436061be22 Transactor journal support and small cleanups 2014-03-25 15:22:13 -07:00
Nik Bougalis
d447a1db39 Refactor ECDSA canonical checks:
* Add signature canonicalization unit tests
* Tidy up into new classes and functions
2014-03-25 15:22:13 -07:00
Luke Cyca
a4a7dd4314 Fedora RPM support:
- Add RPM spec file
- Whitelist Fedora during SConstruct
2014-03-24 14:07:36 -07:00
Roberto Catini
4886772ca3 Add Arch Linux PKGBUILD:
The install process will first fetch the tip of the master branch
to build the latest official rippled release. It will also create
all the necessary data directories in /var.

An optional systemd service definition file is included.
2014-03-24 14:07:27 -07:00
The Doctor
0f19efac2d Example configuration file update:
- Fix config database default location.
  - Add SSL/TLS for WebSockets config. Currently commented out.
2014-03-24 14:07:19 -07:00
Vinnie Falco
b2d97703c6 beast cleanup and tidying:
* Replace custom types with C++11 <cstdint> types
* Fix sqlite integer intos and uses
* Fix String implicit integer constructors
* Escape the enclosing namespace in sqdb
* Replace contract checks with assert
* Make many header files compile independently
* Remove the dependence on beast_core.h in many places
* Remove unused or obsolete classes and functions
* Remove unused or obsolete macros
* Remove unused network functions and files
* Remove unused or obsolete classes:
  - ChildProcess
  - HighResolutionTimer
  - InterProcessLock
  - Throw
  - TrackedMutex
  - UntrackedMutex
  - XmlDocument
  - XmlElement
2014-03-23 15:23:55 -07:00
Vinnie Falco
936f45c7ec Add hardened_hash, prevents adversarial inputs 2014-03-22 18:42:18 -07:00
Vinnie Falco
a865149c65 New unit_test framework:
* Header-only!
* No external dependencies or other beast modules
* Compilation options allow for:
  - Stand-alone application to run a single test suite
  - Stand-alone application to run a set of test suites
  - Global suite of tests inline with the host application
  - Disable test suite generation completely
* Existing tests reworked to use the new classes
2014-03-21 18:00:37 -07:00
Vinnie Falco
547019bd1b beast.streams improvements:
* New basic_std_ostream wraps any std::stream.
* New debug_ostream redirects output to debugger if attached.
2014-03-21 07:33:16 -07:00
Vinnie Falco
953805d97e Add const_container 2014-03-21 07:33:16 -07:00
Vinnie Falco
e344cb3d62 beast cleaning and tidying:
* Consolidate small modules into one
* Remove Android-specific platform support
* Remove Chrono.h from beast_core.h
* Removed files:
  - TypeTraits.h
  - Utility.h
  - Net.h
  - Asio.h
* Remove zlib support:
  - Remove inline zlib library sources
  - Remove GZIPCompressorOutputStream
  - Remove GZIPDecompressorInputStream
* Remove obsolete or unused classes:
  - AbstractObject
  - BigInteger
  - BufferedInputStream
  - CacheLine
  - CPUMeter
  - DatagramSocket
  - DynamicObject
  - FileLogger
  - FPUFlags
  - Identifier
  - JSON
  - LocalisedStrings
  - MACAddress
  - MemoryAlignment
  - MemoryInputStream
  - MemoryMappedFile
  - NamedValueSet
  - OptionalScopedPointer
  - PerformanceCounter
  - PropertySet
  - ScopedTimeInterval
  - SparseSet
  - SpinDelay
  - StreamingSocket
  - StringPool
  - SubregionStream
  - Uuid
  - Variant
2014-03-21 07:30:50 -07:00
Vinnie Falco
693a5927a9 Update to SQLite 3.8.4.1 2014-03-20 19:17:25 -07:00
Howard Hinnant
07e2f87079 Fix and add tests for empty_base_optimization. 2014-03-20 13:47:48 -07:00
Vinnie Falco
9b152d8098 Fix error code assignment in raw_parser 2014-03-20 10:43:01 -07:00
Vinnie Falco
8daecb5430 Add abstract streams module:
* New basic_abstract_ostream template for generic output
* New abstract_ostream, common type alias
* basic_scoped_ostream, RAII output to abstract streams
2014-03-19 15:42:20 -07:00
Vinnie Falco
f1462de729 Add workaround/noexcept.h for visual studio 2014-03-19 13:42:05 -07:00
Vinnie Falco
3cb3e5273f Change to the treatment of BeastConfig.h
* No longer requires its own compiler include path
* Includes use relative paths to locate the file
* Client applications include the file themselves
* Inclusion of BeastConfig.h can be controlled via preprocessor directive
2014-03-19 13:42:04 -07:00
Howard Hinnant
cad50c68a8 General tidy and refactoring:
* Use nullptr (C++11) instead of NULL.
* Put each file into its own namespace declaration.
* Remove "using namespace" directives and add scope qualifiers.
* Control when beast's implementation of std::equal (C++14) is used.
* Tidy up some const declarations.

Conflicts:
	src/ripple_app/shamap/SHAMapSync.cpp
	src/ripple_app/tx/TransactionEngine.cpp
2014-03-19 13:42:01 -07:00
Vinnie Falco
c581ffb8a4 Restructure joyent message parser (from Node.js):
* New http::raw_parser wrapper
* Convert parser errors to error_code
* Enumeration and strings for parsed HTTP method
* Move parser engine into joyent namespace
* Rename includes to be distinct
2014-03-19 10:41:24 -07:00
Vinnie Falco
556778dbdb beast, beast::asio improvements and fixes:
* New maybe_const_t alias for maybe_const
* New asio::enable_wait_for_async for safe cleanup
* New asio::memory_buffer, a managed boost::asio compatible buffer
* shared_handler improvements:
   - Can be 'empty' (no stored handler).
   - Default constructible as 'empty'.
   - Safe evaluation in bool contexts, false==empty
* Fix is_call_possible metafunction:
   - Works on empty argument lists
   - Works with reference types
* Replace SafeBool idiom with C++11 explicit operator bool
* Move IPAddress function definitions to the header
* Move cyclic_iterator to container/
* Remove unused BufferType
* Remove obsolete classes:
   - NamedPipe
   - ReadWriteLock
   - ScopedReadLock
   - ScopedWriteLock
   - LockGuard
2014-03-17 17:40:55 -07:00
Vinnie Falco
816fab000d Fix SConstruct compiler arguments 2014-03-17 14:49:31 -07:00
Nik Bougalis
66d1dd6f81 Build system improvements:
* Reduce console verbosity.
* Display configured build environment.
* Log build environment and commands in rippled-build.log.
* When compiling under Travis:
  - define TRAVIS_CI_BUILD for C and C++ code.
  - define RIPPLE_MASTER_BUILD for builds made against
    the official Ripple repository.
2014-03-17 09:22:11 -07:00
Vinnie Falco
3eae68fc34 Remove obsolete support scripts 2014-03-15 06:07:43 -07:00
Vinnie Falco
8545aee4c7 Better diagnostics for SSL certificate failures 2014-03-14 16:20:34 -07:00
Vinnie Falco
29a4f61551 Set version to 0.23.0 2014-03-14 13:01:23 -07:00
Vinnie Falco
c2fd1215f5 Refactor beast::asio:
* New tools for completion handlers:
  - wrap_handler provides composed io_service execution guarantees.
  - bind_handler rebinds arguments to handlers.
  - shared_handler type-erases any completion handler.
  - buffer_sequence type-erases templated BufferSequences
  - abstract_socket replaces Socket
  - socket_wrapper replaces SocketWrapper
  - beast::asio placeholders to work with std::bind

* Removed obsolete classes and functions
  - AbstractHandler
  - ComposedAsyncOperation
  - SharedFunction
  - SharedHandler
  - SharedHandlerAllocator
  - SharedHandlerPtr
  - SharedHandlerType
  - SocketBase
  - SocketWrapperStrand
  - wrapHandler

* Refactored classes to use new tools
  - abstract_socket
  - socket_wrapper
  - HandshakeDetector
  - HttpClientType

* Miscellanous tidying
  - socket classes moved to beast::asio namespace
  - beast asio files provide their own namespace declaration.
  - Fix IsCallPossible conflicting template parameter name
  - Use <boost/get_pointer.hpp> for C++11 compatibility.
  - Remove extraneous include path from build environment.
2014-03-14 08:03:48 -07:00
Vinnie Falco
e3c1375f36 Add std::integer_sequence C++14 compatibility 2014-03-14 07:57:20 -07:00
Vinnie Falco
4e357601ec Move MultiSocket, RippleSSLContext to common module 2014-03-14 07:57:20 -07:00
Vinnie Falco
3674b01634 Add ripple::byte_view, ripple::const_byte_view 2014-03-14 07:57:20 -07:00
Vinnie Falco
f66aee4e7f Add beast::buffer_view 2014-03-14 07:57:19 -07:00
Vinnie Falco
b2f06dbe3c Add C++11 noexcept compatibility for VS2013 2014-03-14 07:57:19 -07:00
sublimator
b78076670e Fix typos: tecMASTER_DISABLED, tecNO_REGULAR_KEY 2014-03-14 07:57:18 -07:00
sublimator
a08a0703b6 Remove Jenkins CI build status badge
This isn't used any more is it?
2014-03-13 21:15:13 -07:00
sublimator
f80561e6aa Travis: disable gdb thread event logging
Attempt 2
2014-03-13 21:15:13 -07:00
JoelKatz
f5765b71f2 Handle unexpected relative paths from __FILE__
Fixes comref#RIPD-133
2014-03-13 16:49:20 -07:00
Vinnie Falco
6a6be847c0 Set version to 0.23.0-rc1 2014-03-12 19:05:08 -07:00
Nik Bougalis
4e26108a06 Protect callers of MultiSocket::remote_endpoint from exceptions 2014-03-12 13:51:00 -07:00
JoelKatz
c517d261bb Return a sensible error for unknown inner JSON fields 2014-03-12 00:54:00 -07:00
JoelKatz
5522a23670 Don't relay old proposals. 2014-03-11 22:21:34 -07:00
JoelKatz
64345f90a8 Allow setting LedgerConsensus to TRACE 2014-03-11 22:12:48 -07:00
JoelKatz
879c0d6b78 Be less promiscuous relaying proposals 2014-03-11 21:49:46 -07:00
Nik Bougalis
2e8df429df Expose PeerImp::start instead of requiring the use of accept/connect 2014-03-11 19:02:18 -07:00
JoelKatz
7aa1222310 Fix the "peer action" transition from syncing to full 2014-03-11 19:02:18 -07:00
JoelKatz
2b5142ee4d Make transaction forwarding less promiscuous 2014-03-11 19:02:17 -07:00
Nik Bougalis
e8d7d339ef Transactor refactoring:
- Reorganize transactor source files and VS project
- Don't expose Transactor interfaces to anyone but the TransactionEngine
- Improve compile times
- Begin using Journal
2014-03-11 19:02:17 -07:00
Nik Bougalis
5324a6d59d Don't create a Transactor if we don't have a valid TxID 2014-03-11 19:02:17 -07:00
Nik Bougalis
569b3a46a1 Cleanups:
- Cleanup VotableInteger class and remove unused duplicate
 - Remove obsolete function and move to std functions
 - Fix typos
 - Make isMemoOkay a free function
 - Sanitize error returns
2014-03-11 19:02:17 -07:00
JoelKatz
fc129e43fd Cleanup handling of expired offers 2014-03-11 19:02:16 -07:00
JoelKatz
b22a0f4a97 Ensure offer cleanup is deterministic 2014-03-11 19:02:16 -07:00
JoelKatz
cf63b5c859 Fix logging transactions that throw 2014-03-11 19:02:16 -07:00
David Schwartz
b4593a274d Limit how many reads we defer to avoid overflowing the cache 2014-03-11 19:02:16 -07:00
David Schwartz
163daf012a Add 'MemoData' field 2014-03-11 19:02:16 -07:00
JoelKatz
63df034bcf Clean up job renaming 2014-03-11 19:02:16 -07:00
David Schwartz
60787be80c Check the node store for transaction nodes with metadata 2014-03-11 19:02:15 -07:00
David Schwartz
f42ae3af21 Add ledger_data command to get full ledgers in pieces 2014-03-11 19:02:15 -07:00
David Schwartz
b1fea3c51e Disable retrieving full state trees for non-admins. 2014-03-11 19:02:15 -07:00
David Schwartz
16d2bbd6e5 Avoid disk I/O when data 'moves' in a SHAMap 2014-03-11 19:02:15 -07:00
David Schwartz
2505a908c5 Logging reduction in PeerImp 2014-03-11 19:02:15 -07:00
Nik Bougalis
4b71673ee9 Improve validation of JSON inputs 2014-03-11 19:02:14 -07:00
Nik Bougalis
242494a9ad Allow a server to keep no ledger history, closes #299 2014-03-11 19:02:14 -07:00
Nik Bougalis
3a684ce280 Robust HashPrefix initialization, closes #300 2014-03-11 19:02:14 -07:00
Nik Bougalis
756da7b844 Fix strUnHex parsing of odd-length strings and add unit tests 2014-03-11 19:02:14 -07:00
Nik Bougalis
9c465487ae Cache the result of remote_endpoint at connect/accept time and use it 2014-03-11 19:02:14 -07:00
Donovan Hide
e8002a7a62 Fix ledger log warning, closes #298 2014-03-11 19:02:13 -07:00
Nik Bougalis
5a53b48026 Require a C++11 conforming compiler 2014-03-11 19:02:13 -07:00
Vinnie Falco
b3f725d9fd Update http code for http parser API changes 2014-03-06 21:44:29 -08:00
Vinnie Falco
50f5d5bdf3 Merge commit '6c0edd2190bfd18ffc523f486367da3724cf98a3' into develop 2014-03-06 21:22:22 -08:00
Vinnie Falco
6c0edd2190 Squashed 'src/beast/beast/http/impl/http-parser/' changes from 547553b..cba704c
cba704c Bump version to 2.2.1
a252d4e fix content-length and chunk-size overflow test
42d6541 add vc project files to .gitignore
fd609ab Bump version to 2.2
efcf75d test: better fix for __APPLE__ test build
9ca484d test: fix build on osx
d7b938b Parse and emit status message of response
11419c8 Use unsigned int as bitfield type.
c4079e7 Add syntax highlighting to README C code
f5c779b Update misleading comment.
3cbd13d test: add amazon.com response test

git-subtree-dir: src/beast/beast/http/impl/http-parser
git-subtree-split: cba704cb2d9f1df80994dd4a791a0fa6cce65720
2014-03-06 21:22:22 -08:00
Vinnie Falco
d9a0181189 Set version to 0.22.0 2014-03-04 15:43:34 -08:00
Howard Hinnant
09570996a9 Fix beast::asio failures on OS X.
There are 38 unittest failures on OS X.  These changes address all of
them by adjusting which side of the socket (send or receive) gets
shut down.  In each case, the failure was 'Socket is not connected'.
I've interpreted that to mean that the other thread had already shut
down its side of the connection.
2014-03-04 15:43:33 -08:00
JoelKatz
adc4c855ca Fix the ledger range we advertise to peers 2014-03-04 15:43:33 -08:00
Nik Bougalis
8b1df06a94 PeerFinder fixes:
* Fix local advertisement (was missing)
* Fix Livecache histogram display
* If no [ips] are specified, use r.ripple.com
* Use different backing stores for PeerFinder and Validator databases
2014-03-04 15:43:32 -08:00
Vinnie Falco
7c81eec30c Remove unused TextDiff 2014-03-04 07:23:53 -08:00
Vinnie Falco
faa999d6d0 Consolidate C++14 compatibility into new headers 2014-03-03 18:51:56 -08:00
David Schwartz
370bfb7a22 Permit memos up to 1Kb.
* Overlong memos are basically treated like invalid signatures.
* Ability to clear message key.
2014-03-03 18:51:55 -08:00
David Schwartz
ae649ec917 Signature canonicalization and transaction mutation fixes 2014-03-03 18:51:55 -08:00
JoelKatz
93b44fcdc1 Return an empty pointer from getLedgerBySeq if sequence in future 2014-03-03 14:07:18 -08:00
David Schwartz
1fe57720c4 Legacy Pathfinding API improvements:
* Use the cache for source/dest currencies
* Allow a search depth and initial paths to be specified in old pathfinding
2014-03-03 10:59:31 -08:00
JoelKatz
fca8fa1b1b Clean up ledger fetch reasons.
Don't trigger immediately when fetching historical ledgers.
2014-03-03 10:57:36 -08:00
David Schwartz
81082ad10f Don't check the node store for proposed txn nodes 2014-03-03 10:57:31 -08:00
David Schwartz
2c515636cb Release the InboundLedger lock during getMissingNodes 2014-03-03 10:57:26 -08:00
David Schwartz
2f7ac98e34 Improve I/O when fetching ledgers
* negative cache for node store
* async fetch, thread pool for node store
* read barrier logic for node store
* SHAMap getMissingNodesNB (non-blocking)
* non-blocking getMissingNodes traverse
* tune caches
2014-03-03 10:56:48 -08:00
Nik Bougalis
37b39ed1a1 Update LICENSE 2014-03-01 11:54:11 -08:00
Nik Bougalis
73485d5a23 Resolve hostnames found in the [ips] config section 2014-03-01 11:53:57 -08:00
Nik Bougalis
28c7827f14 Calculate program file directories:
* Determine location of database files in Config
* Inject database directory or file path in PeerFinder and Validators
* PeerFinder and Validators will share the same sqlite file
2014-03-01 11:53:57 -08:00
JoelKatz
e055dc1513 WebSocket dispatch changes.
Don't let one connection hold a thread for too long without
having to wait for another turn
2014-02-28 12:18:15 -08:00
JoelKatz
c173f14fc0 Give pathfinding updates priority over client and RPC requests 2014-02-28 12:15:41 -08:00
Howard Hinnant
cd30e552a7 Fix clang warnings 2014-02-28 12:15:12 -08:00
Vinnie Falco
9bf1a76e91 Remove unused classes 2014-02-28 12:03:33 -08:00
Vinnie Falco
2957b688fd PeerFinder and Peers fixes:
- Fix bootcache incorrect failure on socket cancel
- Fix peer connect race on stop
- Simplify some loops
- Require boost 1.55 via static_assert
2014-02-28 12:03:33 -08:00
JoelKatz
add40d524f Merge pull request #296 from nbougalis/quickfix-jobcount
Fix variable mismatch for job counts
2014-02-26 14:38:51 -08:00
Nik Bougalis
04a55e35b6 Fix variable mismatch for job counts 2014-02-26 14:29:00 -08:00
JoelKatz
955ce45448 Fix the assert on a self-connect 2014-02-24 22:30:04 -08:00
Vinnie Falco
995e64a205 PeerFinder fixes:
* Fix split horizon using recent address cache
* Change message tuning parameters to reduce dead messages
* Improved peer handout algorithm for addresses
* Improved handout algorithm for redirects
* Improved selection algorithm for autoconnect
* Faster autoconnection strategy
* Consolidate deadline timers
* Send empty endpoints message as a socket ping
* Fix hop count adjustments for live cache filtering
* Remove broken Peer::isConnected function
* Optimized Livecache for handouts
* Optimized Bootcache for handouts
* Remove uptime metric from Bootcache entries
* Add histogram to Livecache print output
2014-02-24 19:25:01 -08:00
Vinnie Falco
bf085f0ef3 New utility classes, containers, C++14 compatibility, and fixes:
* Add std::equal_to <void> (since C++14)
* Add heterogeneous std::equal (since C++14)
* Add maybe_const
* Add empty_base_optimization
* Add is_constructible specialization for pair, tuple
* Add aged associative containers:
  - aged_set, aged_map, aged_multiset, aged_multimap
  - aged_unordered_set, aged_unordered_map,
  - aged_unordered_multiset, aged_unordered_multimap
* Fix auto keyword pass by reference
* Fix basic_seconds_clock warning and project file
2014-02-24 19:25:01 -08:00
David Schwartz
1374b37882 Remove dead serializer signature code 2014-02-24 18:28:44 -08:00
JoelKatz
e275f4eb9d Handle a removed peer when counting ledger use 2014-02-24 18:28:43 -08:00
JoelKatz
652d809129 Validate params before dispatching 2014-02-24 18:28:43 -08:00
JoelKatz
c186519bcf Ledger fetch fixes. 2014-02-24 18:28:42 -08:00
Nik Bougalis
870fb4f291 Fix missing break on mtCLUSTER handler 2014-02-24 18:28:42 -08:00
Nik Bougalis
7cd63489f4 Refactor Job tracking and statistics gathering 2014-02-23 01:47:35 -08:00
Vinnie Falco
616a53888e Use forward_tuple to prevent needless copies 2014-02-22 21:33:01 -08:00
Vinnie Falco
a336cc26f9 Remove deprecated IPAddress 2014-02-22 21:33:00 -08:00
Howard Hinnant
382088c456 Add find_create stat to InboundLedgers 2014-02-22 21:33:00 -08:00
Howard Hinnant
ff80531db4 Update LICENSE 2014-02-22 21:32:59 -08:00
Vinnie Falco
105cf3cd1e Revert "Tidy up build scripts:"
This reverts commit 66b5f75142.
2014-02-22 21:32:59 -08:00
JoelKatz
38ba7e695a Don't hold the master lock 2014-02-21 14:46:57 -08:00
JoelKatz
996326a00e Configurable fetch depth. 2014-02-17 17:26:58 -08:00
JoelKatz
f2beb82b97 Pathfinding dispatch improvements
* Keep requests forwards, flip only on insert
* Insert requests in more sensible order (after new, before old)
* Remove a redundant cache/request check
2014-02-17 17:26:50 -08:00
JoelKatz
41c0702408 Fix custom currency parsers 2014-02-17 17:26:43 -08:00
Nik Bougalis
66b5f75142 Tidy up build scripts:
* Relax the boost -mt link requirement for Debian
* Tidy up scons output, reduce verbosity, add color
2014-02-17 15:50:51 -08:00
JoelKatz
c2a16ddbab Cannot call gotTXData without master lock ... yet! 2014-02-14 14:26:03 -08:00
Vinnie Falco
5bb194cf89 PeerFinder fixes:
* Add Livecache property stream support
* Tidy up log output
* Move peer code to ripple_overlay module
* Remove or hide some Peer interfaces
* Fix asserts by removing isConnected which was not thread safe
2014-02-14 14:00:51 -08:00
Vinnie Falco
645b9a01c7 Make abstract_clock members const 2014-02-14 11:14:09 -08:00
Vinnie Falco
3a1a5d12de Refactor PeerFinder:
* Revise documentation in README.md
* Inject abstract_clock in Manager
* Introduce the Slot object as a replacement for Peer
* New bullet-proof method for slot accounting
* Replace Peer with Slot for tracking connections
* Prevent duplicate outbound connection attempts
* Improved connection and bootstrap business logic
* Refactor PeerImp, PeersImp private interfaces
* Give PeersImp access to the PeerImp interface
* Handle errors retrieving endpoints from asio sockets
* Use weak_ptr to manage PeerImp lifetime
* Better handling of socket closure in PeerImp
* Improve the orderly shutdown logic of PeersImp
2014-02-13 14:19:27 -08:00
Vinnie Falco
12748e7539 Add chrono APIs to DeadlineTimer 2014-02-12 12:58:20 -08:00
Nicholas Dudfield
2f69d4c8ee Update Travis matrix:
* New clang compiler target
* Sconstruct changes for clang
* Patches to support clang
2014-02-11 19:13:51 -08:00
Nicholas Dudfield
8dbf8b9038 Fix clang compile error 2014-02-11 19:13:45 -08:00
Vinnie Falco
fdfe047f3e Fix new RPC dispatcher params 2014-02-11 19:05:08 -08:00
Vinnie Falco
38c3f84c9f Update beast project file 2014-02-10 19:48:37 -08:00
Vinnie Falco
9c5b071556 Fix crash on exit in ~InboundLedger 2014-02-08 11:07:10 -08:00
Vinnie Falco
46dc52e449 Fix insight object lifetimes in Group 2014-02-08 10:48:54 -08:00
Vinnie Falco
f469e3853d Insight support for jobs:
* Add insight Groups to Application singleton
* Put JobQueue metrics into "jobq" Group
* Add queued time to Job
* Add per-type Job queue time metrics
* Add per-type Job execution time metrics
* Break JobQueue sources out of the namespace
* Use free function to create the JobQueue
2014-02-08 10:09:22 -08:00
Vinnie Falco
a681a4fcd4 Improved logging for insight stat packets 2014-02-08 09:33:04 -08:00
Vinnie Falco
575b0bb7b0 Fix gcc compile 2014-02-07 09:09:01 -08:00
sublimator
588cf4bfca Update travis to use boost 1.55 2014-02-07 08:09:24 -08:00
NATTSiM
9cc8c341e7 Fix clang compile 2014-02-07 08:09:15 -08:00
Vinnie Falco
9b657ba224 Refactor RPC module:
* Move JsonPropertyStream to ripple_json
* Remove unused RPC service manager
* Recreate RPC module in app code area
* Add RPC::Manager
* Add DoPrint handler
2014-02-06 18:21:08 -08:00
Vinnie Falco
9bc6e83f8a Change bassert to always call assert 2014-02-06 14:30:03 -08:00
Nik Bougalis
572aae320d Performance fixes: decongest master lock 2014-02-05 15:57:10 -08:00
Nik Bougalis
2906899811 Ignore ports when checking RPC IP filter list 2014-02-05 15:57:09 -08:00
Nik Bougalis
1a6bf88900 Resolver Work:
* Don't stall during shutdown
* Properly handle unit test execution
* Handle whitespace when parsing names to resolve
2014-02-05 15:57:09 -08:00
Nik Bougalis
e60b28980a PeerFinder work and refactoring:
* Implement PeerFinder business logic.
* Support fixed peers (including DNS support).
* Add journal support to Peer and Peers.
* Refactor PeerDoor support.
* Tidy up Peers and eliminate connection functionality and timers.
* Refactor Peer interface and add journal support.
* Allow construction of incoming Peer using an existing socket.
* Remove TESTNET support.
* Allow connections from/to cluster peers without consuming slots
* Misc. cleanups.
2014-02-05 15:56:04 -08:00
Vinnie Falco
a253b2ef4b Refactor IP::Endpoint 2014-02-05 15:53:16 -08:00
Vinnie Falco
0c2e35edc9 Remove obsolete Visual Studio projects 2014-02-05 15:42:28 -08:00
Vinnie Falco
d0970397a6 Revert system test changes:
* Revert "Shutdown rippled before http server in json rpc test to avoid http server potentially receiving messages due to automatic ledger close interval."
* Revert "Update ripple-lib integration tests"

This reverts commit 83442825e5.
2014-02-04 15:18:36 -08:00
Vinnie Falco
0afbda0351 Redirect Visual Studio 2013 project output 2014-02-04 09:25:27 -08:00
Vinnie Falco
2009f8b1ca Add insight support to TaggedCache, KeyCache:
* Move TaggedCache, KeyCache to common
* Add radmap module, FullBelowCache class
* Add get_seconds_clock
* Inject FullBelowCache in SHAMap
2014-02-03 23:00:45 -08:00
Vinnie Falco
35715a0146 Add basic_seconds_clock, insight::Groups 2014-02-03 22:55:47 -08:00
Vinnie Falco
20e27ceb04 Update Visual Studio 2013 project file 2014-02-03 22:36:29 -08:00
Vinnie Falco
7fb614f7af Fix application pointer singleton lifetime 2014-02-03 22:36:28 -08:00
Nicholas Dudfield
83442825e5 Shutdown rippled before http server in json rpc test to avoid http server potentially receiving messages due to automatic ledger close interval. 2014-02-03 22:36:28 -08:00
Nik Bougalis
123c482a69 Robustly validate input to the 'ledger' RPC command 2014-02-03 18:43:21 -08:00
Vinnie Falco
3f091fce59 Update project build requirements
* Add Visual Studio 2013 project file
* Update SConstruct for boost 1.55.0
2014-02-03 16:58:32 -08:00
wltsmrz
6c5f88aa25 Update ripple-lib integration tests 2014-02-03 10:42:34 -08:00
Vinnie Falco
23eccebf5b Fix crash on exit via Application singleton 2014-02-01 21:28:12 -08:00
Vinnie Falco
15112c1a27 Fix mutable tx json field for autofill_fee 2014-02-01 07:10:53 -08:00
David Schwartz
d0ca81ff36 visitLeaves must visit all branches 2014-01-31 19:26:53 -08:00
David Schwartz
3e218c494d Enlarge the humanAccountID cache 2014-01-31 19:26:53 -08:00
David Schwartz
88bd5b12a4 Raise RPC time and size limits 2014-01-31 19:26:53 -08:00
David Schwartz
5df5983f88 Fix missing call to setHeartbeatTimer 2014-01-31 19:26:53 -08:00
David Schwartz
aa5ca7cea5 Don't copy the parameters when calling lookupLedger 2014-01-31 19:26:53 -08:00
David Schwartz
02483b2e0b Avoid race conditions updating ledger fee entries 2014-01-31 19:26:53 -08:00
David Schwartz
f7817866ba call pubValidatedTransactions, we may have book listeners 2014-01-31 19:26:53 -08:00
JoelKatz
d62287d54b Calculate correct fee in RPC sign/submit, error if over limit 2014-01-31 19:26:53 -08:00
Nicholas Dudfield
aad074cd8e Tweak to path-finding tests. Specify test patterns outside of mocha.opts 2014-01-31 19:05:10 -08:00
Vinnie Falco
580d179dd0 Tidy up Validators logging 2014-01-29 07:53:27 -08:00
Vinnie Falco
616a514c4d Fix PropertyStream overloads 2014-01-29 07:53:27 -08:00
NATTSiM
bac8d41954 Pass IPAddress in getAdminRole 2014-01-28 22:52:11 -08:00
JoelKatz
f295bb20a1 Set version to 0.21.0.rc2 2014-01-24 11:17:16 -08:00
JoelKatz
b5ffa2351a DirectoryEntryIterator fix 2014-01-24 10:54:56 -08:00
JoelKatz
1b37b52071 Whitespace changes 2014-01-24 10:54:47 -08:00
JoelKatz
b1ffd10079 Fix "limit" mishandling in doBookOffers 2014-01-24 10:53:55 -08:00
Vinnie Falco
39235f5b91 Set version to 0.21.0.rc1 2014-01-23 23:31:26 -05:00
JoelKatz
8825d94636 Temporarily change getBookPage not to use OB iterators 2014-01-23 16:26:45 -08:00
JoelKatz
c8a7b2af56 Prevent infinite loop in getBookPage 2014-01-23 16:05:38 -08:00
JoelKatz
d22b25c030 Set version to 0.21.0 2014-01-23 13:38:38 -08:00
JoelKatz
d475994e02 Pairwise no ripple:
* Cannot set noRipple flag with negative balance.
* Paths with consecutive no ripple links are invalid
* Adjust pathfinding value of no ripple out paths
* Check for no ripple when adding links in pathfinding
* Remove old noRipple logic
* Update trust line delete logic
2014-01-23 13:38:33 -08:00
JoelKatz
f0bb3dfdfb Never allow a retry as a final result 2014-01-23 13:38:28 -08:00
JoelKatz
e7f0b8eca6 Add DeliveredAmount to transaction metadata 2014-01-23 13:38:25 -08:00
JoelKatz
0bab6a9fec Add directory and order book iterators
This should fix the crossed order book bug.
* Change OfferCreate::takeOffers to use new iterators
* Change NetworkOps::getBookPage to use new iterators
* If we find an offer in the book but not the ledger, deindex it
2014-01-23 13:38:11 -08:00
David Schwartz
9486fc416c Support AccountTxnID and LastLedgerSequence. 2014-01-23 13:37:46 -08:00
JoelKatz
fb63aa737a Revert d2953f602e 2014-01-23 13:36:31 -08:00
JoelKatz
58a6ca1d3d Remove extraneous logging 2014-01-23 13:24:51 -08:00
JoelKatz
505f029edb Clean up 'destination_currencies' in new pathfinding reply 2014-01-23 13:24:43 -08:00
JoelKatz
815659b898 Replace a lock with an atomic in new pathfinding 2014-01-23 13:24:33 -08:00
JoelKatz
07d16f280c Clean up the checkAccept path to use the ledger sequence 2014-01-23 13:24:28 -08:00
JoelKatz
f88ddc947c Handle non-object in 'json' RPC method 2014-01-23 13:24:22 -08:00
Vinnie Falco
65ffdff40c Insight support for ResourceManager 2014-01-21 10:28:36 -05:00
Vinnie Falco
c95dccfec6 Move PathRequests to separate files 2014-01-21 10:28:36 -05:00
Vinnie Falco
fe83f471f5 Use duration in insight::Event, add chrono_util 2014-01-21 10:28:35 -05:00
sublimator
d2953f602e Error reporting tests 2014-01-21 10:28:35 -05:00
Vinnie Falco
9d07ddeae1 Improved human readable JSON-RPC error messages 2014-01-21 10:28:34 -05:00
Vinnie Falco
ef7810bc95 Add ScopedPointer::reset 2014-01-21 10:28:34 -05:00
David Schwartz
486539b3d3 Make offerDelete and fill Items more robust. 2014-01-21 10:28:34 -05:00
David Schwartz
990fb20a2a OrderBookDB::addOrderBook cleanup 2014-01-21 10:28:33 -05:00
Vinnie Falco
9b61a83721 Refactor, tidy up:
* Fix for msvc std::function return types
* Convert macros to constants
* Add Journal to PeerSet and use in InboundLedger
* Break lines and add annotations
* Remove some warnings
2014-01-21 10:28:33 -05:00
JoelKatz
f753519976 Ledger fetch improvements. Fetch policy improvements. 2014-01-17 16:06:15 -08:00
David Schwartz
663e38dcdd Locking and dispatching performance improvements:
* Avoid taking the master lock in most peer operations
* Dispatch recvGetLedger to JobQueue
* Dispatch consensus ledger fetches.
* Release master lock earlier in RPCHandler
2014-01-17 16:05:48 -08:00
Vinnie Falco
7570b6489d Fix and tidy up NodeStore
* Use std::unique_ptr
* Move globals to Manager singleton (fixes RocksDB exit crash)
2014-01-17 15:21:51 -05:00
Vinnie Falco
c341d1a71e Tidy up for C++11, and fixes:
* Remove shared_ptr legacy support
* Add make_unique support for pre-C++14 environments
* Fix comparison bug in sqdb
* Use std::shared_ptr in a few places
2014-01-17 12:19:04 -05:00
Vinnie Falco
fa10e90c9d Use abstract_clock 2014-01-17 12:19:04 -05:00
Vinnie Falco
68501763dd Refactor KeyCache 2014-01-17 12:19:04 -05:00
Vinnie Falco
cac1d555be Add std::make_unique 2014-01-17 12:19:03 -05:00
NATTSiM
25ff77c2fd Fix Clang compile and link errors 2014-01-16 17:18:05 -05:00
Vinnie Falco
2870c7f457 Workaround for MSVC std::function bug 2014-01-15 19:10:08 -08:00
JoelKatz
ab8d7a86ae Dispatch peerHas to JobQueue 2014-01-14 11:24:41 -08:00
JoelKatz
809359e81e Correctly handle empty account tree in ledger fetch 2014-01-14 11:24:32 -08:00
JoelKatz
6e4cd5bc9c Don't send nodes twice in getNodeFat 2014-01-14 11:24:01 -08:00
NATTSiM
de018bd582 Improved PropertyStream find and print routines 2014-01-13 21:51:31 -08:00
Vinnie Falco
544642a6ea Fix io_latency_probe hang on exit 2014-01-13 18:24:22 -08:00
JoelKatz
06737bb36f SHAMapSync bugfix. Cannot avoid push in getMissingNodes 2014-01-13 09:50:54 -08:00
JoelKatz
7efbfa2d20 Limit legacy pathfinding requests 2014-01-10 23:09:26 -08:00
Vinnie Falco
4d5df92cbc Add io_latency_probe 2014-01-10 22:54:00 -08:00
David Schwartz
1fcb2872b9 Reduce log priorities. 2014-01-10 22:54:00 -08:00
David Schwartz
00c87ca2dd Add LES::dirIsEmpty function to check if a directory is empty 2014-01-10 22:53:59 -08:00
JoelKatz
d474d68566 Order book subscribe cleanups. 2014-01-10 22:53:59 -08:00
David Schwartz
93e03804d0 SHAMapSync cleanups and performance improvements 2014-01-10 22:53:58 -08:00
JoelKatz
4591658160 PathRequests object to own all path requests. 2014-01-10 22:53:57 -08:00
JoelKatz
a2109b4bda Remove files inadvertently added 2014-01-10 22:53:57 -08:00
Vinnie Falco
deafea9c88 [REMOVE] Allow gcc 4.7 and later 2014-01-10 22:53:57 -08:00
Nicholas Dudfield
93f1a05f5c Update build for gcc 4.8.x:
* Use gcc 4.8.x, boost 1.54
* Honor CC,CXX,PATH environment variables
* Prevent compilation with unsupported toolchains
* Print g++ version during Travis build
* Run built-in unit tests after Travis build
2014-01-10 16:24:17 -08:00
Vinnie Falco
95a573b755 Set version to 0.20.1 2014-01-08 17:08:27 -08:00
Nik Bougalis
2a4623814c Don't log StatsD messages to the console by default 2014-01-08 16:57:47 -08:00
Vinnie Falco
1017adf743 Set version to 0.20.0 2014-01-08 16:15:12 -08:00
Vinnie Falco
34fb12344c Fix JobQueue 2014-01-08 14:55:10 -08:00
Vinnie Falco
ce3358bdf8 Improve diagnostics for ResourceManager 2014-01-08 11:18:46 -08:00
Vinnie Falco
1159dadfdb Fix missing jtACCEPT job limit 2014-01-08 11:18:45 -08:00
Vinnie Falco
62516ef07f Refactor TaggedCache 2014-01-07 21:14:14 -08:00
Vinnie Falco
eecd305efd Add std::hash <std::pair> specialization 2014-01-07 21:14:13 -08:00
Vinnie Falco
a83fa6b2b2 Fix warning in chrono_io 2014-01-07 21:14:07 -08:00
Vinnie Falco
b2feafa94c Use abstract_clock and improved tests, in ResourceManager
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 17:23:26 -08:00
Vinnie Falco
2d234e500d Add abstract_clock, manual_clock, chrono_io
Conflicts:
	src/beast/Builds/VisualStudio2012/beast.vcxproj.filters
2014-01-07 17:17:26 -08:00
Vinnie Falco
fee0e7b20e Fix bind in call to addJob 2014-01-07 17:08:01 -08:00
JoelKatz
a0f6429652 Add LedgerHolder class, use in LedgerMaster 2014-01-07 15:57:51 -08:00
JoelKatz
8f8b2ae4a3 Handle offers in quality directory but not in ledger 2014-01-07 15:57:50 -08:00
JoelKatz
9abdd16721 Release the master lock earlier in a few cases 2014-01-07 15:57:50 -08:00
JoelKatz
1e5963aeeb Move some operations from the I/O queue to the Job queue 2014-01-07 15:57:50 -08:00
JoelKatz
e25a83bb39 Some tiny bugfixes:
* Don't let ledger idle interval get too short
* Fix CBigNum::setuint256
* Fix SqliteStatement::isError
* Remove dead code, fix incorrect comments
* Check for NULL earlier in CKey constructors
* Prevent expire times from underflowing in TaggedCache
2014-01-07 15:57:49 -08:00
David Schwartz
e3a67b13ff Reset liquidity before retrying rippleCalc 2014-01-07 15:57:48 -08:00
JoelKatz
750cbb8399 Improvements because items in SHAMaps are immutable:
* SHAMapItem::getData is not needed
* SHAMapTreeNode::getItem is not needed
* SHAMapTreeNode::getData is not needed
* No need to copy them when constructing transactions
* No need to copy them when computing map deltas
* No need to copy them in deepCompare
* No need to copy them in SHAMapTreeNode's copy constructor
2014-01-07 15:57:48 -08:00
JoelKatz
045beb5f36 Concurrent SHAMap code
Use shared lock for SHAMap itself and concurrent map for nodes
2014-01-07 15:57:47 -08:00
JoelKatz
cd8234acba Pathfinding bugfix. Missing lock. 2014-01-07 15:57:46 -08:00
JoelKatz
de85a7c2bd Pathfinding improvements:
* Make each path request track whether it needs updating.
* Improve new request handling, reverse order for processing requests.
* Break to handle new requests immediately.
* Make mPathFindThread an integer rather than a bool. Allow two threads.
* For old pathfinding, if the ledger is unspecified, use the PathRequest's RippleLineCache.
* Log new pathfinding request latencies.
* Suspend processing requests if server is backed up.
2014-01-07 15:57:46 -08:00
Vinnie Falco
087301933a General refactoring, using C++11
* Remove broken RecycledObjectPool

* Fix beast::ServiceQueue using List instead of LockFreeStack

* Add class semaphore, fixes broken Semaphore

* Move crytpo module files to new beast directory

* Use c++11 replacements for boost and beast types:
  - std::atomic instead of beast::Atomic
  - std::function instead of boost::function, beast::function
  - std::unique_ptr instead of beast::ScopedPointer
  - std::shared_ptr instead of boost::shared_ptr

* Remove modules:
  - beast_db
  - beast_crypto
  - beast_extras

* Remove unnecessary classes:
  - AbstractFifo
  - AddConst
  - AtomicCounter
  - AtomicFlag
  - AtomicPointer
  - AtomicState
  - CopyConst
  - Expression
  - ForwardList
  - IfCond
  - Interval
  - IntrusiveArray
  - KeyvaDB
  - PointerToOther
  - PointerTraits
  - RemoveConst
  - RemoveConstVolatile
  - RemoveReference
  - RemoveVolatile
  - SharedObjectArray
  - SingleThreadedSharedObject
  - SophiaDB factory
  - SortedSet
  - WeakReference
  - beast::unique_ptr
2014-01-07 15:57:45 -08:00
JoelKatz
52333b8bd4 Fix a compiler warning in Ledger::visitStateItems 2014-01-07 15:48:50 -08:00
JoelKatz
3768b3c3ca Fix a pathfinding bug 2014-01-07 15:48:50 -08:00
JoelKatz
09b39e107d Fix subscribing to "real time" transactions. 2014-01-07 15:48:49 -08:00
Vinnie Falco
4b1155bf32 Improved diagnostic for RocksDB error codes
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 15:46:38 -08:00
Vinnie Falco
3c7fc31c95 Add ripple_common module
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 15:15:44 -08:00
Nicholas Dudfield
da3881a486 Make websocket-test the first test, and give custom timeouts of 1000ms 2014-01-05 13:40:47 +07:00
Nicholas Dudfield
ff12d9adaa Run server-test and websocket-test first. Show stderr upon abnormal rippled exit 2014-01-05 13:09:42 +07:00
Vinnie Falco
528cf56f80 Reduce StatsDCollector log verbosity 2014-01-02 19:32:27 -08:00
Vinnie Falco
0ebe3f1f35 Disable NameResolver temporarily 2014-01-02 16:12:55 -08:00
Vinnie Falco
328680b6cd Fix Resolver contract check 2014-01-02 16:10:49 -08:00
Vinnie Falco
f9dca105a6 Improved async stop for Resolver
Conflicts:
	src/ripple_app/peers/NameResolver.cpp
2014-01-02 15:38:03 -08:00
Vinnie Falco
3664db61e7 Fix static storage duration issue with some Journal logs 2014-01-02 15:21:33 -08:00
Vinnie Falco
49677aa799 Fix RippleBookType and unit tests 2013-12-29 11:33:50 -08:00
NATTSiM
27b771e2ba Fix clang compile 2013-12-27 17:46:51 -08:00
Vinnie Falco
6527cdfa97 Add RippleAsset types
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2013-12-27 17:21:11 -08:00
JoelKatz
b2dbe8ef83 Ledger acquire fixes/cleanups/logging
* Inbound ledger and SHAMapAddNode cleanup
    * Log acquire stats
    * Fix progress logic
    * Remove ledgers we no longer need to acquire
    * Stash stale state data in our fetch pack, it can still be useful
    * Stash in fetch pack if acquire terminated while job was pending
    * Account for duplicate/invalid nodes in a few cases previously missed
    * Dispatch each InboundLedger once (not per data)
    * Trigger only the "best" peer
    * Don't call tryAdvance on failed acquires
2013-12-27 16:48:03 -08:00
NATTSiM
9bdb0774ad Make InboundLedgers, LedgerConsensus abstract 2013-12-27 16:48:03 -08:00
Vinnie Falco
8c2ec2cfbe Add AbstractObject, cyclic_iterator, Journal improvements 2013-12-27 16:47:43 -08:00
Wolfgang Spraul
00f959ab7e removed boost_random 2013-12-26 14:31:22 -08:00
Vinnie Falco
f9c4070ad3 Add FetchPack unit test 2013-12-22 12:57:44 -08:00
Vinnie Falco
074325a7ea Inject SHAMap missing node handler dependency 2013-12-22 12:38:07 -08:00
JoelKatz
2f521a6a91 Build fetch packs correctly. 2013-12-22 12:38:07 -08:00
sublimator
07959b3cc9 Allow to full network limit in Amount::isLegalNet 2013-12-20 15:44:03 -08:00
The Doctor
21faf8eaeb Improvements to initscript and default configuration.
* Added absolute paths to the [node_db] and [debug_logfile] stanzas in the config file.

* Changed some tabs into spaces for consistency.

* Added directory tree sanity checking to initscript.

Signed-off-by: The Doctor <drwho@virtadpt.net>
2013-12-20 15:38:30 -08:00
Nik Bougalis
3e2b5dcc3d Hostname resolution support for Peers 2013-12-19 14:50:03 -08:00
Nik Bougalis
88a8433d31 Add reference counting to AsyncObject 2013-12-19 14:39:26 -08:00
Vinnie Falco
81d418007a Add CollectorManager for Beast.Insight support 2013-12-16 18:08:11 -08:00
Vinnie Falco
f88fcf55a3 Add Beast.Insight stats collection module 2013-12-16 12:22:25 -08:00
Vinnie Falco
561c8dea08 Add stl module for c++11 compatibility classes 2013-12-16 11:35:21 -08:00
David Schwartz
de92ac9e0b Websocket improvements:
* Log on_close/on_fail/on_open calls.
* Ping out connections.
* Improve ping logic.
* On websocket ping out, close abnormally.
* Avoid deadlock when shutting down websocket endpoint
2013-12-16 09:40:15 -08:00
JoelKatz
deead04a6a getFetchPack fixes, spread fetch pack requests. 2013-12-15 07:20:24 -08:00
JoelKatz
d4771a9b36 Fix missing call to setPubLedger on gap in published ledger stream. 2013-12-13 11:14:34 -08:00
JoelKatz
27b8415d0c During old pathfinding, unlock earlier. 2013-12-12 21:17:25 -08:00
David Schwartz
e1e81e5d97 Call pendSaveValidated without holding the ledger master lock 2013-12-12 21:17:20 -08:00
Vinnie Falco
3705680d68 Disable RocksDB for older compilers 2013-12-10 11:23:06 -08:00
Vinnie Falco
a01f546ae3 Use ScopedPointer instead of deprecated auto_ptr 2013-12-10 14:14:15 -05:00
Bryce Lynch
eabc905bac Add Debian-style initscript
* Add validators and validation_quorum from the v0.16 release notes.
* We keep having to tell people to do this during integration, let's just make it the default.
* Add comment about the log file location that states that it has to be absolute rather than relative after an integration troubleshoot earlier today.

Signed-off-by: Bryce Lynch <bryce@ripple.com>
2013-12-09 16:21:22 -08:00
JoelKatz
37588b6808 Avoid an extraneous test. 2013-12-09 00:52:40 -08:00
JoelKatz
071db75f04 Add a 1 MB payload limit to incoming websocket requests 2013-12-09 00:52:40 -08:00
David Schwartz
1e00940a90 Move some ledger cleaner helper functions into the ledger master. 2013-12-08 23:53:57 -08:00
JoelKatz
b984566480 Suppress a warning. 2013-12-08 23:53:47 -08:00
JoelKatz
51aef120a1 Pathfinding performance improvements:
* Use a single RippleLineCache, even for 'fast' requests
* Use a ledger copy to avoid stalling other code
2013-12-08 23:52:54 -08:00
JoelKatz
636d722e8d Memory-conserving changes to SHAMapTreeNode and visitLeavesInternal. 2013-12-08 23:52:54 -08:00
Vinnie Falco
e6da61120a Make AbstractObject unit test manual 2013-12-06 09:57:03 -08:00
JoelKatz
b901e0dcf3 Fix load stats in get_info 2013-12-05 22:04:42 -08:00
Vinnie Falco
177b3c93c4 Move DecayingSample to algorithm 2013-12-05 18:35:37 -08:00
JoelKatz
9996e4a57e The new recommended fee schedule is:
* Transaction fee: 10 drops
* Base reserve: 20 XRP
* Incremental reserve: 5 XRP
2013-12-04 19:07:58 -08:00
JoelKatz
4751b6a65c Fix for issue 211, fixes to NetworkOPs getTxsAccountB 2013-12-04 17:09:22 -08:00
David Schwartz
b3c79f5c2f Change visitLeaves to visit a snapshot so the ledger stays unlocked 2013-12-04 11:10:27 -08:00
David Schwartz
0e53105ab5 Remove dead code and fix a race condition in the node back end.
Race was between a store and a fetch, as follows:
1) Fetch: Search for the node, it is not found.
2) Store: Add the node to the database, remove the node from the negative cache.
3) Fetch: Add the node to the negative cache.
This would leave a node in the DB, cache, and negative cache.
2013-12-04 11:10:22 -08:00
Vinnie Falco
0f2a657196 Add double conversion for PropertyStream map items 2013-11-30 17:56:25 -08:00
Vinnie Falco
89aa2c7a6a Refactor some Journal::Sink members 2013-11-30 17:32:50 -08:00
Vinnie Falco
4c843b6c66 IPAddress fixes and algorithm comparison functors 2013-11-30 09:21:46 -08:00
Vinnie Falco
130c7c5c58 Refactor and fix some object arithmetic comparisons 2013-11-30 06:28:29 -08:00
Vinnie Falco
76c364ec2d Add const now() 2013-11-30 01:42:38 -08:00
Vinnie Falco
a549c94a15 Fix missing assert in UnitTest runner 2013-11-30 01:42:37 -08:00
Vinnie Falco
6de8a6907f Add AbstractObject 2013-11-30 01:42:37 -08:00
Vinnie Falco
fc31562052 Tidy doc comments 2013-11-29 23:44:36 -08:00
Vinnie Falco
cdaa65c07a Remove LightningDB database and backend 2013-11-27 15:14:21 -08:00
Vinnie Falco
8a278cf9d6 Remove sophia database and backend 2013-11-27 15:09:26 -08:00
Vinnie Falco
97cecc18ce Set version to 0.19.2 2013-11-27 13:10:19 -08:00
JoelKatz
536db23e14 Fix foundResume check in account_tx 2013-11-27 12:25:45 -08:00
Vinnie Falco
39d801fb9f Merge branch 'release' into develop 2013-11-27 10:00:34 -08:00
Vinnie Falco
6d707b21b2 Set version to 0.19.1 2013-11-27 09:54:41 -08:00
JoelKatz
2316fe5bbe A better way to return an empty set if the token isn't an object. 2013-11-27 09:11:42 -08:00
JoelKatz
16ec9d2bdb Return an empty set if token is not an object 2013-11-27 08:54:49 -08:00
JoelKatz
2ce4ce4309 Begin deprecating the old account_tx interface. 2013-11-26 22:01:10 -08:00
JoelKatz
858c3a5362 Force NDEBUG in sqlite, RocksDB, and HyperLevelDB by default 2013-11-26 21:59:35 -08:00
JoelKatz
c124ad0dcd Add BEAST_SQLITE_FORCE_NDEBUG option 2013-11-26 21:56:17 -08:00
JoelKatz
ed64c8bb29 Add LedgerCleaner:
* Manually invoked to clean ledgers
* Get status with: 'print app.ledgercleaner.*'
* Invoke or control with 'ledger_cleaner' command
2013-11-26 21:50:35 -08:00
Vinnie Falco
2678360715 Set version to 0.19.0 2013-11-22 23:39:12 -08:00
JoelKatz
54e504dd5a Make --import work 2013-11-22 23:39:07 -08:00
JoelKatz
b632a6b2cf If the RocksDB base file size is changed, change the write cache and L0 size to match 2013-11-22 23:39:02 -08:00
Vinnie Falco
b9e2ac38fa Set version to 0.19.0 2013-11-22 23:36:50 -08:00
JoelKatz
4d1c2a5798 Make --import work 2013-11-22 18:01:13 -08:00
JoelKatz
c69d8a13b3 If the RocksDB base file size is changed, change the write cache and L0 size to match 2013-11-22 16:13:12 -08:00
Vinnie Falco
7c358cda17 Set version to 0.18.0 2013-11-22 15:57:59 -08:00
Vinnie Falco
1954a0eb2e Set version to 0.18.0 2013-11-22 15:57:41 -08:00
Vinnie Falco
5500701661 Fix Workers thread name 2013-11-22 15:51:20 -08:00
Vinnie Falco
21918922f4 Set background thread name 2013-11-22 15:51:20 -08:00
Vinnie Falco
fad52c5917 Comment out write to stdout 2013-11-22 15:51:20 -08:00
Vinnie Falco
306811d2a7 Add RocksDB NodeStore backend 2013-11-22 15:51:19 -08:00
Vinnie Falco
8b72f2ad79 Add rocksdb module 2013-11-21 18:31:15 -08:00
Vinnie Falco
1a1cb696f7 Make include paths relative 2013-11-21 16:59:54 -08:00
Vinnie Falco
582c17b06b Merge commit 'b156a49cff152fd52992a4823aaeafbaf70e564e' as 'src/ripple/rocksdb/rocksdb' 2013-11-21 16:24:10 -08:00
Vinnie Falco
b156a49cff Squashed 'src/ripple/rocksdb/rocksdb/' content from commit 56589ab
git-subtree-dir: src/ripple/rocksdb/rocksdb
git-subtree-split: 56589ab81f
2013-11-21 16:24:10 -08:00
Vinnie Falco
3943cfea06 Fix LevelDB Windows port 2013-11-21 15:00:57 -08:00
David Grogan
97346c6618 Upgrade LevelDB from 1.12 to 1.14:
* Fix issues 77, 87, 182, 190, 200, and 201

* Fix bug described in https://groups.google.com/d/msg/leveldb/yL6h1mAOc20/vLU64RylIdMJ

* Fix a bug where options.max_open_files was not getting clamped properly.

* Fix link to bigtable paper in docs.

* New sstables will have the file extension .ldb. .sst files will continue to be recognized.
2013-11-21 12:59:46 -08:00
JoelKatz
474b824902 Don't throw away an initial error when detecting the handshake. 2013-11-20 17:01:21 -08:00
David Schwartz
02b5572ccc Changes to support the ledger cleaner
* Rework ledger save return values to indicate errors to callers
* Add an extra function to support the ledger cleaner.
2013-11-20 12:22:45 -08:00
Vinnie Falco
4577ad60c7 Fix ResourceManager log output 2013-11-20 11:31:19 -08:00
JoelKatz
e683c380e5 Fix a defect in RangeSet. 2013-11-20 11:31:14 -08:00
Vinnie Falco
b660d82516 Make TxFormats a Meyers singleton 2013-11-20 10:16:46 -08:00
Nicholas Dudfield
c0dda06499 Parse STArray correctly in STObject::parseJson 2013-11-20 08:54:59 -08:00
Vinnie Falco
65abd6307d Update hyperleveldb module 2013-11-19 11:33:09 -08:00
Vinnie Falco
6e713dc3b8 Merge commit '596a35accad6e838e05180e79c1ea626eaf93a34' into develop 2013-11-19 11:32:55 -08:00
Vinnie Falco
596a35acca Squashed 'src/hyperleveldb/' changes from ac2ae30..25511b7
25511b7 Merge branch 'master' of github.com:rescrv/HyperLevelDB into hyperdb
ed01020 Make "source" universal
3784d92 Ignore the static file
507319b Don't package with snappy
3e2cc8b Tolerate -fno-rtti
4dcdd6e Drop revision down to 1.0.dev
2542163 Drop all but the latest kept for garbage reasons
9c270b7 Update .gitignore
5331878 Add upack script
adc2a7a Explicitly add -lpthread for Ubuntu
7b57bbd Strip NULL chars passed to LiveBackup
e3b87e7 Add write-buffer-size option to benchmark
2f11087 Followup to snappy support with -DSNAPPY
af503da Improve efficiency of ReplayIterator; fix a bug
33c1f0c Add snappy support
ce1cacf Fix a race in ReplayIterator
5c4679b Fix a bug in the replay_iterator
ca332bd Fix sort algorithm used for compaction boundaries.
d9ec544 make checK
b83a9cd Fix a deadlock in the ReplayIterator dtor
273547b Fix a double-delete in ReplayIterator
3377c7a Add "all" to set of special timestamps
387f43a Timestamp comparison and validation.
f9a6eb1 make distcheck
9a4d0b7 Add a ReplayIterator.
1d53869 Conditionally enable read-driven compaction.
f6fa561 16% end-to-end performance improvement from the skiplist
28ffd32 Merge remote-tracking branch 'upstream/master'
a58de73 Revert "Remove read-driven compactions."
e19fc0c Fix upstream issue 200
748539c LevelDB 1.13
78b7812 Add install instructions to README
e47a48e Make benchmark dir variable
820a096 Update distributed files.
486ca7f Live backup of LevelDB instances
6579884 Put a reference counter on log_/logfile_
3075253 Update internal benchmark.
2a6b0bd Make the Version a parameter of PickCompaction
5bd76dc Release leveldb 1.12

git-subtree-dir: src/hyperleveldb
git-subtree-split: 25511b7a9101b0bafb57349d2194ba80ccbf7bc3
2013-11-19 11:32:55 -08:00
Vinnie Falco
4ad84a339f Make LedgerMaster abstract 2013-11-18 15:04:17 -08:00
JoelKatz
833435f8c2 The 'ledger' RPC command should be considered high burden if 'full' is set. 2013-11-17 20:11:40 -08:00
JoelKatz
4e4942e357 Fix break logic in STObject::parseJson for arrays. 2013-11-16 18:57:08 -08:00
JoelKatz
1fc8f0a33b Missing break in STObject::parseJson for arrays. 2013-11-16 18:56:01 -08:00
Vinnie Falco
1f433dea97 Add ripple_app TODO 2013-11-15 18:39:07 -08:00
Vinnie Falco
d8707cad2c Refactor logging 2013-11-15 13:25:56 -08:00
Vinnie Falco
a399b571ac Journal API improvements 2013-11-15 12:30:01 -08:00
Vinnie Falco
d0e71225c4 Fix severity check on ~ScopedStream 2013-11-15 11:29:45 -08:00
Vinnie Falco
19d4bf0ea5 Add README and tidy up comments 2013-11-15 11:29:45 -08:00
Vinnie Falco
9e519af887 Add missing README and TODO for all new modules 2013-11-15 11:27:26 -08:00
JoelKatz
29aa462bfd Add more comments to the consensus code. 2013-11-14 22:41:34 -08:00
JoelKatz
7a91872ee5 Fix broken indentation around BOOST_FOREACH 2013-11-14 22:35:09 -08:00
JoelKatz
68307d1012 Functions like remote_endpoint().address() can throw 2013-11-14 11:20:35 -08:00
JoelKatz
48cb707bb6 Handle a missing ledger node discovered during pathfinding. 2013-11-14 11:20:16 -08:00
JoelKatz
9322233b37 Allow the SHAMap visitLeaves functions to sanely handle a missing map node. 2013-11-13 11:04:17 -08:00
JoelKatz
1daf1b9932 Use MultiSocket for websocket 2013-11-12 21:09:01 -08:00
JoelKatz
a3024352ba Pathfinding improvements. 2013-11-12 21:08:52 -08:00
David Schwartz
58f07a573f New ResourceManager for managing server load.
* Track abusive endpoints
* Gossip across cluster.
* Use resource manager's gossip support to share load reporting across a cluster
* Swtich from legacy fees to new Resource::Charge fees.
* Connect RPC to the new resource manager.
* Set load levels where needed in RPC/websocket commands.
* Disconnect abusive peer endpoints.
* Don't start conversations with abusive peer endpoints.
* Move Resource::Consumer to InfoSub and remove LoadSource
* Remove port from inbound Consumer keys
* Add details in getJson
* Fix doAccountCurrencies for the new resource manager.
2013-11-12 21:08:52 -08:00
Vinnie Falco
a05f33f6a7 Add annotation and clean up whitespace 2013-11-12 19:30:07 -08:00
Vinnie Falco
968624971f Add TestOverlay README 2013-11-12 09:18:11 -08:00
JoelKatz
57e77a5bd2 Use Ledger::visitStateItems to implement OrderBookDB::update 2013-11-11 21:31:18 -08:00
JoelKatz
74c65cfdc5 Cleanup path request logging. 2013-11-11 19:29:56 -08:00
JoelKatz
399760fda9 Assign each path finding request an ID and track its lifecycle. 2013-11-11 18:32:45 -08:00
Vinnie Falco
67b8f95b1e Add PeerFinder README doc 2013-11-10 15:51:29 -08:00
Vinnie Falco
d4d6acdf68 Add MSVC Output window Journal config setting
Conflicts:
	src/ripple/peerfinder/impl/Manager.cpp
	src/ripple/validators/impl/Manager.cpp
2013-11-10 15:06:05 -08:00
Vinnie Falco
472baa8bac Update README 2013-11-10 10:42:07 -08:00
Vinnie Falco
dd74c19858 Tidy up LoadMonitor stats API 2013-11-09 12:08:23 -08:00
Vinnie Falco
b5f8d447a0 Tidy up Resource::Manager APIs 2013-11-09 12:00:37 -08:00
JoelKatz
5f4a1917a6 Change how cluster load is computed from average-ish to median-ish. 2013-11-08 11:05:43 -08:00
JoelKatz
cf71680aee Don't return too many paths. 2013-11-08 11:05:05 -08:00
JoelKatz
f04b9131cc terNO_LINE should never be the final result of a payment transaction that can claim a fee. 2013-11-08 10:32:15 -08:00
JoelKatz
46861fac48 Don't allow a payment to take anything from an expired offer. 2013-11-08 10:17:12 -08:00
JoelKatz
4620b667e7 Fix a race condition if PathRequest::doCreate races with the path being processed. 2013-11-07 22:30:11 -08:00
Vinnie Falco
49f43ccc0a Set version to 0.17.0-rc5 2013-11-07 10:30:50 -08:00
Vinnie Falco
63aa7284c4 Disable peerfinder hooks 2013-11-07 09:59:28 -08:00
Patrick Dehne
286ade2d17 Beast improvements and vflib compatibility module work
* Add CallQueue vflib compatibility class
* Use run instead of run_one
* Merge BindableServiceQueue into CallQueue
* Take BEAST_VARIADIC_MAX into account
* Fix license headers as suggested by Vinnie
* Remove obsolete comment
* Add ManualServiceQueue
* Add ManualServiceQueue to beast_vflib include
* Move static unit test variables of header only classes to module cpp
* Remove no longer used mutex member
* _VARIADIC_MAX maxes out at 10
* Correctly apply BEAST_VARIADIC_MAX
* Merge BindableServiceQueue into CallQueue
* New GuiServiceQueue and its JUCE dependency
* Fix leftover merge errors
* Fix CallQueue unit test
* Don't use bassert for better CI support
2013-11-07 09:42:37 -08:00
Vinnie Falco
066d92ecfa Improve MultiSocket::ssl_handle 2013-11-07 09:35:04 -08:00
Vinnie Falco
c5ccabec38 Fix to use IPS from config 2013-11-06 06:19:06 -08:00
Vinnie Falco
548fedb859 Fix missing cstdlib 2013-11-06 06:19:02 -08:00
Nicholas Dudfield
8d5378a2ca Ensure no offers cancel each other out 2013-11-05 23:20:45 -08:00
David Schwartz
bf1843be9e Add "account_currencies" command. 2013-11-05 16:07:17 -08:00
David Schwartz
d50439cc4d doAccountLines cleanup. 2013-11-05 15:41:15 -08:00
Vinnie Falco
6a8f313394 Set version to 0.17.0-rc4 2013-11-05 14:41:49 -08:00
David Schwartz
c211094d3e Allow two trust lines to be created without reserve check. 2013-11-05 13:29:07 -08:00
Vinnie Falco
072b4f3b73 Set version to 0.17.0-rc3 2013-11-05 11:22:20 -08:00
Vinnie Falco
08cbcba4ee Fix warning 2013-11-05 03:23:15 -08:00
Vinnie Falco
2a9171c623 Improve hasher for IPAddress 2013-11-05 03:15:09 -08:00
Vinnie Falco
8573679fbb Fix compile error 2013-11-05 03:09:39 -08:00
Vinnie Falco
811f244fc2 Set boolalpha for Journal::ScopedStream 2013-11-05 03:09:39 -08:00
Vinnie Falco
a31b2556a3 Add ostream support for PropertyStream items 2013-11-05 03:09:39 -08:00
Vinnie Falco
a0ad5cdbfe Add to_string for asio endpoints 2013-11-05 03:09:39 -08:00
Nicholas Dudfield
59cf668348 Fix IPAddress::V4::Proxy 2013-11-05 03:02:20 -08:00
Stefan Thomas
09acc26c50 Fix marker being set for last result. 2013-11-03 22:39:55 -08:00
JoelKatz
0ae7bcff52 Fix the path filtering loop exit condition. 2013-11-03 17:20:10 -08:00
JoelKatz
2210dbac94 Don't abort the path filtering loop too early. 2013-11-03 16:37:35 -08:00
JoelKatz
6b2f654a30 Improve path filtering:
1) Ignore paths with very low liquidity
2) Allow an extra filling path to be added if needed
2013-11-03 02:20:18 -08:00
Vinnie Falco
3296ac5628 Turn off test URL in SiteFiles 2013-11-01 16:10:25 -07:00
Vinnie Falco
6d06cb29df Block until thread exits in manager dtors 2013-11-01 15:48:37 -07:00
Vinnie Falco
b08c7d15cd Stoppable, make stop() require call to start() 2013-11-01 13:31:38 -07:00
Vinnie Falco
940d620a96 Fix SiteFiles thread name 2013-11-01 10:34:35 -07:00
Vinnie Falco
a39fa8ae5f New SiteFiles for fetching and managing ripple.txt files 2013-10-31 08:10:06 -07:00
Vinnie Falco
f859bf160a Improve URL string conversions and ostream support 2013-10-31 08:10:06 -07:00
Vinnie Falco
e0512930ae Fix error parameter in HTTPClient logic 2013-10-31 08:10:06 -07:00
Vinnie Falco
7bbf6c553f Move ServiceQueueBase out of detail namespace 2013-10-31 08:10:05 -07:00
Vinnie Falco
aeb335ebdc Add hash function to URL 2013-10-31 08:10:05 -07:00
Vinnie Falco
73ab408b3c Move MurmurHash to beast 2013-10-31 08:10:04 -07:00
Vinnie Falco
f333a33f3d Make ServiceQueue::enqueue virtual 2013-10-31 08:10:04 -07:00
Nik Bougalis
42b841735e PeerFinder work 2013-10-29 20:52:57 -07:00
Vinnie Falco
e710bd2183 Use IPAddressConversion 2013-10-29 20:52:57 -07:00
Vinnie Falco
84556ba76a Add Bootstrap Strategy exposition 2013-10-29 20:52:56 -07:00
David Schwartz
4eebea91d3 DecayingSample::decay must always return with the time current. 2013-10-29 14:46:22 -07:00
JoelKatz
4ddadb8792 Correctly compute amount left on sell offer when a crossing offer pays us more than we asked for. 2013-10-28 16:48:47 -07:00
JoelKatz
8e65d6288d Fix limit calculation. 2013-10-28 07:24:01 -07:00
Justin Lynn
8e18deb74f disable e-mail notifications for travisCI 2013-10-25 17:48:20 -07:00
Justin Lynn
7ae1ad524b Merge branch 'develop' of github.com:ripple/rippled into develop 2013-10-24 19:11:17 -07:00
Justin Lynn
1ba1b3983a travis installs exuberant-ctags 2013-10-24 19:11:08 -07:00
Nicholas Dudfield
aabd6980ac Fix a bug in websocket-test.js referencing done() not declared in test() function signature, was causing failure of subsequent test suite, due to mocha's enveloped exception handling style 2013-10-24 19:03:03 -07:00
Nicholas Dudfield
3b19310252 Declarative path tests 2013-10-24 19:03:03 -07:00
Justin Lynn
8201805b28 explicitly use libboost 1.48 2013-10-24 18:53:38 -07:00
Justin Lynn
7277c8478b install dependencies when running travis ci 2013-10-24 18:47:18 -07:00
Justin Lynn
963a0dd934 initial travis yml file 2013-10-24 18:40:07 -07:00
JoelKatz
3108d58791 Fix typo. 2013-10-24 16:57:27 -07:00
Patrick Dehne
31b1a6a7e6 Add beast_vflib compatibility module and stand alone unit test app 2013-10-23 17:37:00 -07:00
JoelKatz
9ff65d0da4 Fix setting the no ripple flag when a trust line is created. 2013-10-23 17:24:34 -07:00
JoelKatz
c11abb42d1 Fix a case where 'sign' won't work in standalone mode. 2013-10-23 17:24:16 -07:00
Vinnie Falco
7b6d81d812 Measure CPU usage in Workers 2013-10-22 17:23:54 -07:00
Vinnie Falco
ca0daad11f Update notes 2013-10-22 12:59:56 -07:00
Vinnie Falco
a0c4e685c5 Add local_endpoint and remote_endpoint to MultiSocket 2013-10-22 12:33:11 -07:00
Nik Bougalis
b30f7a622c Set PEERS_MAX default value 2013-10-22 11:48:43 -07:00
Vinnie Falco
23f44f12bd Add IPAddressConversion and asio module 2013-10-22 11:45:30 -07:00
Nik Bougalis
6c17002e8a Peerfinder work 2013-10-22 10:43:17 -07:00
Vinnie Falco
5dda088335 Peerfinder work 2013-10-22 10:43:16 -07:00
Vinnie Falco
2427cce2c8 Rename to IPAddress and remove unused files 2013-10-22 10:43:16 -07:00
Nik Bougalis
1c41dae51c PeerFinder work 2013-10-22 10:43:15 -07:00
Vinnie Falco
1a6d72b14c Squelch spurious linker warning 2013-10-22 10:43:15 -07:00
Vinnie Falco
3dc646e03e Use serialized Context wrapper in Validators 2013-10-22 10:43:14 -07:00
Vinnie Falco
96328a8632 Add FixedPeers connection policy to peerfinder 2013-10-22 10:43:14 -07:00
Vinnie Falco
2cc4488d8e Fix crash in PropertyStream::find 2013-10-22 10:13:46 -07:00
wltsmrz
a6c2fe4761 Remove coffeescript compiler from mocha.opts until it is needed and added to dependencies 2013-10-21 17:54:36 -07:00
JoelKatz
ed905d3c3d Remove redundant code. 2013-10-21 15:06:05 -07:00
Vinnie Falco
81eadbd05c RelativeTime tidying 2013-10-20 15:31:50 -07:00
Patrick Dehne
ef1e2f8595 monotonicCurrentTimeInSeconds should return seconds, not milliseconds 2013-10-21 00:11:44 +02:00
Patrick Dehne
fae7082049 Wrap hiResCounterHandler in a function to prevent an order of initialization problems 2013-10-20 23:38:52 +02:00
Patrick Dehne
a63de23156 Rename millisecondsSinceStartup to monotonicCurrentTimeInSeconds 2013-10-20 23:37:24 +02:00
Patrick Dehne
8e0dda8480 #ifdef unneeded sys/prctl.h include in the mac build 2013-10-20 01:43:24 +02:00
Patrick Dehne
ad7b9ff8b5 Make fromStartup compile on mac 2013-10-20 01:38:59 +02:00
Vinnie Falco
04f2d0787a Merge commit '2ad98a025eb263d97b1942fc468937b4719becd8' into develop
Conflicts:
	src/beast/beast/utility/PropertyStream.h
	src/beast/beast/utility/impl/PropertyStream.cpp
	src/beast/modules/beast_sqlite/beast_sqlite.h
2013-10-19 15:57:15 -07:00
Vinnie Falco
2ad98a025e Squashed 'src/beast/' changes from 43e6d34..0e7bac9
0e7bac9 Fix include path
e5bb90f Fix constness of Proxy
ac0142a Use template cast
ef6e381 Add missing Url.h include
206e65c Fix constness of operator[]
695cc38 Use template instantiation for friend declaration
7b1e03a Add BaseFromMember
49bc04f Make List<>::Node not uncopyable
d5954ff Add Journal to UnitTest
58da106 Temporarily disable ServiceQueue dtor precondition asserts
fe58c1a Add missing #include
2c02580 Add PropertyStream for server state introspection
24c2315 Add ScopedWrapperContext
a3845f5 Add RelativeTime::value_type typedef
7442932 Fix missing PropertyStream members
ed5a98f More PropertyStream output for PeerFinder
fcfa10d Add PropertyStream
3cf0729 Tidy up AbstractHandler usage in HTTPClient
55171f4 Remove obsolete source files
1311ca3 Increase arity of SharedFunction
67d807d Add IPEndpoint::key_equal
ebf395e Add ErrorCode and boost library
2c3ead3 Add ServiceQueue::wrap
6c7f5d0 Move many Thread related classes
93e9d86 Measure CPU utilization in ServiceQueue
ca47d72 Move ServiceQueue, ThreadLocalValue, SpinLock
c864e4d Move WaitableEvent
ff305e6 Add CPUMeter and ScopedTimeInterval
01fd05c Add RecursiveMutex, UnlockGuard, TryLockGuard
5831a53 Remove Journal from most Stoppable overrides
b60a7f3 Add Request and Response HTTP parsers
44445ff Refactor net buffers classes
ac37c38 Beast class refactor
8b7056b Fix eof on HTTP client get
228b664 Remove obsolete beast container classes
1dfd655 Use RelativeTime from startup in DeadlineTimer
ae22d5d Add more methods to RelativeTime
c67929e Remove unhandled exception catcher
2472a90 Add 64 bit output for MurmurHash
f3d97c7 Add RelativeTime::fromStartup
b0b8660 IPEndpoint better parsing
ae551cd Add alternate form string parsing to IPEndpoint
d0a0dbf Don't break on Throw
0e46762 Add hasher functors for IPEndpoint
a1ec423 Add Thread::stopThreadAsync
4f7dca3 Add compiler, stdlib, and platform skeleton to beast/config
4394594 Tidy up some use of Error for throw
e5e0f52 Journal console output improvements
f07515e Add Stoppable prepare and start interfaces
d37dd46 Move RelativeTime to chrono, add ostream support
3f6e7aa Add console feature to Journal
ad0064a Journal option to write to Output window (MSVC)
0b7574b Add compilation test script
cc05ce1 Add ServiceQueue
e132aab Use boost for functional when the config is set
026b926 Fix is_continuation for boost version
c807a4e Fix invoked_type type reference
2ff781b Remove LockFreeStack::size
3acb474 Add SharedData::ConstAccess
7e4c834 Add LockFreeStack::empty
9c61a6d Added AbstractHandler, WrapHandler. HTTPClient Fixes.
94e40dc Fix unittest, by removing recursive call.
38bf408 Fix nonstandard C++ extension in getNullSink
1ef044d Build fixes
d5d3746 Fix missing <cmath> include for Gentoo
5f231d3 Update copyright notice and licenses
7b89bf6 Add FixedArray, IntrusiveArray, Crypto
5c5de57 Reorganize beast modules and files
9e18bb3 Merge commit '43deaaa5cf0d0178a4a6c3cb69c02a2a9a43ec7d' as 'src/beast/beast/http/impl/http-parser'
57703ac Fix BeforeBoost.h include
fbc247b Add Stoppable to beast
56496d8 IPEndpoint comparisons
9d9c822 Migrate some headers and general tidying
1a3cddc Add SharedArg and AsyncObject
373ca9c Add HTTPRequest and improvements to HTTPMessage parsing
9534516 Add some thread classes and fix SharedData with a simple mutex adapter
755ab36 Make CallQueue unit test runManual
c0ca037 Remove Beast version printing on startup
7efb6a3 Reorganize some MPL and Utility classes and files
69c26a1 Fix missing BeastConfig.h include in Net.cpp
40aa552 Disable Beast version printing in Ripple BeastConfig.h
7b1352d Add InterruptibleThread unit test
68cf759 ThreadWithCallQueue unit test adjustment
6501dea IPEndpoint parsing and tidying
72fc42b Move and add some template metaprogramming classes
2a164f0 Change filname capitalization (end)
6a14f25 Change filename capitalization
92fd417 Move integer types to beast/CStdInt.h
ebbd9ff Move TargetPlatform.h to beast/Config.h
874b524 Add IPEndpoint
14b34fc Tidy up some zlib macro undefines
34fffca Rename beast sources for consistency
4e59ab2 Add CallQueue unit test
327d7a6 Fixes for consolidated beast unity includes
d5ece4e Remove unused and broken classes
39f13be Remove unused ConcurrentObject
37624a7 Add ThreadWithCallQueue unit test
e82ec68 Remove obsolete beast_Function
90551a6 Temporarily leave sqlite3 in whatever threading mode it was already in.
43ebbb1 Fix SharedSingleton to use memoryBarrier
f343941 Tidy up SharedSingleton doc comments
001997e Fix leak on exit from Singleton dependency cycle
83b9d22 Rename to DeadlineTimer::cancel()
77874ee Use new instead of ::new for placement
2a04dcc Journal improvements
50965ca SharedFunction improvements
277e32b Add LockFreeStack iterators
d94e4c2 Fix undefined behavior in UnsignedIntegerCalc (again)
2dc25ce Fix DeadlineTimer, callback while holding lock
207ffde Fix undefined behavior in UnsignedIntegerCalc
1ad8ff9 Fix UnsignedInteger::isZero
1dd2836 Add support for multiprecision integer arithmetic and binary data encoding
a45fc47 Update .gitignore
962a95d Tidy up UnsignedInteger
ca695fa Add Time::isNull()
e96ce99 Better random number facilities in UnitTest
550b8e5 Fine tune UnsignedInteger declaration
8e7e3b7 Allow negative relative expirations in DeadlineTimer
f3dc7ce Add generic Journal class for logging
bfdda32 Make ChildProcess UnitTest manual since it malfunctions
02acf7d General refactoring of beast framework classes
84ef06e Fix ExitHook to derive from AtExitHook
f0acc9c Reduce the max threads in the Workers unit test
55447b0 New SharedSingleton, resolves destruction of objects with static storage duration.
41eb8a1 Remove deprecated SharedPtr::getObject
9eda4bc Make SharedObject members const, the counter mutable
6eda777 Remove deprecated createOnDemandOnce SingletonLifetime option
8c522aa Fix off by one in pending i/o count on HTTPClient
057344e Add HTTPMessage::toString and family
ee728e3 Add UniformResourceLocator::empty
ae324fb Move ./modules to ./src

git-subtree-dir: src/beast
git-subtree-split: 0e7bac945f
2013-10-19 15:54:21 -07:00
JoelKatz
67516766a6 Operations on the raw socket can throw exceptions if it's no longer connected. 2013-10-19 14:14:47 -07:00
Vinnie Falco
3b2ead3476 Turn off console output for msvc logic and managers 2013-10-18 16:29:13 -07:00
Vinnie Falco
fc5be2b911 Use DiscreteClock in ResourceManager 2013-10-18 16:04:37 -07:00
Vinnie Falco
466e623dd6 Add BaseFromMember 2013-10-18 16:04:37 -07:00
Vinnie Falco
a1b487c512 New Resource::Manager for controlling access to server resources 2013-10-18 16:04:31 -07:00
Vinnie Falco
0902af8eb5 Add DiscreteClock and sources 2013-10-17 17:46:23 -07:00
Vinnie Falco
a8a4caf0e4 Make List<>::Node not uncopyable 2013-10-17 17:46:18 -07:00
Vinnie Falco
33478517a6 Add Journal to UnitTest 2013-10-17 17:46:13 -07:00
Vinnie Falco
0d5a8ca300 Revert "Ported declarative path tests to mocha"
This reverts commit abe4f1ba03.
2013-10-17 11:11:06 -07:00
Vinnie Falco
da22f06d85 Revert "Make mocha use test/mocha.opts to DRY up options used by npm test and test/runall.sh and support coffee. Add coffee-script as devDependency to package.json"
This reverts commit 9dfbffa4b8.

Conflicts:

	test/mocha.opts
2013-10-17 11:10:48 -07:00
Vinnie Falco
a918924923 Temporarily disable ServiceQueue dtor precondition asserts 2013-10-16 15:59:04 -07:00
JoelKatz
5a9416fbcf Remove an assert that is not needed. 2013-10-16 13:47:54 -07:00
Vinnie Falco
582b5bb3ac Add --version command line option 2013-10-16 13:29:43 -07:00
Nicholas Dudfield
abe4f1ba03 Ported declarative path tests to mocha 2013-10-13 18:24:41 +07:00
Nicholas Dudfield
9dfbffa4b8 Make mocha use test/mocha.opts to DRY up options used by npm test and test/runall.sh and support coffee. Add coffee-script as devDependency to package.json 2013-10-13 15:38:04 +07:00
Vinnie Falco
a25ba91876 Set version to 0.17.0-rc2 2013-10-11 18:41:45 -07:00
Nik Bougalis
334f109415 Remove extraneous index from peerfinder map. 2013-10-11 18:36:34 -07:00
JoelKatz
eb9eb3aa53 Fix a crash in checkAccept 2013-10-11 16:13:16 -07:00
JoelKatz
978c196c78 Don't assert, just throw. 2013-10-08 15:48:15 -07:00
JoelKatz
20e7cac743 Reduce some logging. 2013-10-08 15:05:41 -07:00
Vinnie Falco
b5d51214ff Add missing #include 2013-10-07 14:26:26 -07:00
Vinnie Falco
485d4b4897 Fix order of includes 2013-10-07 14:24:13 -07:00
Vinnie Falco
fb6ecebbd1 Add PropertyStream for server state introspection 2013-10-07 14:00:03 -07:00
Vinnie Falco
0b69378a03 Update Json::Reader::decodeDouble 2013-10-07 02:49:03 -07:00
Vinnie Falco
256c12f150 Add ScopedWrapperContext 2013-10-06 19:46:42 -07:00
Nik Bougalis
8d0349eee0 Add RelativeTime::value_type typedef 2013-10-06 18:33:53 -07:00
Vinnie Falco
ab0548c9af Fix std::size_t integer ambiguity 2013-10-06 18:33:15 -07:00
Vinnie Falco
4868bc4df7 Validators PropertyStream support 2013-10-06 18:25:59 -07:00
Vinnie Falco
0900dfe46f Fix missing PropertyStream members 2013-10-06 18:25:53 -07:00
Vinnie Falco
8dfe53ff7a More PropertyStream output for PeerFinder 2013-10-06 17:30:45 -07:00
Vinnie Falco
1ae3328642 Add PropertyStream 2013-10-06 17:30:44 -07:00
JoelKatz
b9e0208aee Payment engine doesn't allow returning to XRP. 2013-10-06 15:52:16 -07:00
Vinnie Falco
497cc74adc Set version to 0.17.0-rc1 2013-10-06 11:35:47 -07:00
Vinnie Falco
eac3814fb5 Tidy up AbstractHandler usage in HTTPClient 2013-10-05 15:38:27 -07:00
Vinnie Falco
bb331abeba Remove obsolete source files 2013-10-05 13:08:39 -07:00
Vinnie Falco
6e20bd2dcd Increase arity of SharedFunction 2013-10-05 13:08:39 -07:00
Vinnie Falco
09961845b4 Remove obsolete AsyncService class 2013-10-05 13:08:38 -07:00
Vinnie Falco
7eacd3bf57 Add annotation for Validators 2013-10-05 12:03:51 -07:00
Vinnie Falco
72681fa7fb PeerFinder work 2013-10-05 11:59:17 -07:00
Vinnie Falco
500bddebff Allow CycledSet to grow without bounds 2013-10-05 02:46:23 -07:00
Vinnie Falco
4d3d46f41d Add IPEndpoint::key_equal 2013-10-05 02:41:29 -07:00
Vinnie Falco
82d8d9a092 PeerFinder work, Source fetch, show port in log 2013-10-04 23:22:56 -07:00
Vinnie Falco
30ff139a29 Add ErrorCode and boost library 2013-10-04 23:18:28 -07:00
Vinnie Falco
dc8420d32d LegacyEndpointCache work 2013-10-04 23:18:27 -07:00
Vinnie Falco
bb29c8ba85 Add PeerFinder::Checker for testing endpoints 2013-10-04 23:18:27 -07:00
Vinnie Falco
625780621b Add ServiceQueue::wrap 2013-10-04 23:18:26 -07:00
Vinnie Falco
ea2589dd9c PeerFinder work 2013-10-04 19:25:48 -07:00
Vinnie Falco
942336c454 Move many Thread related classes 2013-10-04 14:34:01 -07:00
Vinnie Falco
90282707ab Measure CPU utilization in ServiceQueue 2013-10-04 14:34:00 -07:00
Vinnie Falco
70f6c41ff7 Move ServiceQueue, ThreadLocalValue, SpinLock 2013-10-04 14:34:00 -07:00
Vinnie Falco
184cf74daa Move WaitableEvent 2013-10-04 14:33:59 -07:00
Vinnie Falco
a23fb06409 Add CPUMeter and ScopedTimeInterval 2013-10-04 14:33:59 -07:00
Vinnie Falco
3638485977 Add RecursiveMutex, UnlockGuard, TryLockGuard 2013-10-04 14:33:59 -07:00
Vinnie Falco
75f3c52d53 Validators work 2013-10-04 14:33:58 -07:00
Vinnie Falco
364973a523 Rename to key_equal for conformance with std containers 2013-10-04 14:33:58 -07:00
Vinnie Falco
678c241962 Validators work 2013-10-04 14:33:57 -07:00
Vinnie Falco
a2aa938e10 Remove Journal from most Stoppable overrides 2013-10-04 14:33:57 -07:00
Vinnie Falco
48eb92e366 Validators work 2013-10-04 14:33:56 -07:00
Vinnie Falco
2894059b63 Fix Peers to stop after children are stopped 2013-10-04 14:33:56 -07:00
Vinnie Falco
66a272debd Alphabet class for base58 conversions, Validators work 2013-10-04 14:33:56 -07:00
Vinnie Falco
7d089561c3 Add Request and Response HTTP parsers 2013-10-04 14:33:55 -07:00
Vinnie Falco
53f8e73b65 Refactor net buffers classes 2013-10-04 14:33:55 -07:00
JoelKatz
37bcf7899e Improve performance of some RPC ledger commands using visitors.
Adds SHAMap::visitLeaves and Ledger::visitStateItems
2013-10-04 11:50:22 -07:00
JoelKatz
86f662aa4a It is not longer necessary to invalidate the OrderBookDB 2013-10-04 02:33:33 -07:00
Vinnie Falco
a1b958eaac Validators update, add LeakChecked to Source subclasses 2013-10-03 19:03:38 -07:00
Vinnie Falco
06189b2584 Disable MSVC OutputWindow for PeerFinder 2013-10-03 19:03:10 -07:00
Vinnie Falco
0bf006cdae Beast class refactor 2013-10-03 19:03:10 -07:00
Vinnie Falco
3f51eb7b63 Fix eof on HTTP client get 2013-10-03 18:36:55 -07:00
Vinnie Falco
b76443dbde Use a simple Thread in SqliteDatabase 2013-10-03 18:36:54 -07:00
Vinnie Falco
5fc823ae08 Show Ripple version in BuildInfo unittest 2013-10-03 18:36:54 -07:00
Vinnie Falco
68aec74b47 Remove obsolete beast container classes 2013-10-03 18:36:53 -07:00
Vinnie Falco
acd23682d1 Use RelativeTime from startup in DeadlineTimer 2013-10-03 18:36:53 -07:00
Vinnie Falco
b042397b9f Add more methods to RelativeTime 2013-10-03 18:36:53 -07:00
David Schwartz
951a8208b8 Don't let OrderBookDB oscillate between two ledgers. 2013-10-03 17:49:38 -07:00
David Schwartz
9b3c74a095 Return the account checked if account_info finds no account. 2013-10-03 16:53:56 -07:00
David Schwartz
647c0e302a Do the tryLocal/addPeers operations on an InboundLedger without the collection lock. 2013-10-03 16:36:33 -07:00
David Schwartz
b3b22d7595 Nothing we do in doTx requires the master lock. 2013-10-03 10:55:42 -07:00
JoelKatz
1ba0139683 Claim saInRemaining. 2013-10-02 16:13:14 -07:00
Vinnie Falco
15ef435054 Set version to 0.16.0 2013-10-02 12:06:54 -07:00
Vinnie Falco
1a95dfb300 Refine Json unit test 2013-10-02 12:06:30 -07:00
Vinnie Falco
6962bdb325 Set version to 0.15.0 2013-10-02 12:02:01 -07:00
Vinnie Falco
bbbb8b1411 Fix buffer printing in json value to string 2013-10-02 11:59:32 -07:00
Vinnie Falco
0a5505f785 Add json parsing unit test 2013-10-02 11:53:18 -07:00
Vinnie Falco
b6d11c08d0 Set version to 0.14.0 2013-10-02 09:55:57 -07:00
Vinnie Falco
0f26fbd701 Set version to 0.14.0-rc3 2013-10-01 15:35:30 -07:00
Vinnie Falco
a236c81b5f Temporary fix on ENDPOINTS message hops=0 when no remote addr set 2013-10-01 15:35:06 -07:00
Vinnie Falco
73700a483d Set version to 0.14.0-rc2 2013-10-01 15:05:30 -07:00
Vinnie Falco
6062f6b036 Fix RippleAddress::clear 2013-10-01 15:05:03 -07:00
Vinnie Falco
e29b0b150d Set version to 0.14.0-rc1 2013-10-01 14:29:38 -07:00
Vinnie Falco
4fe63f9f0d PeerFinder work 2013-10-01 14:29:32 -07:00
Vinnie Falco
41879d8511 Remove obsolete mtANNOUNCE message support 2013-10-01 14:03:44 -07:00
Vinnie Falco
46d3ace6b7 Fix JobQueue to measure waiting and run times correctly 2013-10-01 12:25:02 -07:00
Vinnie Falco
2ac2fdfabd Remove unhandled exception catcher 2013-10-01 12:25:01 -07:00
Vinnie Falco
2aa5c74c2a Add 64 bit output for MurmurHash 2013-10-01 12:25:01 -07:00
Vinnie Falco
d624ed1151 Add RelativeTime::fromStartup 2013-10-01 12:25:00 -07:00
Vinnie Falco
9bc132778f Remove obsolete clean app exit configuration macro 2013-10-01 12:25:00 -07:00
Vinnie Falco
ac13c97f7e IPEndpoint better parsing 2013-10-01 12:25:00 -07:00
JoelKatz
26dfa9231a Clean up Sustain. 2013-10-01 11:18:41 -07:00
JoelKatz
072f2c93ef Do the initial work on new pathfinding requests without holding the master lock. 2013-10-01 11:06:32 -07:00
JoelKatz
14fb246b67 Handle mLedgersByIndex better. 2013-10-01 11:02:33 -07:00
JoelKatz
99e4335f00 Improve ledger performance by making sure we properly track the new LCL. 2013-10-01 11:02:33 -07:00
JoelKatz
ea1a5a77c5 Remove an obsolete comment. 2013-10-01 11:02:33 -07:00
JoelKatz
a815f455af Fix a possible buffer overflow. 2013-09-30 21:33:19 -07:00
JoelKatz
b2c46db006 Fix a bug that can cause servers to stick as 'syncing' for too long.
Add a sensible path to get to omFULL state when consensus is initiated by peer action.
2013-09-30 12:26:24 -07:00
Vinnie Falco
097b6f8e33 Add alternate form string parsing to IPEndpoint 2013-09-30 09:29:37 -07:00
Vinnie Falco
9aca3cb21c Don't break on Throw 2013-09-30 09:29:36 -07:00
Vinnie Falco
d1f589835c Add hasher functors for IPEndpoint 2013-09-30 09:29:36 -07:00
Vinnie Falco
27e8a71f08 Fix LoadManager stop 2013-09-30 09:29:34 -07:00
Vinnie Falco
db531d905c Add Thread::stopThreadAsync 2013-09-30 09:29:33 -07:00
Vinnie Falco
d27ad6251c Improve the display resolution of LoadMonitor samples 2013-09-30 04:07:14 -07:00
JoelKatz
217a017195 Reduce memory consumption while fetching. 2013-09-30 02:40:35 -07:00
JoelKatz
9350f3085d Better logging of ledger fetching. 2013-09-29 23:21:08 -07:00
JoelKatz
018a030d97 Clean this up and make it handle exceptions a bit more sanely. 2013-09-29 12:29:30 -07:00
JoelKatz
052fc7be22 'Throw' is for fatal throws only. Use 'throw' for non-fatal. 2013-09-29 12:19:15 -07:00
JoelKatz
9e0d7241eb Don't try to put transaction information in a fetch pack if there are no transactions in the target ledger. 2013-09-29 11:42:25 -07:00
JoelKatz
191e76a558 Fix a crash if a client requests an order book snapshot before we have a published ledger. 2013-09-29 11:34:07 -07:00
JoelKatz
511978b1eb Handle a partial ledger in fixMismatch 2013-09-29 07:08:00 -07:00
Vinnie Falco
6beb7996ff Fix LoadMonitor unit reporting for seconds from milliseconds 2013-09-29 02:48:26 -07:00
Vinnie Falco
c82b1b1853 Validators improvements 2013-09-28 19:47:40 -07:00
Vinnie Falco
a6ec4f91b0 Add compiler, stdlib, and platform skeleton to beast/config 2013-09-28 19:34:16 -07:00
Vinnie Falco
75c28f3951 Tidy up some use of Error for throw 2013-09-28 19:34:16 -07:00
Vinnie Falco
00a714d14d Implement Stoppable for LoadManager 2013-09-28 17:40:46 -07:00
Vinnie Falco
58a8a97177 Journal console output improvements 2013-09-28 16:42:16 -07:00
Vinnie Falco
97f1b41b4d Add more Validators journal reports 2013-09-28 15:30:02 -07:00
Vinnie Falco
8e58551475 Add Stoppable prepare and start interfaces 2013-09-28 15:30:01 -07:00
Vinnie Falco
e4fe965de0 Move RelativeTime to chrono, add ostream support 2013-09-28 15:09:12 -07:00
Vinnie Falco
3fefd43898 Add console feature to Journal 2013-09-28 15:09:12 -07:00
Vinnie Falco
d9f20436e8 Journal option to write to Output window (MSVC) 2013-09-28 15:09:11 -07:00
Vinnie Falco
9df86ec8fd Add compilation test script 2013-09-28 15:09:11 -07:00
Vinnie Falco
6602aff53d Update Validators for ServiceQueue 2013-09-28 15:09:10 -07:00
Vinnie Falco
3ec36929f1 Add ServiceQueue 2013-09-28 15:09:10 -07:00
Vinnie Falco
1f7d3d47a5 Use boost for functional when the config is set 2013-09-28 15:09:10 -07:00
Vinnie Falco
ab156cbcd1 Fix is_continuation for boost version 2013-09-28 15:09:09 -07:00
Vinnie Falco
4c43faec85 Fix invoked_type type reference 2013-09-28 15:09:09 -07:00
Vinnie Falco
2d2cd3aab1 Remove LockFreeStack::size 2013-09-28 15:09:08 -07:00
Vinnie Falco
c5f017739d Add SharedData::ConstAccess 2013-09-28 15:09:08 -07:00
Vinnie Falco
7437308bab Add AgedHistory.h 2013-09-28 15:09:07 -07:00
Vinnie Falco
fb6a0f10c3 Add LockFreeStack::empty 2013-09-28 15:09:07 -07:00
Vinnie Falco
d939c039f1 Added AbstractHandler, WrapHandler. HTTPClient Fixes. 2013-09-28 15:09:07 -07:00
Alex Dupre
c568988640 Add support for gcc 4.6 and ccache. 2013-09-28 20:26:16 +02:00
Alex Dupre
ca00a595c3 Fix unittest, by removing recursive call. 2013-09-28 20:25:41 +02:00
Alex Dupre
add0784ae2 Fix compile error. 2013-09-28 20:25:12 +02:00
Vinnie Falco
b2d84139a5 Merge pull request #165 from MarkusTeufelberger/develop
Add Arch Linux to SConstruct file
2013-09-28 06:32:54 -07:00
JoelKatz
13a09113ba Protect 'disconnect' from a dead weak pointer. 2013-09-27 20:00:18 -07:00
JoelKatz
9b28ad136b Remove some dead code and make sure we get full mutexes. 2013-09-27 14:40:36 -07:00
Vinnie Falco
cd9a4e6b57 Merge pull request #167 from wltsmrz/develop
Bump ripple-lib version
2013-09-27 12:49:32 -07:00
wltsmrz
f9596e1514 Bump ripple-lib version 2013-09-27 12:35:15 -07:00
Vinnie Falco
ac19affc11 Fix FreeBSD missing include 2013-09-27 07:45:48 -07:00
Vinnie Falco
0048efea8d Fixes for FreeBSD 2013-09-27 07:16:57 -07:00
Vinnie Falco
54dc7017e1 Fix Windows ProtectedCall handler to use ExitProcess 2013-09-27 05:20:32 -07:00
Vinnie Falco
beebfec3db Fix nonstandard C++ extension in getNullSink 2013-09-27 05:18:34 -07:00
Vinnie Falco
ae6e9e2790 Build fixes 2013-09-27 05:15:55 -07:00
Vinnie Falco
d1ec2eae83 Track run and wait times for load samples 2013-09-27 05:15:51 -07:00
Vinnie Falco
dd49eb4d65 Fix missing <cmath> include for Gentoo 2013-09-27 05:15:46 -07:00
MarkusTeufelberger
92d8a80b4e Add Arch Linux to SConstruct file 2013-09-27 05:15:40 -07:00
JoelKatz
48f815ff70 Handle negative saInSum earlier. 2013-09-27 03:29:15 -07:00
Vinnie Falco
948badc98b Set version to 0.13.0-rc5 2013-09-26 17:27:53 -07:00
JoelKatz
92bd8c4782 Missing return. 2013-09-26 17:14:55 -07:00
Vinnie Falco
5bebac7ecb Merge branch 'release' into develop 2013-09-26 15:58:58 -07:00
Vinnie Falco
efa05c5c58 Set version to 0.13.0-rc4 2013-09-26 15:57:48 -07:00
JoelKatz
2c7a846c3e Don't allow a transaction to spend into the greater of the fee or the reserve. 2013-09-26 15:50:46 -07:00
JoelKatz
d10dba6b2e Fix a case where the AcceptedLedger constructor throws 2013-09-26 15:19:26 -07:00
Vinnie Falco
d683b47dee Call std::exit for unhandled exceptions 2013-09-26 15:16:10 -07:00
JoelKatz
985af0e222 Fix a case where tryAdvance can throw. 2013-09-26 14:34:11 -07:00
JoelKatz
013520c9d4 Avoid acquiring the LedgerMaster lock in some hot code paths. 2013-09-26 13:44:40 -07:00
Vinnie Falco
00f5c9b34b Set version to 0.13.0-r3 2013-09-26 12:39:50 -07:00
Vinnie Falco
b4168392b7 Set version to 0.13.0-r3 2013-09-26 12:23:43 -07:00
JoelKatz
7cbe8572a3 Don't abort on a path that's dry because we entered with no funds. 2013-09-26 12:23:08 -07:00
JoelKatz
05a183e30a Make sizes more sensible 2013-09-26 12:23:04 -07:00
JoelKatz
2b37a4c7b0 Better tracking of resources associated with pathfinding. 2013-09-26 12:22:59 -07:00
JoelKatz
8cca807ea1 Don't abort on a path that's dry because we entered with no funds. 2013-09-26 11:49:18 -07:00
JoelKatz
4c3f059819 Make sizes more sensible 2013-09-26 11:05:15 -07:00
JoelKatz
18fc854bf3 Better tracking of resources associated with pathfinding. 2013-09-26 10:26:15 -07:00
MarkusTeufelberger
eff0271e7a Add Arch Linux to SConstruct file 2013-09-26 09:18:36 +02:00
Vinnie Falco
5888f55bdd Update LICENSE 2013-09-25 22:48:14 -07:00
Vinnie Falco
e62adfe4d4 Merge pull request #164 from wltsmrz/develop
Bump ripple-lib subversion
2013-09-25 18:58:33 -07:00
wltsmrz
6d19221e94 Bump ripple-lib subversion 2013-09-25 18:40:17 -07:00
Vinnie Falco
fcd689afbf Update copyright notice and licenses 2013-09-25 17:27:06 -07:00
David Schwartz
58a9a2cc07 Ripple Labs contributions are now open source. 2013-09-25 17:09:26 -07:00
David Schwartz
c226f9ecab Ripple Labs contributions are now open source. 2013-09-25 17:08:44 -07:00
Vinnie Falco
8f514c8e1b Merge branch 'release' into develop 2013-09-25 15:15:26 -07:00
Vinnie Falco
38ed0bee79 Update version number to 0.13.0-rc2 2013-09-25 14:42:53 -07:00
Vinnie Falco
a655662098 Disconnect WS connections when load exceeds threashold 2013-09-25 14:40:10 -07:00
David Schwartz
69dc722a7a Give mCompleteLedgers its own lock to avoid a deadlock. 2013-09-25 13:02:25 -07:00
Vinnie Falco
32a7f42557 Merge branch 'develop' into release
Conflicts:
	modules/ripple_app/basics/ripple_BuildInfo.cpp
	modules/ripple_app/misc/NetworkOPs.cpp
	modules/ripple_app/misc/NetworkOPs.h
	modules/ripple_core/functional/ripple_Config.h
	modules/ripple_core/functional/ripple_Job.cpp
	modules/ripple_core/functional/ripple_Job.h
	modules/ripple_core/functional/ripple_JobQueue.cpp
	modules/ripple_core/functional/ripple_JobQueue.h
2013-09-25 12:06:17 -07:00
Vinnie Falco
4a871a5726 Set version to 0.13-rc1 2013-09-25 11:46:42 -07:00
Vinnie Falco
909f4ffec9 Add BlackList.h to vs2012 project 2013-09-25 11:44:06 -07:00
Vinnie Falco
d163e80e77 More compatibility for IdentifierType 2013-09-25 11:44:06 -07:00
Vinnie Falco
9b22c810ef Validators Work
Conflicts:
	src/ripple_app/ledger/LedgerMaster.cpp
2013-09-25 11:44:05 -07:00
Vinnie Falco
426636f48d Add SimpleIdentifier traits for non-crypto identifiers 2013-09-25 11:44:04 -07:00
David Schwartz
3518a51d4a Make 'saaad' paths easier to find.
#   (use "git reset HEAD <file>..." to unstage)
2013-09-25 11:21:14 -07:00
David Schwartz
cca5c86673 Update the OrderBookDB if there's a jump in the published ledger stream. 2013-09-25 11:11:40 -07:00
David Schwartz
be828e834d Silly boost needs mutable locks. 2013-09-24 16:52:32 -07:00
David Schwartz
7e82612cd5 Improve test runner. 2013-09-24 16:52:21 -07:00
David Schwartz
8f4e722f73 Protect mRecentLedgers/mRecentTxSets with a mutex. 2013-09-24 16:46:25 -07:00
David Schwartz
ea11987609 Remove an obsolete comment. 2013-09-24 16:45:55 -07:00
David Schwartz
807b4fd659 "sxfad" path was missing from non-XRP to non-XRP (dif currency) list. 2013-09-24 16:06:33 -07:00
David Schwartz
ac90baa831 New test runner for Mocha 2013-09-24 16:01:43 -07:00
David Schwartz
794cd03b8f Don't process validations signed more than two minutes ago. 2013-09-24 15:47:56 -07:00
David Schwartz
2f77ca416a PEER_PRIVATE suppresses outbound connections to unconfigured peers. 2013-09-24 15:40:24 -07:00
David Schwartz
8b0df758f3 calcNodeAdvance fix. 2013-09-24 14:41:53 -07:00
wltsmrz
c76e2b54a9 Update system tests for mocha and new ripple-lib transaction submission 2013-09-24 14:12:18 -07:00
David Schwartz
01d7d7bed9 Fix deadlock in blacklist code. 2013-09-24 13:18:50 -07:00
David Schwartz
c3bb005324 Use whitelist. 2013-09-24 13:11:22 -07:00
JoelKatz
5d63086b69 Tie in blacklist code. 2013-09-24 13:00:11 -07:00
JoelKatz
f61caaae09 Initial import of IP blacklist code. 2013-09-23 14:07:16 -07:00
JoelKatz
d90c2c0e11 Fix erroneous 1-2 in complete ledgers. 2013-09-23 13:04:22 -07:00
Vinnie Falco
321898f71e Add CryptoIdentifierType and RippleCryptoIdentifier Traits 2013-09-23 10:13:25 -07:00
Vinnie Falco
1dd50f4422 Add FixedArray, IntrusiveArray, Crypto 2013-09-23 10:13:25 -07:00
Vinnie Falco
20b2e318eb Reorganize beast modules and files 2013-09-23 10:13:24 -07:00
Vinnie Falco
19eff08e16 Reorganize source files and modules 2013-09-23 10:13:21 -07:00
Vinnie Falco
43deaaa5cf Squashed 'src/beast/beast/http/impl/http-parser/' content from commit 547553b
git-subtree-dir: src/beast/beast/http/impl/http-parser
git-subtree-split: 547553b0909c9ce10a3730baeff7c7d1f76c0ea6
2013-09-23 09:54:31 -07:00
Vinnie Falco
2d65ab4021 Merge commit '43deaaa5cf0d0178a4a6c3cb69c02a2a9a43ec7d' as 'src/beast/beast/http/impl/http-parser' 2013-09-23 09:54:31 -07:00
JoelKatz
7c31a423e9 No ripple check takes precedence over destination check. 2013-09-22 21:22:14 -07:00
JoelKatz
dc61fadc56 If an account sets noRipple on a RippleState, it can only be used as the first link in the path. 2013-09-22 20:48:40 -07:00
JoelKatz
0d744cc253 Implement WSConnection::send to use the text version of the broadcast. 2013-09-22 15:55:36 -07:00
JoelKatz
1f372a3b08 Implement NoRipple transaction and trust line flags. 2013-09-22 15:14:47 -07:00
JoelKatz
b0c37d62fe Workaround tr1::functional bugs. 2013-09-22 15:14:31 -07:00
Vinnie Falco
e04dbdde19 Tidy up HTTPServer API and handle errors 2013-09-22 13:27:24 -07:00
Vinnie Falco
5bd6fb27e6 Split up RPCService 2013-09-22 13:27:23 -07:00
Vinnie Falco
b123b1a849 Fix using namespace beast directives 2013-09-22 13:22:07 -07:00
Vinnie Falco
d16aa7f928 Use JobQueue to process RPC-JSON asynchronously 2013-09-22 13:22:06 -07:00
Vinnie Falco
7dd41ffb5b Fix BeforeBoost.h include 2013-09-22 11:52:26 -07:00
Vinnie Falco
a2151bfa47 Split HTTP::Server to its own module 2013-09-22 11:52:26 -07:00
Vinnie Falco
0dc3cf07d0 Add HTTPServer 2013-09-22 11:52:22 -07:00
Vinnie Falco
ac1ebf403f Add Stoppable to beast 2013-09-22 11:51:46 -07:00
Vinnie Falco
5443e0f332 Lower the severity on JobQueue skip reporting 2013-09-22 11:51:46 -07:00
Vinnie Falco
5856730ec3 Fix objective-c ripple source 2013-09-22 11:51:45 -07:00
Vinnie Falco
ec6c09d995 Rename to Stoppable 2013-09-22 11:51:44 -07:00
Vinnie Falco
ec6ee6f3bd IPEndpoint comparisons 2013-09-22 11:51:44 -07:00
Vinnie Falco
dcbfa1524e Migrate some headers and general tidying 2013-09-22 11:51:44 -07:00
Vinnie Falco
51198c266f Add SharedArg and AsyncObject 2013-09-22 11:51:43 -07:00
Vinnie Falco
ed1a4b1283 Add HTTPRequest and improvements to HTTPMessage parsing 2013-09-22 11:51:43 -07:00
Vinnie Falco
0cbfc6079b Add some Validators RPC commands 2013-09-22 11:51:42 -07:00
Vinnie Falco
e59293ec92 Add RPCService, call the Manager from RPCServerHandler 2013-09-21 16:58:55 -07:00
Vinnie Falco
be1cede458 Add some thread classes and fix SharedData with a simple mutex adapter 2013-09-21 16:58:55 -07:00
Vinnie Falco
18d5021640 Make CallQueue unit test runManual 2013-09-20 01:12:21 -07:00
Vinnie Falco
85fc59b28b Refactor NodeStore, add NodeStoreSchedulerService 2013-09-20 01:12:21 -07:00
Vinnie Falco
63de1618e9 Remove Beast version printing on startup 2013-09-20 00:57:55 -07:00
Vinnie Falco
e3e72b3fc3 Split some framework classes into ripple_frame module 2013-09-19 21:52:21 -07:00
Vinnie Falco
5c84f75bd9 Reorganize some MPL and Utility classes and files 2013-09-19 21:37:47 -07:00
Vinnie Falco
b493db1d65 Split ripple_json to its own module 2013-09-19 20:54:12 -07:00
Vinnie Falco
c3b815004c Update TODO 2013-09-19 19:55:54 -07:00
Vinnie Falco
e6e090c542 Fixes for Service API hang on exit during unit tests 2013-09-19 19:41:55 -07:00
Vinnie Falco
fad8b0406e Remove MDB from timing test, increase timing test data size 2013-09-19 19:41:31 -07:00
Vinnie Falco
6d1796725b Add batch support to sophia backend 2013-09-19 19:41:31 -07:00
Vinnie Falco
a1596dd3d1 Merge branch 'feature-sophia' into develop
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2013-09-19 18:32:48 -07:00
Vinnie Falco
927332dc01 Fix missing BeastConfig.h include in Net.cpp 2013-09-19 18:25:01 -07:00
Vinnie Falco
cc77e4e9d8 Disable Beast version printing in Ripple BeastConfig.h 2013-09-19 18:22:18 -07:00
Vinnie Falco
86c868874a Add Sophia backend (http://sphia.org) 2013-09-19 18:16:41 -07:00
Vinnie Falco
89b1859929 Refactor Application shutdown using new Service, AsyncService interfaces 2013-09-19 17:18:43 -07:00
Vinnie Falco
97e961a048 Add InterruptibleThread unit test 2013-09-19 14:42:55 -07:00
Vinnie Falco
cc1fd7bc6a ThreadWithCallQueue unit test adjustment 2013-09-19 14:42:55 -07:00
Vinnie Falco
05b0e896aa IPEndpoint parsing and tidying 2013-09-19 14:42:55 -07:00
Vinnie Falco
2464607a09 Move and add some template metaprogramming classes 2013-09-19 14:42:54 -07:00
Vinnie Falco
776d934d66 Change filname capitalization (end) 2013-09-19 14:42:54 -07:00
Vinnie Falco
be6bd6c9fb Change filename capitalization 2013-09-19 14:42:53 -07:00
Vinnie Falco
53f7846d2b Move integer types to beast/CStdInt.h 2013-09-19 14:42:53 -07:00
Vinnie Falco
c733eb6e43 Move TargetPlatform.h to beast/Config.h 2013-09-19 14:42:52 -07:00
Vinnie Falco
11601bcccb Add IPEndpoint
Conflicts:
	src/beast/Builds/VisualStudio2012/beast.vcxproj.filters
2013-09-19 14:42:52 -07:00
Vinnie Falco
3ff8902481 Tidy up some zlib macro undefines 2013-09-19 14:42:52 -07:00
Vinnie Falco
d105f6a2bd Rename beast sources for consistency 2013-09-19 14:42:51 -07:00
Vinnie Falco
ed3be7a187 Add CallQueue unit test 2013-09-19 14:42:50 -07:00
Vinnie Falco
c8187e92af Consolidate beast unity sources into 2 ripple sources 2013-09-19 14:42:50 -07:00
Vinnie Falco
ec9ee5cc4b Fixes for consolidated beast unity includes 2013-09-19 14:42:49 -07:00
Vinnie Falco
ff674a32e2 Remove unused and broken classes 2013-09-19 14:42:49 -07:00
Vinnie Falco
f22e91cb9e Use Thread in LoadManager 2013-09-19 14:42:48 -07:00
Vinnie Falco
3efab6732f Remove unused ConcurrentObject 2013-09-19 14:42:48 -07:00
Vinnie Falco
7c39867d56 Clean up exit memory leaks in NodeStore 2013-09-19 14:42:47 -07:00
Vinnie Falco
237093dcd3 Add ThreadWithCallQueue unit test 2013-09-19 14:42:47 -07:00
Vinnie Falco
985db3fa16 Call protobuff::Shutdown to free dynamic data 2013-09-19 14:42:47 -07:00
Vinnie Falco
e2e8f85b3c Remove obsolete beast_Function 2013-09-19 14:42:46 -07:00
JoelKatz
29ec27c377 Temporarily leave sqlite3 in whatever threading mode it was already in. 2013-09-19 10:33:22 -07:00
wltsmrz
4109e51e30 Improvements to js tests and increment of the ripple-lib version 2013-09-18 17:36:34 -07:00
Vinnie Falco
604ca590b6 Fix SharedSingleton to use memoryBarrier 2013-09-17 17:58:21 -07:00
Vinnie Falco
feacf3ef13 Update LogJournal for new Journal interface 2013-09-17 17:47:07 -07:00
Vinnie Falco
9b76638351 Tidy up SharedSingleton doc comments 2013-09-17 17:47:06 -07:00
Vinnie Falco
aa89f46ae1 Fix leak on exit from Singleton dependency cycle 2013-09-17 17:47:06 -07:00
Vinnie Falco
0f60a503f6 Rename to DeadlineTimer::cancel() 2013-09-17 17:47:05 -07:00
Vinnie Falco
57f8328b0d Use new instead of ::new for placement 2013-09-17 17:47:05 -07:00
Vinnie Falco
f36fcf635c Journal improvements 2013-09-17 17:47:04 -07:00
Vinnie Falco
607520f2e6 SharedFunction improvements 2013-09-17 17:47:04 -07:00
Vinnie Falco
02cb0f0499 Add LockFreeStack iterators 2013-09-17 17:47:04 -07:00
Vinnie Falco
ee5c600e29 Fix undefined behavior in UnsignedIntegerCalc (again) 2013-09-17 17:47:03 -07:00
Vinnie Falco
ddb8268d5f Fix DeadlineTimer, callback while holding lock 2013-09-17 14:13:27 -07:00
Vinnie Falco
06e80ec522 Sophia fixes for relative includes 2013-09-17 12:29:52 -07:00
Vinnie Falco
94c77c38f4 Fix .gitignore for db dirs 2013-09-17 12:29:40 -07:00
Vinnie Falco
1a78d63f05 Don't forbid RPC clients who provide credentials when not required 2013-09-17 12:02:30 -07:00
Vinnie Falco
a602eb3b5d Add ripple_sophia module 2013-09-17 11:35:17 -07:00
Vinnie Falco
fb9fc26e58 Merge commit 'c58450a44b3fed6ace9f5197f504e6b2f248a5e7' as 'src/sophia' 2013-09-17 10:09:27 -07:00
Vinnie Falco
c58450a44b Squashed 'src/sophia/' content from commit 9d29b94
git-subtree-dir: src/sophia
git-subtree-split: 9d29b94cd66d3bd67082642b9a1f6dea470f0730
2013-09-17 10:09:27 -07:00
Vinnie Falco
76f62bd7c5 Fix undefined behavior in UnsignedIntegerCalc 2013-09-16 18:47:35 -07:00
JoelKatz
007723236e Change the way the OrderBookDB is updated to prevent hangs. 2013-09-16 18:27:25 -07:00
JoelKatz
74b2d1f3fa Pass a bool to the describer telling it if the directory is new. 2013-09-16 18:12:21 -07:00
JoelKatz
b45b029ba7 Whitespace changes only 2013-09-16 18:05:25 -07:00
JoelKatz
fd59422a22 Fixes to tryAdvance logic. 2013-09-15 13:29:52 -07:00
Vinnie Falco
1f892029f8 Remove extraneous shell script 2013-09-13 18:55:10 -07:00
Vinnie Falco
846b8e339c Tidy and rename all Ripple source files 2013-09-13 16:58:24 -07:00
Vinnie Falco
5be3a1a34d Fix UnsignedInteger::isZero 2013-09-13 13:06:45 -07:00
Vinnie Falco
c631cc5f92 Persistence for Validators 2013-09-13 12:43:54 -07:00
Vinnie Falco
9b40bc6835 Add support for multiprecision integer arithmetic and binary data encoding 2013-09-13 12:43:43 -07:00
Vinnie Falco
b79ede018d Update .gitignore 2013-09-12 23:58:56 -07:00
Vinnie Falco
3b82c0b1a1 Tidy up UnsignedInteger 2013-09-12 23:58:56 -07:00
Vinnie Falco
0e4c865853 Add Time::isNull() 2013-09-12 23:58:55 -07:00
Vinnie Falco
d67e38fa85 Better random number facilities in UnitTest 2013-09-12 21:39:17 -07:00
Vinnie Falco
817a0256d2 Fine tune UnsignedInteger declaration 2013-09-12 19:18:31 -07:00
Vinnie Falco
36e88a25f6 Allow negative relative expirations in DeadlineTimer 2013-09-12 18:07:57 -07:00
Vinnie Falco
0d2344c9a6 Validators work 2013-09-12 16:30:45 -07:00
Vinnie Falco
b839ae0552 Refactor Log code, add LogJournal adapter 2013-09-12 15:06:28 -07:00
Vinnie Falco
5038a65acd Add generic Journal class for logging 2013-09-12 15:06:28 -07:00
Vinnie Falco
ec3c4ff77a Reduce scope of Application object lifetime 2013-09-12 10:55:25 -07:00
Vinnie Falco
6a84f73d2a Make ChildProcess UnitTest manual since it malfunctions 2013-09-12 10:55:24 -07:00
Vinnie Falco
681f98ad07 General refactoring of beast framework classes 2013-09-12 10:55:24 -07:00
Vinnie Falco
8c1c7b48bb Fix ExitHook to derive from AtExitHook 2013-09-12 10:55:17 -07:00
Vinnie Falco
7f61499d3a Reduce the max threads in the Workers unit test 2013-09-12 05:46:45 -07:00
Vinnie Falco
3550a21294 New SharedSingleton, resolves destruction of objects with static storage duration. 2013-09-12 05:38:39 -07:00
Vinnie Falco
048dcf8a3c Remove deprecated SharedPtr::getObject 2013-09-12 04:47:03 -07:00
Vinnie Falco
89bc2bbc6f Remove debug output for URL Validators Source 2013-09-12 04:47:03 -07:00
Vinnie Falco
db30bfe352 Make SharedObject members const, the counter mutable 2013-09-12 04:47:03 -07:00
Vinnie Falco
baa0b474ba Remove deprecated createOnDemandOnce SingletonLifetime option 2013-09-12 00:43:05 -07:00
Vinnie Falco
a76672c5f0 Split Log singleton code out into LogInstance 2013-09-11 22:42:40 -07:00
Vinnie Falco
0079c9070d Turn RIPPLE_APPLICATION_CLEAN_EXIT back on, to prevent file descriptor leaks 2013-09-11 22:03:59 -07:00
Vinnie Falco
e1e8744052 Fix empty Config paths for unit test 2013-09-11 21:48:43 -07:00
Vinnie Falco
f0231af0c0 Fix off by one in pending i/o count on HTTPClient 2013-09-11 21:40:17 -07:00
Vinnie Falco
9e6e7b5dd9 Add comments to the .proto file 2013-09-11 20:52:42 -07:00
Vinnie Falco
a48bcfeddb Migrate validators and testoverlay to the new style of source organization 2013-09-11 20:05:56 -07:00
Vinnie Falco
fb804bd1bd More Validators implementation 2013-09-11 20:05:55 -07:00
Vinnie Falco
43d386fa6e Add HTTPMessage::toString and family 2013-09-11 20:04:23 -07:00
Vinnie Falco
68422ed5b4 Add UniformResourceLocator::empty 2013-09-11 19:58:11 -07:00
Vinnie Falco
03b8ae742e Small refactor to Config paths 2013-09-11 19:58:10 -07:00
Vinnie Falco
99afec18c5 Update protoc.py for new src directories 2013-09-11 11:47:58 -07:00
Vinnie Falco
27f0cae812 Add PeerFinder peer discovery logic and unit test 2013-09-11 11:47:58 -07:00
Vinnie Falco
45eccf2ccf Move ./modules to ./src 2013-09-11 11:20:53 -07:00
Vinnie Falco
6d828ae476 Update README 2013-09-11 10:44:10 -07:00
Vinnie Falco
1b6761286f Merge commit '112234c8a911de4243eaab3eb6a37ce6df014880' as 'src/protobuf' 2013-09-11 10:40:46 -07:00
Vinnie Falco
112234c8a9 Squashed 'src/protobuf/' content from commit d6e20ba
git-subtree-dir: src/protobuf
git-subtree-split: d6e20baabb84501c720b6e42170684264bd2cdd2
2013-09-11 10:40:46 -07:00
Vinnie Falco
ae1daafd44 Remove old protobuf subtree in preparation for git subtree add 2013-09-11 10:40:37 -07:00
Vinnie Falco
255e5eedf6 Update README for protobuf 2013-09-11 10:31:13 -07:00
Vinnie Falco
0c6c9774a9 Update project files for new directory layout 2013-09-11 10:22:46 -07:00
Vinnie Falco
a04fa04d07 Update project files for new directory layout 2013-09-11 10:08:35 -07:00
Vinnie Falco
03174a0d6a Tidy up root of the repository 2013-09-11 10:04:32 -07:00
Vinnie Falco
10d88114e4 Remove old Subtrees directory 2013-09-11 10:01:06 -07:00
Vinnie Falco
7238e23e8a Merge commit '128e6a412506a0f152385a107aa8801e484a8c60' as 'src/websocket' 2013-09-11 09:58:50 -07:00
Vinnie Falco
128e6a4125 Squashed 'src/websocket/' content from commit b439cd1
git-subtree-dir: src/websocket
git-subtree-split: b439cd1ee99f319eb1464f7b44923ce96245735d
2013-09-11 09:58:50 -07:00
Vinnie Falco
3e4833acca Merge commit '1148b422d5e758e18e230d792bad30ff29630c7f' as 'src/mdb' 2013-09-11 09:58:41 -07:00
Vinnie Falco
1148b422d5 Squashed 'src/mdb/' content from commit 1eb7f66
git-subtree-dir: src/mdb
git-subtree-split: 1eb7f6695947efe1c05e83446479368e8d360d4b
2013-09-11 09:58:41 -07:00
Vinnie Falco
c6b5ccdd22 Merge commit '627114b1acdc785cce9caab8bac9b6ad90917be5' as 'src/leveldb' 2013-09-11 09:58:34 -07:00
Vinnie Falco
627114b1ac Squashed 'src/leveldb/' content from commit f851425
git-subtree-dir: src/leveldb
git-subtree-split: f851425b14fc9bcf47d0ca938986bcd0457ad5db
2013-09-11 09:58:34 -07:00
Vinnie Falco
e8893e9678 Squashed 'src/hyperleveldb/' content from commit ac2ae30
git-subtree-dir: src/hyperleveldb
git-subtree-split: ac2ae3029dd9c4ed6401c57eef7e1d84b2007bca
2013-09-11 09:58:13 -07:00
Vinnie Falco
809a2ce7bf Merge commit 'e8893e96780685b9e39447199d946739e565fef5' as 'src/hyperleveldb' 2013-09-11 09:58:13 -07:00
Vinnie Falco
86ba8ffca6 Squashed 'src/beast/' content from commit 43e6d34
git-subtree-dir: src/beast
git-subtree-split: 43e6d345e4
2013-09-11 09:57:14 -07:00
Vinnie Falco
fe18b54d20 Merge commit '86ba8ffca6a6399bb19861e1cd826ec792a33651' as 'src/beast' 2013-09-11 09:57:14 -07:00
Vinnie Falco
9812d69aa2 General beast update, fixes, optimizations, features:
* Clean ups, optimizations, and new File::commonDocumentsDirectory enum
* Replace sortArray with std::sort for performance
* More error tolerance in XML parser, speedups
* Refactor some byte-order mark detection code
* Add String::appendCharPointer overloads
* More XML parser optimisations and better error detection
* Misc performance tweaks
* Fixes for support of non utf8 strings
* Increased precision when storing strings in XmlElement
* Minor clean-ups
* Minor fix to XmlDocument
* Cleanups to CriticalSection and related synchronization primitives
* Fix DynamicArray unit test
2013-09-10 10:36:46 -07:00
Vinnie Falco
b5e1a600a1 Use SharedFunction in ProtectedCall 2013-09-10 08:04:54 -07:00
Vinnie Falco
8bdfa860ee Put back BEAST_CATCH_UNHANDLED_EXCEPTIONS macro, but disabled by default 2013-09-10 08:04:46 -07:00
Vinnie Falco
7f84f44a74 Update to SQLite 3.8.0.2 2013-09-10 07:45:34 -07:00
JoelKatz
6234f0040d 0.12.1-alpha.1 2013-09-09 18:36:00 -07:00
JoelKatz
1b18e16d1f Track consensus versus validated ledgers and log discrepancies. 2013-09-09 18:27:05 -07:00
Vinnie Falco
51332a91b9 Remove RIPPLE_PEER_USES_BEAST_MULTISOCKET configuration setting 2013-09-09 14:12:58 -07:00
Vinnie Falco
c063b940bb Add RIPPLE_APPLICATION_CLEAN_EXIT option to BeastConfig.h 2013-09-09 13:45:37 -07:00
Vinnie Falco
3c23699a87 Remove BEAST_CATCH_UNHANDLED_EXCEPTIONS 2013-09-09 13:34:18 -07:00
Vinnie Falco
00caefc1c3 Move ripple.pb.cc to VS2012 project so it rebuilds as needed 2013-09-09 12:56:59 -07:00
Vinnie Falco
6be6e68165 Tidy up the root of the repository a bit 2013-09-09 11:09:47 -07:00
Vinnie Falco
8866c2dc1f Pass .cfg validators entries to Validators logic 2013-09-09 10:50:36 -07:00
Vinnie Falco
adb6c39b92 Make UnsignedInteger HashFunction a unary function object 2013-09-09 10:50:35 -07:00
Vinnie Falco
955a791ab1 Improvements to BuffersType 2013-09-09 10:50:35 -07:00
Vinnie Falco
6c32b174e8 Tune HashMap parameters 2013-09-09 10:28:10 -07:00
Vinnie Falco
bbc9e886dd Add ValidatorsUtilities common code 2013-09-09 10:28:10 -07:00
Vinnie Falco
e1f80ef6a6 Rename to IsCond<> 2013-09-09 10:28:09 -07:00
JoelKatz
a4e81fb6ad Fix some performance problems with the new ledger master code. 2013-09-09 02:02:23 -07:00
JoelKatz
d3159aba88 Reject a non-positive destination amount immediately. 2013-09-09 01:30:39 -07:00
JoelKatz
afd22025d7 No need to compare a transaction set to itself. 2013-09-08 14:09:49 -07:00
JoelKatz
fd6e0e788e Don't include a non-XRP order book if we've already seen the issuer's account in the currency. 2013-09-08 13:41:55 -07:00
JoelKatz
cb8ba44f62 Mark some issues in the RPCServerHandler and add a temporary workaround. 2013-09-08 00:06:35 -07:00
Vinnie Falco
140be155f2 Defer DeadlineTimer callback until the lock is released 2013-09-07 21:20:13 -07:00
JoelKatz
68547c328e Handle a case of missing ledger nodes sanely. 2013-09-07 18:06:40 -07:00
JoelKatz
3174372081 Remove an erroneous comment. 2013-09-07 18:06:34 -07:00
Vinnie Falco
eaec90c897 Disable gcc warning for KeyvaDB 2013-09-07 11:57:53 -07:00
Vinnie Falco
1d1587c2ac Add HTTPClientType and HTTPMessage related helpers 2013-09-07 11:53:38 -07:00
Vinnie Falco
4a30b259b2 Tidy up contract checks in InterruptibleThread 2013-09-07 11:53:38 -07:00
Vinnie Falco
e927160ff5 Disable exception catching in unit tests 2013-09-07 11:53:37 -07:00
Vinnie Falco
aac657a2e6 Add ContentBodyBuffer 2013-09-07 11:53:37 -07:00
Vinnie Falco
8c2f9e7388 Fix incorrect whitespace in macro argument list 2013-09-07 11:53:36 -07:00
Vinnie Falco
c8cedfc06e Add SharedFunction to replace boost::function 2013-09-07 11:53:36 -07:00
Vinnie Falco
6be9c41064 Update programming by contract macros 2013-09-07 11:53:36 -07:00
Vinnie Falco
62ffbc97ba Add BEAST_MOVE_* macros 2013-09-07 11:53:35 -07:00
Vinnie Falco
0bbad54a36 Add Debug unit test to check bassert behavior 2013-09-07 11:53:35 -07:00
Vinnie Falco
044e3b09db Add StringPairArray::swapWith 2013-09-07 11:53:34 -07:00
Vinnie Falco
d6a12f791f Add UniformResourceLocator and ParsedURL 2013-09-07 11:53:34 -07:00
Vinnie Falco
bf2af27452 Rename boost_asio files 2013-09-07 11:53:34 -07:00
Vinnie Falco
98f1169ac3 Add http-parser to boost_asio 2013-09-07 11:53:33 -07:00
Vinnie Falco
816b3a4efb Remove unused Validator files 2013-09-07 11:53:33 -07:00
Vinnie Falco
941503c564 Use destroy() override instead of ContainerDeletePolicy for SharedObject 2013-09-07 11:53:32 -07:00
JoelKatz
e513380e08 Remove obsolete information. 2013-09-06 23:29:30 -07:00
Vinnie Falco
a050ba6fa4 Fix DeadlineTimer for InterruptibleThread::wait timeout 2013-09-06 21:45:41 -07:00
Vinnie Falco
3594c3b290 Fix DeadlineTimer for InterruptibleThread::wait timeout 2013-09-06 21:44:53 -07:00
Vinnie Falco
8d15b4059d Make bassert fatal 2013-09-06 21:29:16 -07:00
Vinnie Falco
403e2247a2 Add missing limit for jtUNL jobs 2013-09-06 21:29:15 -07:00
Vinnie Falco
ddcbb9c38c Fix SharedPtr commit bug again 2013-09-06 21:25:55 -07:00
Vinnie Falco
4b7b5a41a2 Fix reference count bug in SharedPtr container 2013-09-06 20:18:25 -07:00
JoelKatz
b921791b34 Old path finding aggressiveness check was backwards. 2013-09-06 12:49:20 -07:00
Vinnie Falco
a690c579c1 Merge commit '60d5ca452314e0131993e1adcc004394fb64eed2' as 'Subtrees/beast/modules/beast_asio/parsehttp' 2013-09-06 12:46:39 -07:00
Vinnie Falco
60d5ca4523 Squashed 'Subtrees/beast/modules/beast_asio/parsehttp/' content from commit 547553b
git-subtree-dir: Subtrees/beast/modules/beast_asio/parsehttp
git-subtree-split: 547553b0909c9ce10a3730baeff7c7d1f76c0ea6
2013-09-06 12:46:39 -07:00
Vinnie Falco
de7e3c578e Remove incorrect parsehttp subtree path 2013-09-06 12:46:23 -07:00
Vinnie Falco
f48c2c24b6 Merge commit 'ef544b108f8979e4622bd27657c9e93271b461fc' as 'Subtrees/beast/beast_asio/parsehttp' 2013-09-06 12:44:36 -07:00
Vinnie Falco
ef544b108f Squashed 'Subtrees/beast/beast_asio/parsehttp/' content from commit 547553b
git-subtree-dir: Subtrees/beast/beast_asio/parsehttp
git-subtree-split: 547553b0909c9ce10a3730baeff7c7d1f76c0ea6
2013-09-06 12:44:36 -07:00
JoelKatz
7abfd354f8 New improved Pathfinding engine 2013-09-06 12:35:13 -07:00
JoelKatz
65009c77a7 Raise default optimization level to 1. 2013-09-06 11:49:34 -07:00
JoelKatz
2d9d00c2ef Tiny bugfix. 2013-09-06 11:49:34 -07:00
JoelKatz
12495f0e65 Suppress a warning. 2013-09-06 11:49:34 -07:00
Vinnie Falco
e6e2873b4f Reformat, reorganize rippled-example.cfg and include the missing undocumented settings 2013-09-06 11:13:41 -07:00
Stefan Thomas
de210fef95 Simplify new account_tx API. 2013-09-06 06:49:27 -07:00
Stefan Thomas
89748aad37 Fix typo breaking resume functionality. 2013-09-06 06:49:22 -07:00
JoelKatz
aa64bdc41c Fix account_tx 2013-09-05 20:05:22 -07:00
Vinnie Falco
abcb1dce57 Switch back to mutex for JobQueue 2013-09-05 19:47:12 -07:00
Vinnie Falco
5db25ede25 Add LoanedObject container example unit test 2013-09-05 19:47:11 -07:00
JoelKatz
55015f2730 TxsAccount fix. 2013-09-05 19:44:33 -07:00
JoelKatz
9f87e36545 Only update order book DB every ten ledgers
The order book DB code should be change to update on creation of order books rather than rescan.
2013-09-05 13:08:51 -07:00
Vinnie Falco
f1522b8fef Fix using-statements for older gcc without c++11 2013-09-05 06:55:50 -07:00
Vinnie Falco
4819714edf Fix non c++11 gcc build errors 2013-09-05 06:04:20 -07:00
Vinnie Falco
eac898a26f Fix compile error on configs with c++11 move support 2013-09-05 05:08:41 -07:00
Vinnie Falco
e892e9bb4e Replace obsolete OncePerSecond with DeadlineTimer 2013-09-05 04:38:18 -07:00
Vinnie Falco
e26a3a1d84 New TestOverlay generic peer to peer network tests 2013-09-05 04:38:17 -07:00
Vinnie Falco
5a06121a85 New ContainerTest generic templates 2013-09-05 04:22:27 -07:00
Vinnie Falco
a29ced1feb Activate MSVC leak report on exit with a configuratble BeastConfig setting 2013-09-05 04:22:27 -07:00
Vinnie Falco
bcd6e9d676 Refactor SharedPtr and fix ContainerDeletePolicy bug 2013-09-05 04:22:26 -07:00
Vinnie Falco
6c267d6388 Add HashMap unit test 2013-09-05 04:22:25 -07:00
Vinnie Falco
02107c3023 Add new-styled Intrusive and MPL modules 2013-09-05 04:22:25 -07:00
Vinnie Falco
1277f70c47 Use MultiSocket and strand in Peer 2013-09-04 17:03:13 -07:00
Vinnie Falco
8e75064fe3 Fix bug and tidy up DeadlineTimer 2013-09-04 15:17:22 -07:00
Vinnie Falco
cca092f5d1 Add compile time option for new Validators code 2013-09-04 13:51:55 -07:00
Vinnie Falco
d71211185e Fix String from number conversions 2013-09-04 13:24:41 -07:00
David Schwartz
c95211e572 Change tx_account to an account_tx switch. 2013-09-04 12:48:47 -07:00
Vinnie Falco
57d55cebe4 Move UNL timer processing to the JobQueue 2013-09-04 11:55:38 -07:00
David Schwartz
0950ef3984 Mark something that should be fixed. 2013-09-04 10:07:16 -07:00
Vinnie Falco
91e0cc84ef Validators framework and unit test 2013-09-03 08:31:17 -07:00
Vinnie Falco
2e1167fbd9 Added DynamicArray, DynamicList, and HashMap 2013-09-03 08:31:16 -07:00
Vinnie Falco
5aa784922f Update TODO Files 2013-09-02 18:03:44 -07:00
JoelKatz
c06aa4ff55 Cleanups, extra logging, and catch a case where a disputed transaction structure may not get created. 2013-09-02 06:08:11 -07:00
Vinnie Falco
b1d029e5b7 Fix VS2012 project file 2013-09-01 12:34:04 -07:00
Vinnie Falco
649b20a5f2 Move NodeStore and backends to ripple_core 2013-09-01 12:22:08 -07:00
Vinnie Falco
81a4711e66 Add BeforeBoost.h and tidy up beast system headers 2013-09-01 12:22:08 -07:00
Vinnie Falco
37216bed4d Refactor TxQueue, move some boost includes down to .cpp 2013-09-01 12:22:08 -07:00
Vinnie Falco
4ef0f5d6a9 Refactor ProofOfWork 2013-09-01 12:22:07 -07:00
Vinnie Falco
369bd0f36c Disable warnings 4018 and 4244 for VS2012 builds 2013-09-01 12:22:07 -07:00
Vinnie Falco
0f30b55cba Move PeerDoor source material into ripple_app.cpp 2013-09-01 12:22:06 -07:00
Vinnie Falco
e09d6a0a9b Make RPCSub abstract 2013-09-01 12:22:06 -07:00
Vinnie Falco
3077892c3b Remove deprecated basio::IoService 2013-09-01 12:22:05 -07:00
Vinnie Falco
027fba44ed Refactor ripple_websocket.h out of the main header material 2013-09-01 12:22:05 -07:00
Vinnie Falco
5f1a8670dc Refactor HTTPClient 2013-09-01 12:22:05 -07:00
Vinnie Falco
65df4b9daf Merge ripple_client into ripple_net 2013-09-01 12:22:04 -07:00
Vinnie Falco
5b8d104fb1 Make some header material private 2013-09-01 12:22:04 -07:00
Vinnie Falco
75b53ab171 Refactor WSConnection to a common base 2013-09-01 12:22:03 -07:00
Vinnie Falco
0d5bd937b1 Move RPCServerHandler to ripple_app/rpc 2013-09-01 12:22:03 -07:00
Vinnie Falco
98b630d8db Consolidate ripple_app includes 2013-09-01 12:22:02 -07:00
Vinnie Falco
3526cabd7b Move Application to ripple_app.cpp 2013-09-01 12:22:02 -07:00
Vinnie Falco
a709167801 Split ripple_app.cpp contents into each part file. 2013-09-01 12:22:02 -07:00
Vinnie Falco
dda831e09e Move common parts into ripple_app.h 2013-09-01 12:22:01 -07:00
Vinnie Falco
2070b2b1bd Reshuffle includes in ripple_app 2013-09-01 12:22:01 -07:00
Vinnie Falco
7de2d49345 Move RPCDoor to ripple_net 2013-09-01 12:22:00 -07:00
Vinnie Falco
0bcaf70e4a Reorganize some RPC related files 2013-09-01 12:22:00 -07:00
Vinnie Falco
af0471fb7d Tidy up ripple_net module 2013-09-01 12:21:59 -07:00
Vinnie Falco
e7d043e4df Merge ripple_asio into ripple_net 2013-09-01 12:21:59 -07:00
Vinnie Falco
a9f6d67bba Hide RPCDoor implementation and use RippleSSLContext 2013-09-01 12:21:59 -07:00
Vinnie Falco
e256716da8 Merge ripple_json to ripple_basics 2013-09-01 12:21:58 -07:00
Vinnie Falco
825ac4aca1 Make canonicalize take a pointer for clarity 2013-09-01 12:21:58 -07:00
Vinnie Falco
b1973db1f5 Make NetworkOPs abstract 2013-09-01 12:21:57 -07:00
Vinnie Falco
35598d7933 Refactor InfoSub to remove NetworkOPs dependency 2013-09-01 12:21:57 -07:00
Vinnie Falco
01fda4c30e Refactor RPCSub to remove Application dependency 2013-09-01 12:21:56 -07:00
Vinnie Falco
1391a11e46 Move BuildInfo to ripple_data 2013-09-01 12:21:56 -07:00
Vinnie Falco
bbfbdabe76 Move iAdminGet to Config::getAdminRole 2013-09-01 12:21:56 -07:00
Vinnie Falco
e22c1c3495 Refactor LoadManager 2013-09-01 12:21:55 -07:00
Vinnie Falco
1ee8b3903c Fix warnings in backend factories 2013-09-01 12:21:55 -07:00
Vinnie Falco
f5db655c47 Add some forward declarations 2013-09-01 12:21:54 -07:00
Vinnie Falco
11a09879a9 Move LevelDB options initialization into the factory 2013-09-01 12:21:54 -07:00
Vinnie Falco
f30fe1b699 Fix AutoSocket to use wrap() instead of post() 2013-09-01 12:21:54 -07:00
Vinnie Falco
d022fa68cf Fix websocket constant truncation warning 2013-09-01 12:21:53 -07:00
Vinnie Falco
99743e0fe0 Update TODO 2013-09-01 09:38:37 -07:00
Vinnie Falco
97075405cc Merge pull request #158 from nbougalis/feature-nikb-todo
Add NIKB_TODO
2013-08-31 18:33:40 -07:00
Nik Bougalis
b36e534197 Add NIKB_TODO 2013-08-31 18:28:43 -07:00
Vinnie Falco
f52c1657bf Update TODO 2013-08-31 15:14:46 -07:00
JoelKatz
a85afbe409 Fix paging in tx_account 2013-08-31 13:05:19 -07:00
Vinnie Falco
88060183f6 Tidy up includes and header material 2013-08-30 17:33:33 -07:00
Vinnie Falco
f37cf6277d Tidy up beast project files 2013-08-30 17:24:32 -07:00
JoelKatz
b81e22939b Binary support. 2013-08-30 12:53:24 -07:00
JoelKatz
47532b12dd First, untested, implementation of the new tx_account function. 2013-08-30 12:53:21 -07:00
JoelKatz
11117c75b7 Infrastructure for the new tx_account command. 2013-08-30 12:53:16 -07:00
JoelKatz
da5929cd18 Add a framework for rejecting commands. 2013-08-29 18:10:27 -07:00
JoelKatz
835236a35c Add a 'returnMessage' function to return a received message. 2013-08-29 18:03:45 -07:00
JoelKatz
eb33ae0d71 Fix a few bugs caused by starting without --net. There may still be some minor ones. 2013-08-28 00:55:56 -07:00
JoelKatz
be44586f85 Mark a FIXME 2013-08-27 12:31:10 -07:00
JoelKatz
34ee13a404 Fix bit rot. 2013-08-27 12:27:46 -07:00
JoelKatz
b102afcd3b Don't define TRUST_NETWORK 2013-08-27 12:21:30 -07:00
JoelKatz
e005dd5921 Correctly check if a node in an acquiring TXN set is a TXN we have. 2013-08-27 03:46:46 -07:00
JoelKatz
640e9482c4 This doesn't seem to properly synchronize reads and writes. 2013-08-27 02:22:40 -07:00
JoelKatz
d7ca14b18d This is too expensive. 2013-08-27 02:22:33 -07:00
JoelKatz
2780a5768a Fix another regression. 2013-08-27 01:49:46 -07:00
JoelKatz
2cc2d982a8 Fix a broken assert. 2013-08-27 00:53:26 -07:00
Vinnie Falco
e869713990 Fix warnings 2013-08-26 18:59:57 -07:00
JoelKatz
85e8a71918 Fix the disappearing paths problem. 2013-08-26 16:56:40 -07:00
Vinnie Falco
551643ff64 Log PROXY handshake addresses 2013-08-26 13:28:11 -07:00
JoelKatz
d7086bfc5e Set version to v0.12.0 2013-08-26 12:19:40 -07:00
Vinnie Falco
174303195b Add Subtrees/boost to .gitignore 2013-08-26 12:09:48 -07:00
JoelKatz
f2d2bdafd3 Merge branch 'develop' of github.com:ripple/rippled into develop 2013-08-25 15:32:04 -07:00
Vinnie Falco
b37c537b4a Set remote IP on PROXY handshake 2013-08-25 01:57:51 -07:00
Vinnie Falco
4170bcd294 Add PROXY peer listener and consolidate SSL contexts. 2013-08-25 01:57:51 -07:00
Vinnie Falco
3602e19dcd Add peer_port_proxy to config 2013-08-25 01:57:50 -07:00
Vinnie Falco
ef7cb16dcd Add toString for IPv4Address 2013-08-25 01:57:50 -07:00
Vinnie Falco
dea3c27e95 Add SSLContext 2013-08-25 01:57:50 -07:00
JoelKatz
68c089924a Merge branch 'develop' of github.com:ripple/rippled into develop 2013-08-24 20:52:10 -07:00
Vinnie Falco
ab08478e86 Use MultiSocket in Peer 2013-08-24 20:44:02 -07:00
Vinnie Falco
99dbc447f4 Use MultiSocket in Peer 2013-08-24 20:34:18 -07:00
Vinnie Falco
7b9a5e8753 Update MultiSocket for improved Socket 2013-08-24 20:06:17 -07:00
Vinnie Falco
db4a1dfaa4 Improvements to Socket and SocketWrapper 2013-08-24 20:06:17 -07:00
Vinnie Falco
bab6ab53d5 Add SocketWrapperStrand 2013-08-24 20:06:16 -07:00
Vinnie Falco
838b5befc6 Fix PrefilledReadStream::close to use lowest_layer 2013-08-24 20:06:16 -07:00
Vinnie Falco
bea6302759 Make asio Socket unit tests run automatically 2013-08-24 20:06:16 -07:00
Vinnie Falco
1959a93f28 Update to SQLite 3.8.0 Pre-release (as of 2013-08-22 02:56 UTC) 2013-08-24 20:06:15 -07:00
Vinnie Falco
364206b4e4 Remove unused sqlite subtree 2013-08-24 18:49:48 -07:00
Vinnie Falco
451d8ed488 Update sqlite to 3.7.17 (2013-05-20) 2013-08-24 18:48:08 -07:00
Vinnie Falco
444aba567f Set version to v0.12.0-rc6 2013-08-24 12:40:05 -07:00
Vinnie Falco
8b59a7b07b Fix NetworkOPs to set timers on processing 2013-08-24 12:39:14 -07:00
Vinnie Falco
21485ec003 Use SharedData in JobQueue and set latency, limits for new job types 2013-08-24 10:18:24 -07:00
Vinnie Falco
2bea9a8739 Merge beast_basics to beast_core 2013-08-24 10:18:24 -07:00
Vinnie Falco
9ba8ea679c Fix call doClusterReport on timer 2013-08-24 08:35:21 -07:00
Vinnie Falco
8908cdbfd5 Add TracketMutex unit test 2013-08-23 17:49:29 -07:00
Vinnie Falco
942e71b0ce Fix remove beast_boost.cpp from SConstruct 2013-08-23 15:04:45 -07:00
Vinnie Falco
f14333012b Use RippleMutex instead of boost::mutex 2013-08-23 15:00:04 -07:00
Vinnie Falco
c21a53a3ea Fix NetworkOPs timer to use JobQueue (2 new JobTypes added) 2013-08-23 15:00:04 -07:00
Vinnie Falco
4ececd0204 Add function call timing for all Application::sweep operations 2013-08-23 15:00:04 -07:00
Vinnie Falco
b0533a91fe Add TrackedMutex and measureFunctionCallTime 2013-08-23 15:00:04 -07:00
Vinnie Falco
5e827ba863 Fix KeyvaDB warnings 2013-08-23 07:01:37 -07:00
Vinnie Falco
0506a15209 Fix #ifdef for pragma 2013-08-22 18:43:55 -07:00
Vinnie Falco
5dc9169f98 Add logTimedDestroy and report in ~Ledger and ~SHAMap 2013-08-22 18:10:02 -07:00
Vinnie Falco
384370b433 Add String::fromNumber<> template for disambiguation 2013-08-22 18:10:01 -07:00
David Schwartz
a75631da56 STPath::assembleAdd function. 2013-08-22 16:03:37 -07:00
David Schwartz
37bfafe3bb Add some 'reserve' operations. 2013-08-22 16:02:45 -07:00
David Schwartz
76589f5084 Inline some functions. 2013-08-22 16:02:10 -07:00
JoelKatz
9aaabaebcd Don't send full ledgers to non-admins when under load. 2013-08-22 15:49:14 -07:00
JoelKatz
64e729fba6 Don't remove pathfinding requests erroneously. 2013-08-22 15:48:37 -07:00
Vinnie Falco
ce99820467 Add debug_log.txt to .gitignore 2013-08-22 15:36:44 -07:00
Vinnie Falco
663d5c9cee Log high SHAMap destroy times in ~Ledger 2013-08-22 15:36:40 -07:00
Vinnie Falco
8b86b81fc9 Add ~InboundLedger 2013-08-22 15:25:34 -07:00
Vinnie Falco
382b358bdf Move shared_ptr releases to outside the lock in InboundLedgers::sweep 2013-08-22 15:25:33 -07:00
Vinnie Falco
35836c9896 Move shared_ptr releases to outside the lock in TaggedCache::sweep 2013-08-22 15:25:33 -07:00
Vinnie Falco
8e95ee6ed3 Update MultiSocket to use new beast asio APIs 2013-08-21 19:41:44 -07:00
Vinnie Falco
647acebdbf New beast Socket, SharedHandler, ComposedAsyncOperation APIs 2013-08-21 19:41:22 -07:00
Vinnie Falco
a39e973abe Set version to v0.12.0-rc5 2013-08-21 18:52:54 -07:00
David Schwartz
3a2e770e52 Be more tolerant of corrupt peer entries. 2013-08-21 16:36:57 -07:00
David Schwartz
c17cfe9ea6 Send a smarter list of peers. 2013-08-21 16:36:51 -07:00
David Schwartz
c5a40141fe Don't let clients get tx history arbitrarily far back. 2013-08-21 11:18:33 -07:00
David Schwartz
32aabc8999 Change peer low water count from 4 to 10. 2013-08-21 11:18:24 -07:00
David Schwartz
e8eadae116 Can't use signing hashes to suppress. 2013-08-21 10:31:54 -07:00
David Schwartz
6704a5190e Make STPath::hasSeen const. 2013-08-21 10:31:41 -07:00
David Schwartz
a2f90da10c Fix pathfinding aggressiveness logic. 2013-08-21 10:31:34 -07:00
Vinnie Falco
beb50496a4 Remove KeyvaDB from NodeStore unit tests 2013-08-20 16:32:21 -07:00
Vinnie Falco
9d897001b6 Fix DirectoryIterator when multiple wildcards are used. 2013-08-20 15:24:02 -07:00
Vinnie Falco
651c9c8be7 Turn on C++11 for QMake builds 2013-08-20 15:22:36 -07:00
Vinnie Falco
578fee5f74 Fix ProtectedCall default handler 2013-08-20 15:22:21 -07:00
Vinnie Falco
568226e1ce Add top level out.txt to .gitignore 2013-08-20 15:04:20 -07:00
Vinnie Falco
54fe17d5eb Remove obsolete Xcode project 2013-08-20 14:59:20 -07:00
Vinnie Falco
d744e23e5e Disable KeyvaDB as a NodeStore backend choice 2013-08-20 14:47:45 -07:00
JoelKatz
e7fc07869d Disable the PoW unit test. 2013-08-19 15:00:16 -07:00
Vinnie Falco
02412b2ba4 Merge branch 'release' into develop
Conflicts:
	Subtrees/beast/modules/beast_asio/protocol/beast_HandshakeDetectorType.h
	modules/ripple_app/basics/ripple_BuildInfo.cpp
	modules/ripple_app/ledger/LedgerMaster.cpp
2013-08-19 14:30:27 -07:00
JoelKatz
45b7a6cdef Don't touch a possibly-failed inbound ledger. 2013-08-19 01:59:55 -07:00
JoelKatz
96b918fb10 0.12.0-rc3b 2013-08-19 01:57:01 -07:00
JoelKatz
9d3e3058bc Don't call both a function and a parameter "progress". 2013-08-18 23:27:54 -07:00
JoelKatz
c221cfde7a Some filterNodes cleanups. 2013-08-18 21:39:46 -07:00
JoelKatz
54a6d21903 Make the progress logic that triggers timeouts smarter. 2013-08-18 21:31:09 -07:00
JoelKatz
4e19c7cda1 Some extra debug. 2013-08-18 20:42:59 -07:00
JoelKatz
55af90fb68 Slow down fetching to avoid Sorceror's Apprentice syndrome. 2013-08-18 20:42:09 -07:00
JoelKatz
dfae891018 Fix a bug that could cause us not to acquire the current ledger. 2013-08-18 20:10:32 -07:00
JoelKatz
6e0d6bdba4 Make sure checkAccept is called, unless we know we don't need to, when findCreate completed immediately 2013-08-18 19:29:55 -07:00
JoelKatz
48c4eb3ad3 Suppress a warning. 2013-08-18 19:29:45 -07:00
JoelKatz
86147a6c6b Fix one case where checkAccept didn't get called. 2013-08-18 19:10:07 -07:00
Vinnie Falco
dd3ac6a154 Make HandlerCall operator() const 2013-08-18 17:21:59 -07:00
Vinnie Falco
0df51dc9e4 Add explicit checking for OpenSSL multithreading support 2013-08-18 13:09:09 -07:00
Vinnie Falco
a110a01e0d Move destroy to the .cpp 2013-08-18 13:09:09 -07:00
Vinnie Falco
7776781560 Fix pure virtual stubs for future returns 2013-08-18 13:08:34 -07:00
Vinnie Falco
958bc5866d Disable buffered handshake API to fix variations in boost versions 2013-08-18 04:11:53 -07:00
Vinnie Falco
1eccbd5e9d Disable buffered handshake API to fix variations in boost versions 2013-08-18 04:11:23 -07:00
Vinnie Falco
48bacf189d Clean up combinations of buffered handshaking and future returns 2013-08-18 03:20:57 -07:00
Vinnie Falco
d571788172 Tidy up argument types for all wrappers and call sites 2013-08-18 03:07:12 -07:00
Vinnie Falco
2d04fc4641 Remove obsolete handler wrappers 2013-08-18 02:35:53 -07:00
Vinnie Falco
04b5c7f447 New Context object for composed operations and continuation hooks 2013-08-18 01:53:43 -07:00
Vinnie Falco
d0e4352582 Fix clang compile error 2013-08-17 22:54:43 -07:00
Vinnie Falco
f342a70fd5 [WIP] MultiSocket 2013-08-17 21:10:03 -07:00
Vinnie Falco
6a8f054b2f Refactor Handler wrapper to meet the safety assurances of the original Handler 2013-08-17 21:10:03 -07:00
Vinnie Falco
d9b1b56c98 Fatal error if a Thread is destroyed while running 2013-08-17 21:10:02 -07:00
Vinnie Falco
6616cd86ef Add ContainerDeletePolicy for ownership containers 2013-08-17 21:10:01 -07:00
Vinnie Falco
2333a38cd7 Fix thread destruction in TestPeer and better exception reporting 2013-08-17 21:10:00 -07:00
Vinnie Falco
93f983ad71 Loop through the failing unit test 2013-08-17 21:10:00 -07:00
Vinnie Falco
0a58333edc Fixes to handshake and socket wrapper 2013-08-17 21:09:59 -07:00
Vinnie Falco
191562c13c Fix incorrect future returns for pure virtuals 2013-08-17 21:09:59 -07:00
Vinnie Falco
7fe3d3dc1b Fix gcc compile 2013-08-17 21:09:59 -07:00
Vinnie Falco
15dfaeb666 Use handshake detect stream in MultiSocket 2013-08-17 21:09:58 -07:00
Vinnie Falco
4eb3504a75 Refactor handshake parsing and logic classes 2013-08-17 21:09:58 -07:00
Vinnie Falco
2ce0ada8f5 Disable buffered handshake APIs 2013-08-17 21:09:57 -07:00
Vinnie Falco
59fe53781f Add TestPeerLogicProxyClient 2013-08-17 21:09:57 -07:00
Vinnie Falco
bb941354ce Generic HandshakeDetectStream and HandshakeDetectLogic 2013-08-17 21:09:57 -07:00
Vinnie Falco
0feccfd7b0 MultiSocket with ssl handshake detection 2013-08-17 21:09:56 -07:00
Vinnie Falco
461a710738 Allow selective enabling of async future returns 2013-08-17 21:09:56 -07:00
Vinnie Falco
4c605a79b7 Rename to max_needed for clarity 2013-08-17 21:09:55 -07:00
Vinnie Falco
4952ea2707 Add class PrefilledReadStream 2013-08-17 21:09:55 -07:00
Vinnie Falco
b064f66ea2 Fix async_result returns and handler copying 2013-08-17 21:09:55 -07:00
Vinnie Falco
7cf0ce22b1 Add default construction and isNull for Call handlers 2013-08-17 21:09:54 -07:00
Vinnie Falco
d22b236d2d Add 1-arity and 2-arity binding to CompletionCall 2013-08-17 21:09:54 -07:00
Vinnie Falco
462a1394d7 Add this_layer and this_layer_type to SocketWrapper 2013-08-17 21:09:53 -07:00
Vinnie Falco
9bfd8c923d Check for macro before setting it 2013-08-17 21:09:53 -07:00
Vinnie Falco
8c65adbffe Tidy up move obsolete and deprecated files 2013-08-17 21:09:53 -07:00
JoelKatz
fe1b8d253c Don't tolerate failed ledger acquires in the publication stream. 2013-08-16 23:22:33 -07:00
JoelKatz
39caac637c Typo. 2013-08-16 18:50:33 -07:00
JoelKatz
c98b24dbe6 Missing comma. 2013-08-16 18:41:47 -07:00
JoelKatz
6eec84144a A better fix for countAccountTxs. 2013-08-16 18:12:33 -07:00
JoelKatz
eb121e9312 Revert "Fix 'NetworkOPs::countAccountTxs' taking way too long."
This reverts commit ff127d2b25.
A new fix is in development.
2013-08-16 17:50:30 -07:00
Vinnie Falco
44aa45f307 Set version to 0.12.0-rc3 2013-08-16 17:47:29 -07:00
JoelKatz
ff127d2b25 Fix 'NetworkOPs::countAccountTxs' taking way too long. 2013-08-16 17:40:28 -07:00
Vinnie Falco
9bc96bc558 Fix missing return value 2013-08-16 10:43:31 -07:00
4444 changed files with 795099 additions and 571095 deletions

View File

@@ -1,10 +0,0 @@
;; Emacs - Code style and formatting settings
;; C++
((c++-mode
(indent-tabs-mode . t)
(tab-width . 4)
(c-basic-offset . 4)))
;; Headers should open in C++ mode
((c-mode . ((mode . c++))))

2
.gitattributes vendored
View File

@@ -1,5 +1,5 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
#* text=auto
# These annoying files
rippled.1 binary

22
.gitignore vendored
View File

@@ -19,21 +19,30 @@
*.o
build
tags
TAGS
bin/rippled
Debug/*.*
Release/*.*
# Ignore coverage files.
*.gcno
*.gcda
*.gcov
# Ignore locally installed node_modules
node_modules
/node_modules
# Ignore tmp directory.
tmp
# Ignore database directory.
db
db/
db/*.db
db/*.db-*
# Ignore debug logs
debug_log.txt
# Ignore customized configs
rippled.cfg
validators.txt
@@ -67,3 +76,12 @@ My Amplifier XE Results - RippleD
# KeyvaDB files
*.key
*.val
# Compiler intermediate output
/out.txt
# Build Log
rippled-build.log
# Profiling data
gmon.out

87
.travis.yml Normal file
View File

@@ -0,0 +1,87 @@
sudo: false
language: cpp
env:
global:
# Maintenance note: to move to a new version
# of boost, update both BOOST_ROOT and BOOST_URL.
# Note that for simplicity, BOOST_ROOT's final
# namepart must match the folder name internal
# to boost's .tar.gz.
- BOOST_ROOT=$HOME/boost_1_59_0
- BOOST_URL='http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.59.0%2Fboost_1_59_0.tar.gz%2Fdownload&ts=1441761349&use_mirror=skylineservers'
- RIPPLED_OLD_GCC_ABI=1
packages: &gcc5_pkgs
- gcc-5
- g++-5
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- libssl-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
packages: &gcc48_pkgs
- gcc-4.8
- g++-4.8
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- libssl-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
matrix:
include:
- compiler: gcc
env: GCC_VER=5 TARGET=debug.nounity
addons: &ao_gcc5
apt:
sources: ['ubuntu-toolchain-r-test']
packages: *gcc5_pkgs
- compiler: gcc
env: GCC_VER=5 TARGET=coverage
addons: *ao_gcc5
- compiler: clang
env: GCC_VER=4.8 TARGET=debug
addons: &ao_gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: *gcc48_pkgs
- compiler: clang
env: GCC_VER=4.8 TARGET=debug.nounity
addons: *ao_gcc48
- compiler: gcc
env: GCC_VER=4.8 TARGET=debug
addons: *ao_gcc48
- compiler: gcc
env: GCC_VER=4.8 TARGET=debug.nounity
addons: *ao_gcc48
cache:
directories:
- $BOOST_ROOT
before_install:
- bin/ci/ubuntu/install-dependencies.sh
script:
- bin/ci/ubuntu/build-and-test.sh
notifications:
email:
false
irc:
channels:
- "chat.freenode.net#ripple-dev"

View File

@@ -1,163 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
#define BEAST_BEASTCONFIG_H_INCLUDED
/** Configuration file for Beast.
This sets various configurable options for Beast. In order to compile you
must place a copy of this file in a location where your build environment
can find it, and then customize its contents to suit your needs.
@file BeastConfig.h
*/
//------------------------------------------------------------------------------
/** Config: BEAST_FORCE_DEBUG
Normally, BEAST_DEBUG is set to 1 or 0 based on compiler and project
settings, but if you define this value, you can override this to force it
to be true or false.
*/
#ifndef BEAST_FORCE_DEBUG
//#define BEAST_FORCE_DEBUG 0
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_LOG_ASSERTIONS
If this flag is enabled, the the bassert and bassertfalse macros will always
use Logger::writeToLog() to write a message when an assertion happens.
Enabling it will also leave this turned on in release builds. When it's
disabled, however, the bassert and bassertfalse macros will not be compiled
in a release build.
@see bassert, bassertfalse, Logger
*/
#ifndef BEAST_LOG_ASSERTIONS
//#define BEAST_LOG_ASSERTIONS 0
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_CHECK_MEMORY_LEAKS
Enables a memory-leak check for certain objects when the app terminates.
See the LeakChecked class for more details about enabling leak checking for
specific classes.
*/
#ifndef BEAST_CHECK_MEMORY_LEAKS
//#define BEAST_CHECK_MEMORY_LEAKS 1
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
In a Visual C++ build, this can be used to stop the required system libs
being automatically added to the link stage.
*/
#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
//#define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES 1
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_INCLUDE_ZLIB_CODE
This can be used to disable Beast's embedded 3rd-party zlib code.
You might need to tweak this if you're linking to an external zlib library in your app,
but for normal apps, this option should be left alone.
If you disable this, you might also want to set a value for BEAST_ZLIB_INCLUDE_PATH, to
specify the path where your zlib headers live.
*/
#ifndef BEAST_INCLUDE_ZLIB_CODE
//#define BEAST_INCLUDE_ZLIB_CODE 0
#endif
#ifndef BEAST_ZLIB_INCLUDE_PATH
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_BOOST_IS_AVAILABLE
This activates boost specific features and improvements.
*/
#ifndef BEAST_BOOST_IS_AVAILABLE
#define BEAST_BOOST_IS_AVAILABLE 1
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_DISABLE_BEAST_VERSION_PRINTING
Turns off the debugging display of the beast version number
*/
#ifndef BEAST_DISABLE_BEAST_VERSION_PRINTING
#define BEAST_DISABLE_BEAST_VERSION_PRINTING 1
#endif
//------------------------------------------------------------------------------
/** Bind source configuration.
Set one of these to manually force a particular implementation of bind().
If nothing is chosen then beast will use whatever is appropriate for your
environment based on what is available.
*/
//#define BEAST_BIND_USES_STD 1
//#define BEAST_BIND_USES_TR1 1
//#define BEAST_BIND_USES_BOOST 1
//------------------------------------------------------------------------------
/** Config: BEAST_DISABLE_CONTRACT_CHECKS
Set this to 1 to prevent check_contract macros from evaluating their
conditions, which might be expensive. meet_contract macros will still
evaluate their conditions since their return values are checked.
*/
#ifndef BEAST_DISABLE_CONTRACT_CHECKS
#define BEAST_DISABLE_CONTRACT_CHECKS 0
#endif
//------------------------------------------------------------------------------
//
// Ripple compilation settings
//
//------------------------------------------------------------------------------
/** Config: RIPPLE_VERIFY_NODEOBJECT_KEYS
This verifies that the hash of node objects matches the payload.
It is quite expensive so normally this is turned off!
*/
#ifndef RIPPLE_VERIFY_NODEOBJECT_KEYS
//#define RIPPLE_VERIFY_NODEOBJECT_KEYS 1
#endif
#define RIPPLE_USES_BEAST_SOCKETS 0
#endif

41
Builds/ArchLinux/PKGBUILD Normal file
View File

@@ -0,0 +1,41 @@
# Maintainer: Roberto Catini <roberto.catini@gmail.com>
pkgname=rippled
pkgrel=1
pkgver=0
pkgdesc="Ripple peer-to-peer network daemon"
arch=('i686' 'x86_64')
url="https://github.com/ripple/rippled"
license=('custom:ISC')
depends=('protobuf' 'openssl' 'boost-libs')
makedepends=('git' 'scons' 'boost')
checkdepends=('nodejs')
backup=("etc/$pkgname/rippled.cfg")
source=("git://github.com/ripple/rippled.git#branch=master")
sha512sums=('SKIP')
pkgver() {
cd "$srcdir/$pkgname"
git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}
build() {
cd "$srcdir/$pkgname"
scons
}
check() {
cd "$srcdir/$pkgname"
npm install
npm test
build/rippled --unittest
}
package() {
cd "$srcdir/$pkgname"
install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -D build/rippled "$pkgdir/usr/bin/rippled"
install -D -m644 doc/rippled-example.cfg "$pkgdir/etc/$pkgname/rippled.cfg"
mkdir -p "$pkgdir/var/lib/$pkgname/db"
mkdir -p "$pkgdir/var/log/$pkgname"
}

30
Builds/Docker/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# rippled
# use the ubuntu base image
FROM ubuntu
MAINTAINER Roberto Catini roberto.catini@gmail.com
# make sure the package repository is up to date
RUN apt-get update
RUN apt-get -y upgrade
# install the dependencies
RUN apt-get -y install git scons pkg-config protobuf-compiler libprotobuf-dev libssl-dev libboost1.55-all-dev
# download source code from official repository
RUN git clone https://github.com/ripple/rippled.git src; cd src/; git checkout master
# compile
RUN cd src/; scons build/rippled
# move to root directory and strip
RUN cp src/build/rippled rippled; strip rippled
# copy default config
RUN cp src/doc/rippled-example.cfg rippled.cfg
# clean source
RUN rm -r src
# launch rippled when launching the container
ENTRYPOINT ./rippled

View File

@@ -0,0 +1,23 @@
FROM ubuntu
MAINTAINER Torrie Fischer <torrie@ripple.com>
RUN apt-get update -qq &&\
apt-get install -qq software-properties-common &&\
apt-add-repository -y ppa:ubuntu-toolchain-r/test &&\
apt-add-repository -y ppa:afrank/boost &&\
apt-get update -qq
RUN apt-get purge -qq libboost1.48-dev &&\
apt-get install -qq libprotobuf8 libboost1.57-all-dev
RUN mkdir -p /srv/rippled/data
VOLUME /srv/rippled/data/
ENTRYPOINT ["/srv/rippled/bin/rippled"]
CMD ["--conf", "/srv/rippled/data/rippled.cfg"]
EXPOSE 51235/udp
EXPOSE 5005/tcp
ADD ./rippled.cfg /srv/rippled/data/rippled.cfg
ADD ./rippled /srv/rippled/bin/

13
Builds/Docker/build-ci.sh Executable file
View File

@@ -0,0 +1,13 @@
set -e
mkdir -p build/docker/
cp doc/rippled-example.cfg build/clang.debug/rippled build/docker/
cp Builds/Docker/Dockerfile-testnet build/docker/Dockerfile
mv build/docker/rippled-example.cfg build/docker/rippled.cfg
strip build/docker/rippled
docker build -t ripple/rippled:$CIRCLE_SHA1 build/docker/
docker tag ripple/rippled:$CIRCLE_SHA1 ripple/rippled:latest
if [ -z "$CIRCLE_PR_NUMBER" ]; then
docker tag ripple/rippled:$CIRCLE_SHA1 ripple/rippled:$CIRCLE_BRANCH
fi

16
Builds/Docker/push-to-hub.sh Executable file
View File

@@ -0,0 +1,16 @@
set -e
if [ -z "$DOCKER_EMAIL" -o -z "$DOCKER_USERNAME" -o -z "$DOCKER_PASSWORD" ];then
echo "Docker credentials are not set. Can't login to docker, no containers will be pushed."
exit 0
fi
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo "Not pushing results of a pull request build."
exit 0
fi
docker login -e $DOCKER_EMAIL -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push ripple/rippled:$CIRCLE_SHA1
docker push ripple/rippled:$CIRCLE_BRANCH
docker push ripple/rippled:latest

31
Builds/Eclipse/README.md Normal file
View File

@@ -0,0 +1,31 @@
**Requirements**
1. Java Runtime Environment (JRE)
2. Eclipse with CDT (tested on Luna):
http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunasr2
3. Eclipse SCons plugin: http://sconsolidator.com/
**WARNING**: by default the SCons plugin uses 16 threads. Go to
*Window->Preferences->SCons->Build Settings* in Eclipse and make it
use only 4-8 jobs(threads) or whatever you feel confortable with. It will
positively freeze your system if you run with 16 threads/jobs.
![scons](scons.png)
**Getting Started**
After setting up Eclipse just do a File->New->Other...
Select: C/C++ / New SCons project from existing source
Point the importer to the folder where the SConstruct resides (the root
folder of your git workspace normally)
**Build**
Just hit Project->Build All in Eclipse to get started. And remember to not
let it run 16 threads!
**Debug**
Start a new Eclipse debug configuration and set binary to run to build/rippled
(assuming you have built it).
![debug](debug.png)

BIN
Builds/Eclipse/debug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Builds/Eclipse/scons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,7 +1,7 @@
# Ripple protocol buffers
PROTOS = ../../modules/ripple_data/protocol/ripple.proto
PROTOS = ../../src/ripple_data/protocol/ripple.proto
PROTOS_DIR = ../../build/proto
# Google Protocol Buffers support
@@ -31,7 +31,9 @@ TEMPLATE = app
CONFIG += console thread warn_off
CONFIG -= qt gui
linux-gg++:QMAKE_CXXFLAGS += \
DEFINES += _DEBUG
linux-g++:QMAKE_CXXFLAGS += \
-Wall \
-Wno-sign-compare \
-Wno-char-subscripts \
@@ -39,52 +41,63 @@ linux-gg++:QMAKE_CXXFLAGS += \
-Wno-unused-parameter \
-Wformat \
-O0 \
-std=c++11 \
-pthread
INCLUDEPATH += \
"../.." \
"../../Subtrees" \
"../../Subtrees/leveldb/" \
"../../Subtrees/leveldb/port" \
"../../Subtrees/leveldb/include" \
"../../src/leveldb/" \
"../../src/leveldb/port" \
"../../src/leveldb/include" \
$${PROTOS_DIR}
OTHER_FILES += \
$$files(../../Subtrees/beast/*) \
$$files(../../Subtrees/beast/modules/beast_basics/diagnostic/*)
# $$files(../../src/*, true) \
# $$files(../../src/beast/*) \
# $$files(../../src/beast/modules/beast_basics/diagnostic/*)
# $$files(../../src/beast/modules/beast_core/, true)
# $$files(../../Subtrees/beast/modules/beast_core/, true)
# $$files(../../modules/*, true) \
UI_HEADERS_DIR += ../../modules/ripple_basics
UI_HEADERS_DIR += ../../src/ripple_basics
# ---------
# New style
#
SOURCES += \
../../Subtrees/beast/modules/beast_asio/beast_asio.cpp \
../../Subtrees/beast/modules/beast_basics/beast_basics.cpp \
../../Subtrees/beast/modules/beast_core/beast_core.cpp \
../../Subtrees/beast/modules/beast_crypto/beast_crypto.cpp \
../../Subtrees/beast/modules/beast_db/beast_db.cpp \
../../Subtrees/beast/modules/beast_sqdb/beast_sqdb.cpp \
../../Subtrees/beast/modules/beast_sqlite/beast_sqlite.c \
../../modules/ripple_app/ripple_app_pt1.cpp \
../../modules/ripple_app/ripple_app_pt2.cpp \
../../modules/ripple_app/ripple_app_pt3.cpp \
../../modules/ripple_app/ripple_app_pt4.cpp \
../../modules/ripple_app/ripple_app_pt5.cpp \
../../modules/ripple_app/ripple_app_pt6.cpp \
../../modules/ripple_app/ripple_app_pt7.cpp \
../../modules/ripple_app/ripple_app_pt8.cpp \
../../modules/ripple_asio/ripple_asio.cpp \
../../modules/ripple_basics/ripple_basics.cpp \
../../modules/ripple_core/ripple_core.cpp \
../../modules/ripple_client/ripple_client.cpp \
../../modules/ripple_data/ripple_data.cpp \
../../modules/ripple_hyperleveldb/ripple_hyperleveldb.cpp \
../../modules/ripple_json/ripple_json.cpp \
../../modules/ripple_leveldb/ripple_leveldb.cpp \
../../modules/ripple_mdb/ripple_mdb.c \
../../modules/ripple_net/ripple_net.cpp \
../../modules/ripple_websocket/ripple_websocket.cpp
../../src/ripple/beast/ripple_beast.unity.cpp \
../../src/ripple/beast/ripple_beastc.c \
../../src/ripple/common/ripple_common.unity.cpp \
../../src/ripple/http/ripple_http.unity.cpp \
../../src/ripple/json/ripple_json.unity.cpp \
../../src/ripple/peerfinder/ripple_peerfinder.unity.cpp \
../../src/ripple/radmap/ripple_radmap.unity.cpp \
../../src/ripple/resource/ripple_resource.unity.cpp \
../../src/ripple/sitefiles/ripple_sitefiles.unity.cpp \
../../src/ripple/sslutil/ripple_sslutil.unity.cpp \
../../src/ripple/testoverlay/ripple_testoverlay.unity.cpp \
../../src/ripple/types/ripple_types.unity.cpp \
../../src/ripple/validators/ripple_validators.unity.cpp
# ---------
# Old style
#
SOURCES += \
../../src/ripple_app/ripple_app.unity.cpp \
../../src/ripple_app/ripple_app_pt1.unity.cpp \
../../src/ripple_app/ripple_app_pt2.unity.cpp \
../../src/ripple_app/ripple_app_pt3.unity.cpp \
../../src/ripple_app/ripple_app_pt4.unity.cpp \
../../src/ripple_app/ripple_app_pt5.unity.cpp \
../../src/ripple_app/ripple_app_pt6.unity.cpp \
../../src/ripple_app/ripple_app_pt7.unity.cpp \
../../src/ripple_app/ripple_app_pt8.unity.cpp \
../../src/ripple_basics/ripple_basics.unity.cpp \
../../src/ripple_core/ripple_core.unity.cpp \
../../src/ripple_data/ripple_data.unity.cpp \
../../src/ripple_hyperleveldb/ripple_hyperleveldb.unity.cpp \
../../src/ripple_leveldb/ripple_leveldb.unity.cpp \
../../src/ripple_net/ripple_net.unity.cpp \
../../src/ripple_overlay/ripple_overlay.unity.cpp \
../../src/ripple_rpc/ripple_rpc.unity.cpp \
../../src/ripple_websocket/ripple_websocket.unity.cpp
LIBS += \
-lboost_date_time-mt\

191
Builds/Test.py Executable file
View File

@@ -0,0 +1,191 @@
#!/usr/bin/env python
# This file is part of rippled: https://github.com/ripple/rippled
# Copyright (c) 2012 - 2015 Ripple Labs Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""
Invocation:
./Builds/Test.py - builds and tests all configurations
The build must succeed without shell aliases for this to work.
To pass flags to scons, put them at the very end of the command line, after
the -- flag - like this:
./Builds/Test.py -- -j4 # Pass -j4 to scons.
Common problems:
1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder]
3) scons is an alias. Solution: Create a script named "scons" somewhere in
your $PATH (eg. ~/bin/scons will often work).
#!/bin/sh
python /C/Python27/Scripts/scons.py "${@}"
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import itertools
import os
import platform
import re
import subprocess
import sys
IS_WINDOWS = platform.system().lower() == 'windows'
if IS_WINDOWS:
BINARY_RE = re.compile(r'build\\([^\\]+)\\rippled.exe')
else:
BINARY_RE = re.compile(r'build/([^/]+)/rippled')
ALL_TARGETS = ['debug', 'release']
parser = argparse.ArgumentParser(
description='Test.py - run ripple tests'
)
parser.add_argument(
'--all', '-a',
action='store_true',
help='Build all configurations.',
)
parser.add_argument(
'--keep_going', '-k',
action='store_true',
help='Keep going after one configuration has failed.',
)
parser.add_argument(
'--silent', '-s',
action='store_true',
help='Silence all messages except errors',
)
parser.add_argument(
'--verbose', '-v',
action='store_true',
help=('Report more information about which commands are executed and the '
'results.'),
)
parser.add_argument(
'--test', '-t',
default='',
help='Add a prefix for unit tests',
)
parser.add_argument(
'scons_args',
default=(),
nargs='*'
)
ARGS = parser.parse_args()
def shell(*cmd, **kwds):
"Execute a shell command and return the output."
silent = kwds.pop('silent', ARGS.silent)
verbose = not silent and kwds.pop('verbose', ARGS.verbose)
if verbose:
print('$', ' '.join(cmd))
kwds['shell'] = IS_WINDOWS
process = subprocess.Popen(
cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
**kwds)
lines = []
count = 0
for line in process.stdout:
lines.append(line)
if verbose:
print(line, end='')
elif not silent:
count += 1
if count >= 80:
print()
count = 0
else:
print('.', end='')
if not verbose and count:
print()
process.wait()
return process.returncode, lines
if __name__ == '__main__':
args = list(ARGS.scons_args)
if ARGS.all:
for a in ALL_TARGETS:
if a not in args:
args.append(a)
print('Building:', *(args or ['(default)']))
# Build everything.
resultcode, lines = shell('scons', *args)
if resultcode:
print('Build FAILED:')
if not ARGS.verbose:
print(*lines, sep='')
exit(1)
# Now extract the executable names and corresponding targets.
failed = []
_, lines = shell('scons', '-n', '--tree=derived', *args, silent=True)
for line in lines:
match = BINARY_RE.search(line)
if match:
executable, target = match.group(0, 1)
print('Unit tests for', target)
testflag = '--unittest'
if ARGS.test:
testflag += ('=' + ARGS.test)
resultcode, lines = shell(executable, testflag)
if resultcode:
print('ERROR:', *lines, sep='')
failed.append([target, 'unittest'])
if not ARGS.keep_going:
break
ARGS.verbose and print(*lines, sep='')
print('npm tests for', target)
resultcode, lines = shell('npm', 'test', '--rippled=' + executable)
if resultcode:
print('ERROR:\n', *lines, sep='')
failed.append([target, 'npm'])
if not ARGS.keep_going:
break
else:
ARGS.verbose and print(*lines, sep='')
if failed:
print('FAILED:', *(':'.join(f) for f in failed))
exit(1)
else:
print('Success')

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<RepoDir>..\..</RepoDir>
<SrcDir>$(RepoDir)\src\cpp\ripple</SrcDir>
</PropertyGroup>
<PropertyGroup>
<OutDir>$(RepoDir)\build\VisualStudio2010\$(Configuration).$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup>
<IntDir>$(RepoDir)\build\obj\VisualStudio2010\$(Configuration).$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(RepoDir);$(RepoDir)\src\cpp\leveldb;$(RepoDir)\src\cpp\leveldb\include;$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees\beast;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>USE_LEVELDB;BOOST_TEST_ALTERNATIVE_INIT_API;BOOST_TEST_NO_MAIN;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="RepoDir">
<Value>$(RepoDir)</Value>
</BuildMacro>
<BuildMacro Include="SrcDir">
<Value>$(SrcDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{EE95954F-3D34-4FB1-ADBD-FE8395233026}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Debug|Win32.ActiveCfg = Debug|Win32
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Debug|Win32.Build.0 = Debug|Win32
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Release|Win32.ActiveCfg = Release|Win32
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,98 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EE95954F-3D34-4FB1-ADBD-FE8395233026}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>RippleD</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="RippleD.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt1.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt2.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt3.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt4.cpp" />
<ClCompile Include="..\..\modules\ripple_basics\ripple_basics.cpp" />
<ClCompile Include="..\..\modules\ripple_data\ripple_data.cpp" />
<ClCompile Include="..\..\src\cpp\database\sqlite3.c" />
<ClCompile Include="..\..\src\cpp\leveldb_core.cpp" />
<ClCompile Include="..\..\src\cpp\protobuf_core.cpp" />
<ClCompile Include="..\..\src\cpp\websocket_core.cpp" />
<ClCompile Include="..\..\Subtrees\beast\modules\beast_basics\beast_basics.cpp" />
<ClCompile Include="..\..\Subtrees\beast\modules\beast_core\beast_core.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt1.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt2.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt3.cpp" />
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt4.cpp" />
<ClCompile Include="..\..\modules\ripple_basics\ripple_basics.cpp" />
<ClCompile Include="..\..\modules\ripple_data\ripple_data.cpp" />
<ClCompile Include="..\..\Subtrees\beast\modules\beast_basics\beast_basics.cpp">
<Filter>Subtrees</Filter>
</ClCompile>
<ClCompile Include="..\..\Subtrees\beast\modules\beast_core\beast_core.cpp">
<Filter>Subtrees</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cpp\leveldb_core.cpp">
<Filter>Subtrees</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cpp\protobuf_core.cpp">
<Filter>Subtrees</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cpp\websocket_core.cpp">
<Filter>Subtrees</Filter>
</ClCompile>
<ClCompile Include="..\..\src\cpp\database\sqlite3.c">
<Filter>Subtrees</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Ripple">
<UniqueIdentifier>{63db902e-0e7a-42d1-b5f5-663e4b48786c}</UniqueIdentifier>
</Filter>
<Filter Include="Subtrees">
<UniqueIdentifier>{469e8a0a-64bf-4fa1-8b6f-81207db68577}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@@ -1,36 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "beast", "..\..\Subtrees\beast\Builds\VisualStudio2012\beast.vcxproj", "{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{B7F39ECD-473C-484D-BC34-31F8362506A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.ActiveCfg = Debug|Win32
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.Build.0 = Debug|Win32
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|x64.ActiveCfg = Debug|x64
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|x64.Build.0 = Debug|x64
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|Win32.ActiveCfg = Release|Win32
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|Win32.Build.0 = Release|Win32
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.ActiveCfg = Release|x64
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.Build.0 = Release|x64
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.ActiveCfg = Debug|Win32
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.Build.0 = Debug|Win32
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.ActiveCfg = Debug|x64
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.Build.0 = Debug|x64
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.ActiveCfg = Release|Win32
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.Build.0 = Release|Win32
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.ActiveCfg = Release|x64
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<RepoDir>..\..</RepoDir>
</PropertyGroup>
<PropertyGroup>
<OutDir>$(RepoDir)\build\VisualStudio2012\$(Configuration).$(Platform)\</OutDir>
<IntDir>$(RepoDir)\build\obj\VisualStudio2012\$(Configuration).$(Platform)\</IntDir>
<TargetName>rippled</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_VARIADIC_MAX=10;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>$(RepoDir);$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees;$(RepoDir)\Subtrees\leveldb;$(RepoDir)\Subtrees\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<ExceptionHandling>Async</ExceptionHandling>
</ClCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="RepoDir">
<Value>$(RepoDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
RippleD.vcxproj -text
RippleD.vcxproj.filters -text

View File

@@ -0,0 +1,339 @@
# Visual Studio 2015 Build Instructions
## Important
We do not recommend Windows for rippled production use at this time. Currently, the Ubuntu
platform has received the highest level of quality assurance, testing, and support.
## Prerequisites
To clone the source code repository, create branches for inspection or modification,
build rippled under Visual Studio, and run the unit tests you will need these
software components:
* [Visual Studio 2015](https://www.visualstudio.com/)
* [Git for Windows](http://git-scm.com/)
* [Google Protocol Buffers Compiler](https://code.google.com/p/protobuf/source/checkout)
* [OpenSSL Library](README.md#install-openssl)
* [ActivePerl](https://www.activestate.com/activeperl/downloads)
(Recommended to build OpenSSL.)
* [Boost 1.59 library](http://www.boost.org/users/download/)
* [Node.js](http://nodejs.org/download/)
Any version of Visual Studio 2015 may be used, including the Visual Studio Community
Edition which is available under a free license.
## Install Software
### Install Visual Studio 2015
If not already installed on your system, download your choice of installers from the
[Visual Studio 2015 Download](https://www.visualstudio.com/downloads/download-visual-studio-vs)
page, run the installer, and follow the directions.
The **Visual Studio 2015 Community** edition is available for free, while paid editions
may be used for an free initial trial period.
### Install Git for Windows
Git is a distributed revision control system. The Windows version also provides the
bash shell and many Windows versions of Unix commands. While there are other
varieties of Git (such as TortoiseGit, which has a native Windows interface and
integrates with the Explorer shell), we recommend installing
[Git for Windows](https://git-scm.com/) since
it provides a Unix-like command line environment useful for running shell scripts.
Use of the bash shell under Windows is mandatory for running the unit tests.
* NOTE: To gain full featured access to the
[git-subtree](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/)
functionality used in the rippled repository we suggest Git version 1.8.3.2 or later.
### Install Google Protocol Buffers Compiler
Building rippled requires **protoc.exe** version 2.5.1 or later. At your option you
may build it yourself from the sources in the
[Google Protocol Buffers](https://github.com/google/protobuf) repository,
or you may download a
[protoc.exe](https://ripple.github.io/Downloads/protoc/2.5.1/protoc.exe)
([alternate link](https://github.com/ripple/Downloads/raw/gh-pages/protoc/2.5.1/protoc.exe))
precompiled Windows executable from the
[Ripple Organization](https://github.com/ripple).
Either way, once you have the required version of **protoc.exe**, copy it into
a folder in your command line `%PATH%`.
* **NOTE:** If you use an older version of the compiler, the build will fail with
errors related to a mismatch of the version of protocol buffer headers versus
the compiler.
### Install ActivePerl
If not already installed on your system, download your choice of installers from the
[Activeperl Download](https://www.activestate.com/activeperl/downloads)
page, run the installer, and follow the directions.
## Configure Dependencies
### Install OpenSSL
1. Download OpenSSL *v1.0.2d or higher* source https://www.openssl.org/source/
2. Unpack the source archive into a temporary folder.
3. Open `cmd.exe`. Change the the folder where you unpacked OpenSSL.
4. Build the 64-bit libraries: (
[Reference 1](http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
[Reference 2](http://www.p-nand-q.com/programming/windows/building_openssl_with_visual_studio_2013.html))
```powershell
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
perl Configure VC-WIN64A --prefix=C:\lib\openssl-VC-64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
copy tmp32\lib.pdb C:\lib\openssl-VC-64\lib\
```
5. Optionally, delete the temporary folder.
* NOTE: Since rippled links statically to OpenSSL, it does not matter where the OpenSSL
.DLL files are placed, or what version they are. rippled does not use or require any
external .DLL files to run other than the standard operating system ones.
### Build Boost
After downloading boost and unpacking it, open a **Developer Command Prompt** for
Visual Studio, change to the directory containing boost, then bootstrap the build tools:
```powershell
cd C:\lib\boost_1_59_0
bootstrap
```
The rippled application is linked statically to the standard runtimes and external
dependencies on Windows, to ensure that the behavior of the executable is not
affected by changes in outside files. Therefore, it is necessary to build the
required boost static libraries using this command:
```powershell
bjam --toolset=msvc-14.0 --build-type=complete variant=debug,release link=static runtime-link=static address-model=64
```
Building the boost libraries may take considerable time. When the build process
is completed, take note of both the reported compiler include paths and linker
library paths as they will be required later.
* NOTE: If older versions of Visual Studio are also installed, the build may fail.
If this happens, make sure that only Visual Studio 2015 is installed. Due to
defects in the uninstallation procedures of these Microsoft products, it may
be necessary to start with a fresh install of the operating system with only
the necessary development environment components installed to have a successful build.
### Clone the rippled repository
If you are familiar with cloning github repositories, just follow your normal process
and clone `git@github.com:ripple/rippled.git`. Otherwise follow this section for instructions.
1. If you don't have a github account, sign up for one at
[github.com](https://github.com/).
2. Make sure you have Github ssh keys. For help see
[generating-ssh-keys](https://help.github.com/articles/generating-ssh-keys).
Open the "Git Bash" shell that was installed with "Git for Windows" in the
step above. Navigate to the directory where you want to clone rippled (git
bash uses `/c` for windows's `C:` and forward slash where windows uses
backslash, so `C:\Users\joe\projs` would be `/c/Users/joe/projs` in git bash).
Now clone the repository and optionally switch to the *master* branch.
Type the following at the bash prompt:
```powershell
git clone git@github.com:ripple/rippled.git
cd rippled
git checkout master
```
* If you receive an error about not having the "correct access rights"
make sure you have Github ssh keys, as described above.
### Configure Library Paths
Open the solution file located at **Builds/Visual Studio 2015/ripple.sln**
and select the "View->Other Windows->Property Manager" to bring up the Property Manager.
Expand the *debug | x64* section (or similar section on 32-windows) and
double click the *Microsoft.Cpp.x64.user* property sheet to bring up the
*Property Pages* dialog (these sections will be called *Win32* instead of
*x64* on 32-bit windows). These are global properties applied to all
64-bit build targets:
![Visual Studio 2015 Global Properties](images/VS2015x64Properties.png)
Go to *C/C++, General, Additional Include Directories* and add the
location of the boost installation:
![Visual Studio 2015 Include Directories](images/VS2015x64IncludeDirs.png)
Then, go to *Linker, General, Additional Library Directories* and add
the location of the compiled boost libraries reported at the completion
of building the boost libraries:
![Visual Studio 2015 Library Directories](images/VS2015x64LibraryDirs.png)
Follow the same procedure for adding the `Additional Include Directories`
and `Additional Library Directories` required for OpenSSL. In our example
these directories are **C:\lib\openssl-VC-64\include** and
**C:\lib\openssl-VC-64\lib** respectively.
# Setup Environment
## Create a working directory for rippled.cfg
The rippled server uses the [Rippled.cfg](https://wiki.ripple.com/Rippled.cfg)
file to read its configuration parameters. This section describes setting up
a directory to hold the config file. The next sections describe how to tell
the rippled server where that file is.
1. Create a directory to hold the configuration file. In this example, the
ripple config directory was created in `C:\Users\joe\ripple\config`.
2. Copy the example config file located in `doc\rippled-example.cfg` to the
new directory and rename it "rippled.cfg".
3. Read the rippled.cfg file and edit as appropriate.
## Change the Visual Studio Projects Debugging Properties
1. If not already open, open the solution file located at **Builds/Visual Studio 2015/Ripple.sln**
2. Select the correct solution platform in the solution platform dropdown (either *x64*
or *Win32* depending on machine type).
3. Select the "Project->Properties" menu item to bring up RippleD's Properties Pages
4. In "Configuration Properties" select "Debugging".
5. In the upper-left Configurations drop down, select "All Configurations".
6. In "Debugger to Launch" select "Local Windows Debugger".
### Tell rippled where to find the configuration file.
The `--conf` command-line switch to tell rippled where to find this file.
In the "Command Arguments" field in the properties dialog (that you opened
in the above section), add: `--conf="C:/Users/joe/ripple/config/rippled.cfg"`
(of course replacing that path with the path you set up above).
![Visual Studio 2013 Command Args Prop Page](images/VSCommandArgsPropPage.png)
### Set the _NO_DEBUG_HEAP Environment Variable
Rippled can run very slowly in the debugger when using the Windows Debug Heap.
Set the `_NO_DEBUG_HEAP` environment variable to one to disable the debug heap.
In the "Environment" field (that you opened in the above section), add:
`_NO_DEBUG_HEAP=1`
![Visual Studio 2013 No Debug Heap Prop Page](images/NoDebugHeapPropPage.png)
# Build
After these steps are complete, rippled should be ready to build. Simply
set rippled as the startup project by right clicking on it in the
Visual Studio Solution Explorer, choose **Set as Startup Project**,
and then choose the **Build->Build Solution** menu item.
# Unit Tests (Recommended)
The external rippled unit tests are written in Javascript using Node.js,
and utilize the mocha unit test framework. To run the unit tests, it
will be necessary to perform the following steps:
## Install Node.js
[Install Node.js](http://nodejs.org/download/). We recommend the Windows
installer (**.msi** file) as it takes care of updating the *PATH* environment
variable so that scripts can find the command. On Windows systems,
**Node.js** comes with **npm**. A separate installation of **npm**
is not necessary.
## Create node_modules
Open a windows console. From the root of your local rippled repository
directory, invoke **npm** to bring in the necessary components:
```
npm install
```
If you get an error that looks like
```
Error: ENOENT, stat 'C:\Users\username\AppData\Roaming\npm'
```
simply create the indicated folder and try again.
## Create a test config.js
From a *bash* shell (installed with Git for Windows), copy the
example configuration file into the appropriate location:
```
cp test/config-example.js test/config.js
```
Edit your version of test/config.js to reflect the correct path to the rippled executable:
```
exports.default_server_config = {
// Where to find the binary.
rippled_path: path.resolve(__dirname, "../build/msvc.debug/rippled.exe")
};
```
Also in **test/config.js**, change any occurrences of the
IP address *0.0.0.0* to *127.0.0.1*.
## Run Tests
From a windows console, run the unit tests:
```
npm test
```
Alternatively, run an individual test using mocha:
```
sh
node_modules/mocha/bin/mocha test/account_tx-test.js
```
* NOTE: The version of ripple-lib provided by the npm install
facility is usually slightly behind the develop branch of the
authoritative ripple-lib repository. Therefore, some tests might fail.
## Development ripple-lib
To use the latest branch of **ripple-lib** during the unit tests,
first clone the repository in a new location outside of your rippled
repository. Then update the submodules. After, run **npm install**
to set up the **node_modules** directory. Finally, install the
**grunt** command line tools required to run **grunt** and
build **ripple-lib**.
```
git clone git@github.com:ripple/ripple-lib.git
cd ripple-lib
git submodule update --init
npm install
npm install -g grunt-cli
grunt
```
Now link this version of **ripple-lib** into the global packages:
```
sudo npm link
```
To make rippled use the newly linked global **ripple-lib** package
instead of the one installed under **node_modules**, change
directories to the local rippled repository and delete the old
**ripple-lib** then link to the new one:
```
sh
rm -rf node_modules/ripple-lib
npm link ripple-lib
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug.classic|x64 = debug.classic|x64
debug|x64 = debug|x64
release.classic|x64 = release.classic|x64
release|x64 = release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.debug.classic|x64.ActiveCfg = debug.classic|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.debug.classic|x64.Build.0 = debug.classic|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.debug|x64.ActiveCfg = debug|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.debug|x64.Build.0 = debug|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.release.classic|x64.ActiveCfg = release.classic|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.release.classic|x64.Build.0 = release.classic|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.release|x64.ActiveCfg = release|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.release|x64.Build.0 = release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

52
Builds/rpm/rippled.spec Normal file
View File

@@ -0,0 +1,52 @@
Name: rippled
Version: 0.29.1-rc1
Release: 1%{?dist}
Summary: Ripple peer-to-peer network daemon
Group: Applications/Internet
License: ISC
URL: https://github.com/ripple/rippled
# curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/release.zip
Source0: rippled-release.zip
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc-c++ scons openssl-devel protobuf-devel
Requires: protobuf openssl
%description
Rippled is the server component of the Ripple network.
%prep
%setup -n rippled-release
%build
# Assume boost is manually installed
export RIPPLED_BOOST_HOME=/usr/local/boost_1_55_0
scons -j `grep -c processor /proc/cpuinfo` build/rippled
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/share/%{name}
cp LICENSE %{buildroot}/usr/share/%{name}/
mkdir -p %{buildroot}/usr/bin
cp build/rippled %{buildroot}/usr/bin/rippled
mkdir -p %{buildroot}/etc/%{name}
cp doc/rippled-example.cfg %{buildroot}/etc/%{name}/rippled.cfg
mkdir -p %{buildroot}/var/lib/%{name}/db
mkdir -p %{buildroot}/var/log/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
/usr/bin/rippled
/usr/share/rippled/LICENSE
/etc/rippled/rippled-example.cfg

View File

@@ -0,0 +1,13 @@
--- /usr/include/boost/config/compiler/clang.hpp 2013-07-20 13:17:10.000000000 -0400
+++ /usr/include/boost/config/compiler/clang.rippled.hpp 2014-03-11 16:40:51.000000000 -0400
@@ -39,6 +39,10 @@
// Clang supports "long long" in all compilation modes.
#define BOOST_HAS_LONG_LONG
+#if defined(__SIZEOF_INT128__)
+# define BOOST_HAS_INT128
+#endif
+
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//

View File

@@ -0,0 +1,10 @@
--- /usr/include/boost/bimap/detail/debug/static_error.hpp 2008-03-22 17:45:55.000000000 -0400
+++ /usr/include/boost/bimap/detail/debug/static_error.rippled.hpp 2014-03-12 19:40:05.000000000 -0400
@@ -25,7 +25,6 @@
// a static error.
/*===========================================================================*/
#define BOOST_BIMAP_STATIC_ERROR(MESSAGE,VARIABLES) \
- struct BOOST_PP_CAT(BIMAP_STATIC_ERROR__,MESSAGE) {}; \
BOOST_MPL_ASSERT_MSG(false, \
BOOST_PP_CAT(BIMAP_STATIC_ERROR__,MESSAGE), \
VARIABLES)

View File

@@ -1,17 +0,0 @@
Critical protocol changes
-------------------------
Mon Apr 8 16:13:12 PDT 2013
* The JSON field "inLedger" changing to "ledger_index"
Previous
* The JSON field "metaData" changing to "meta".
* RPC ledger will no longer take "ledger", use "ledger_hash" or "ledger_index".
* "ledgerClose" events:
** "hash" DEPRECATED: use "ledger_hash"
** "seqNum" DEPRECATED: use "ledger_index"
** "closeTime" DEPRECATED: use "close" or "close_human"
* stream "rt_accounts" --> "accounts_proposed"
* stream "rt_transactions" --> "transactions_proposed"
* subscribe "username" --> "url_username"
* subscribe "password" --> "url_password"

View File

@@ -1,217 +0,0 @@
--------------------------------------------------------------------------------
# Coding Standards
Coding standards used here are extreme strict and consistent. The style
evolved gradually over the years, incorporating generally acknowledged
best-practice C++ advice, experience, and personal preference.
## Don't Repeat Yourself!
The [Don't Repeat Yourself][1] principle summarises the essence of what it
means to write good code, in all languages, at all levels.
## Formatting
The goal of source code formatting should always be to make things as easy to
read as possible. White space is used to guide the eye so that details are not
overlooked. Blank lines are used to separate code into "paragraphs."
* No tab characters please.
* Tab stops are set to 4 spaces.
* Braces are indented in the [Allman style][2].
* Always place a space before and after all binary operators,
especially assignments (`operator=`).
* The `!` operator should always be followed by a space.
* The `~` operator should be preceded by a space, but not followed by one.
* The `++` and `--` operators should have no spaces between the operator and
the operand.
* A space never appears before a comma, and always appears after a comma.
* Always place a space before an opening parenthesis. One exception is if
the parentheses are empty.
* Don't put spaces after a parenthesis. A typical member function call might
look like this: `foobar (1, 2, 3);`
* In general, leave a blank line before an `if` statement.
* In general, leave a blank line after a closing brace `}`.
* Do not place code or comments on the same line as any opening or
closing brace.
* Do not write `if` statements all-on-one-line. The exception to this is when
you've got a sequence of similar `if` statements, and are aligning them all
vertically to highlight their similarities.
* In an `if-else` statement, if you surround one half of the statement with
braces, you also need to put braces around the other half, to match.
* When writing a pointer type, use this spacing: `SomeObject* myObject`.
Technically, a more correct spacing would be `SomeObject *myObject`, but
it makes more sense for the asterisk to be grouped with the type name,
since being a pointer is part of the type, not the variable name. The only
time that this can lead to any problems is when you're declaring multiple
pointers of the same type in the same statement - which leads on to the next
rule:
* When declaring multiple pointers, never do so in a single statement, e.g.
`SomeObject* p1, *p2;` - instead, always split them out onto separate lines
and write the type name again, to make it quite clear what's going on, and
avoid the danger of missing out any vital asterisks.
* The previous point also applies to references, so always put the `&` next to
the type rather than the variable, e.g. `void foo (Thing const& thing)`. And
don't put a space on both sides of the `*` or `&` - always put a space after
it, but never before it.
* The word `const` should be placed to the right of the thing that it modifies,
for consistency. For example `int const` refers to an int which is const.
`int const*` is a pointer to an int which is const. `int *const` is a const
pointer to an int.
* Always place a space in between the template angle brackets and the type
name. Template code is already hard enough to read!
## Naming conventions
* Member variables and method names are written with camel-case, and never
begin with a capital letter.
* Class names are also written in camel-case, but always begin with a capital
letter.
* For global variables... well, you shouldn't have any, so it doesn't matter.
* Class data members begin with `m_`, static data members begin with `s_`.
Global variables begin with `g_`. This is so the scope of the corresponding
declaration can be easily determined.
* Avoid underscores in your names, especially leading or trailing underscores.
In particular, leading underscores should be avoided, as these are often used
in standard library code, so to use them in your own code looks quite jarring.
* If you really have to write a macro for some reason, then make it all caps,
with underscores to separate the words. And obviously make sure that its name
is unlikely to clash with symbols used in other libraries or 3rd party code.
## Types, const-correctness
* If a method can (and should!) be const, make it const!
* If a method definitely doesn't throw an exception (be careful!), mark it as
`noexcept`
* When returning a temporary object, e.g. a String, the returned object should
be non-const, so that if the class has a C++11 move operator, it can be used.
* If a local variable can be const, then make it const!
* Remember that pointers can be const as well as primitives; For example, if
you have a `char*` whose contents are going to be altered, you may still be
able to make the pointer itself const, e.g. `char* const foobar = getFoobar();`.
* Do not declare all your local variables at the top of a function or method
(i.e. in the old-fashioned C-style). Declare them at the last possible moment,
and give them as small a scope as possible.
* Object parameters should be passed as `const&` wherever possible. Only
pass a parameter as a copy-by-value object if you really need to mutate
a local copy inside the method, and if making a local copy inside the method
would be difficult.
* Use portable `for()` loop variable scoping (i.e. do not have multiple for
loops in the same scope that each re-declare the same variable name, as
this fails on older compilers)
* When you're testing a pointer to see if it's null, never write
`if (myPointer)`. Always avoid that implicit cast-to-bool by writing it more
fully: `if (myPointer != nullptr)`. And likewise, never ever write
`if (! myPointer)`, instead always write `if (myPointer == nullptr)`.
It is more readable that way.
* Avoid C-style casts except when converting between primitive numeric types.
Some people would say "avoid C-style casts altogether", but `static_cast` is
a bit unreadable when you just want to cast an `int` to a `float`. But
whenever a pointer is involved, or a non-primitive object, always use
`static_cast`. And when you're reinterpreting data, always use
`reinterpret_cast`.
* Until C++ gets a universal 64-bit primitive type (part of the C++11
standard), it's best to stick to the `int64` and `uint64` typedefs.
## Object lifetime and ownership
* Absolutely do NOT use `delete`, `deleteAndZero`, etc. There are very very few
situations where you can't use a `ScopedPointer` or some other automatic
lifetime management class.
* Do not use `new` unless there's no alternative. Whenever you type `new`, always
treat it as a failure to find a better solution. If a local variable can be
allocated on the stack rather than the heap, then always do so.
* Do not ever use `new` or `malloc` to allocate a C++ array. Always use a
`HeapBlock` instead.
* And just to make it doubly clear: Never use `malloc` or `calloc`.
* If a parent object needs to create and own some kind of child object, always
use composition as your first choice. If that's not possible (e.g. if the
child needs a pointer to the parent for its constructor), then use a
`ScopedPointer`.
* If possible, pass an object as a reference rather than a pointer. If possible,
make it a `const` reference.
* Obviously avoid static and global values. Sometimes there's no alternative,
but if there is an alternative, then use it, no matter how much effort it
involves.
* If allocating a local POD structure (e.g. an operating-system structure in
native code), and you need to initialise it with zeros, use the `= { 0 };`
syntax as your first choice for doing this. If for some reason that's not
appropriate, use the `zerostruct()` function, or in case that isn't suitable,
use `zeromem()`. Don't use `memset()`.
## Classes
* Declare a class's public section first, and put its constructors and
destructor first. Any protected items come next, and then private ones.
* Use the most restrictive access-specifier possible for each member. Prefer
`private` over `protected`, and `protected` over `public`. Don't expose
things unnecessarily.
* Preferred positioning for any inherited classes is to put them to the right
of the class name, vertically aligned, e.g.:
class Thing : public Foo,
private Bar
{
}
* Put a class's member variables (which should almost always be private, of course),
after all the public and protected method declarations.
* Any private methods can go towards the end of the class, after the member
variables.
* If your class does not have copy-by-value semantics, derive the class from
`Uncopyable`.
* If your class is likely to be leaked, then derive your class from
`LeakChecked<>`.
* Constructors that take a single parameter should be default be marked
`explicit`. Obviously there are cases where you do want implicit conversion,
but always think about it carefully before writing a non-explicit constructor.
* Do not use `NULL`, `null`, or 0 for a null-pointer. And especially never use
'0L', which is particulary burdensome. Use `nullptr` instead - this is the
C++2011 standard, so get used to it. There's a fallback definition for `nullptr`
in Beast, so it's always possible to use it even if your compiler isn't yet
C++2011 compliant.
* All the C++ 'guru' books and articles are full of excellent and detailed advice
on when it's best to use inheritance vs composition. If you're not already
familiar with the received wisdom in these matters, then do some reading!
## Miscellaneous
* `goto` statements should not be used at all, even if the alternative is
more verbose code. The only exception is when implementing an algorithm in
a function as a state machine.
* Don't use macros! OK, obviously there are many situations where they're the
right tool for the job, but treat them as a last resort. Certainly don't ever
use a macro just to hold a constant value or to perform any kind of function
that could have been done as a real inline function. And it goes without saying
that you should give them names which aren't going to clash with other code.
And `#undef` them after you've used them, if possible.
* When using the `++` or `--` operators, never use post-increment if
pre-increment could be used instead. Although it doesn't matter for
primitive types, it's good practice to pre-increment since this can be
much more efficient for more complex objects. In particular, if you're
writing a for loop, always use pre-increment,
e.g. `for (int = 0; i < 10; ++i)`
* Never put an "else" statement after a "return"! This is well-explained in the
LLVM coding standards...and a couple of other very good pieces of advice from
the LLVM standards are in there as well.
* When getting a possibly-null pointer and using it only if it's non-null, limit
the scope of the pointer as much as possible - e.g. Do NOT do this:
Foo* f = getFoo ();
if (f != nullptr)
f->doSomething ();
// other code
f->doSomething (); // oops! f may be null!
..instead, prefer to write it like this, which reduces the scope of the
pointer, making it impossible to write code that accidentally uses a null
pointer:
if (Foo* f = getFoo ())
f->doSomethingElse ();
// f is out-of-scope here, so impossible to use it if it's null
(This also results in smaller, cleaner code)
[1]: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[2]: http://en.wikipedia.org/wiki/Indent_style#Allman_style

1890
Doxyfile

File diff suppressed because it is too large Load Diff

BIN
LICENSE

Binary file not shown.

View File

@@ -1,28 +0,0 @@
Vinnie Falco's Change Log
2013/08/07
- Add 'print' test that shows all the tests
- Improved "package.test" match string format when choosing tests to run
2013/08/04
- Begin reworking of socket code
2013/08/01
- Add beast::SemanticVersion
- Change rippled to use SemanticVersion
- Add runStartup to UnitTest, allowing forced tests on startup
- Force rippled BuildInfo unit test to run on every startup
2013/07/31
- Add "hostname" to server_info output
- Replace "build_version" in server_info with the actual build version
- Remove "client_version" from server_info
2013/07/30
- Add FatalErrorReporter to main
- Rewrote the build and protocol version numbering code

View File

@@ -1,487 +0,0 @@
--------------------------------------------------------------------------------
RIPPLE TODO
--------------------------------------------------------------------------------
REMINDER: KEEP CHANGE LOG UP TO DATE
Vinnie's List: Changes day to day, descending priority
(Items marked '*' can be handled by others.)
- beast::Socket integration in Ripple
- Socket implementation for PROXY protocol
- Socket that supports multiple protcols
- Unit tests for boost::asio wrappers
- Review boost::asio wrappers and consolidation of network code in ripple_net
- Deeply create directories specified in config settings
- Finish unit tests and code for Validators
* Document the command line options for the beast unit test framework
David Features:
- override config items from command line
- change config via RPC, this is for debugging
--------------------------------------------------------------------------------
- Refactor Section code into ConfigFile
- Improved Mutex to track deadlocks
- Work on KeyvaDB
- Allow skipped/disabled unit tests and reporting.
- Supress useless gcc warnings
http://stackoverflow.com/questions/3378560/how-to-disable-gcc-warnings-for-a-few-lines-of-code
- Get rid of boost::filesystem
- Make some fatal_assert macro that calls FatalError
- What the heck is up with site_scons/site_tools/protoc.py?
- Figure out the right behavior of ProtectedCall
- Do something about the throw() reporting weaknesses:
* Make sure all Sconstruct and .pro builds have debug symbols in release
* Replace all throw with beast::Throw()
(Only in ripple sources, not in Subtrees/, protobuf, or websocket)
- Improved Beast exception object, provides __FILE__ and __LINE__
- Add file and line capabilities to beast::Throw()
- Allow beast::Throw to be hooked for logging
- Add stack trace capability to beast::Throw() diagnostics via the hook
(use the existing beast::SystemStats::getStackBacktrace())
- Implement getStackBacktrace for BEAST_BSD targets
- Add UnhandledExceptionCatcher to beast
- Return EXIT_FAILURE on unhandled exception
- Option to print the list of available unit tests
- Add convenience variadic functions to JobQueue that do the bind for you
- Consolidate databases
- Figure out why we need WAL sqlite mode if we no longer use sqlite for the node store
- Add "skipped" field to beginTestCase() to disable a test but still record
that it was skipped in the output. Like for mdb import.
- use beast DeadlineTimer for sweep in Application
- Make SNTP Client have its own io_service
- Get rid of 'ref' typedefs that really mean const&
- Use secp256k1 from beast
- Fix xsd/dtd line in JUnit XML output
- Get rid of the WriteLog() stuff in the ripple tests and make it report the
message directly to the UnitTest object. Then update the JUnit XML output
routines to also write the auxiliary messages.
* Take away the "I" prefix from abstract interface classes, in both the class
name and the file name. It is messing up sorting in the IDE. Use "Imp" or
suffix for implementations.
* Restyle all the macros in ripple_ConfigSection.h
- Move src/protobuf to Subtrees and deal with protobuf_core.cpp
- Replace home-made database wrappers with beast::sqdb
- Use static creation member functions instead of endless constructor
variations in base_uint, uint256, and family.
- Raise the warning level and fix everything
- Replace base_uint and uintXXX with UnsignedInteger
* Need to specialize UnsignedInteger to work efficiently with 4 and 8 byte
multiples of the size.
- Rewrite boost program_options in Beast
- Replace endian conversion calls with beast calls:
htobe32, be32toh, ntohl, etc...
Start by removing the system headers which provide these routines, if possible
- Rename RPCHandler to CallHandler
- See if UniqueNodeList is really used, and if its not used remove it. If
only some small part of it is used, then delete the rest. David says
that it is broken anyway.
- Tidy up convenience functions in RPC.h
- Maybe rename RPCServer to RPCClientServicer
- Profile/VTune the application to identify hot spots
* Determine why rippled has a slow startup on Windows
* Improve the performance when running all unit tests on Windows
- Rename "fullBelow" to something like haveAllDescendants or haveAllChildren.
- Class to represent IP and Port number, with members to print, check syntax,
etc... replace the boost calls.
- Remove dependence on JobQueue, LoadFeeTrack, and NetworkOPs from LoadManager
by providing an observer (beast::ListenerList or Listeners). This way
LoadManager does not need stopThread() function.
- Rewrite Sustain to use Beast and work on Windows as well
* Do not enable watchdog process if a debugger is attached
- Make separate LevelDB VS2012 project for source browsing, leave ony the unity
.cpp in the main RippleD project
- Add LevelDB unity .cpp to the LevelDB fork
- Make sure the leak detector output appears on Linux and FreeBSD debug builds.
- Create SharedData <LoadState>, move all load related state variables currently
protected by separated mutexes in different classes into the LoadState, and
use read/write locking semantics to update the values. Later, use Listeners
to notify dependent code to resolve the dependency inversion.
- Rename LoadMonitor to LoadMeter, change LoadEvent to LoadMeter::ScopedSample
- Rename LedgerMaster to Ledgers, create ILedgers interface.
- Restructure the ripple sources to have this directory structure:
/Source/ripple/ripple_core/ripple_core.h
/...
/Source/Subtrees/... ?
PROBLEM: Where to put BeastConfig.h ?
- Figure out where previous ledgers go after a call to LedgerMaster::pushLedger()
and see if it is possible to clean up the leaks on exit.
- Replace all NULL with nullptr
- Add ICore interface (incremental replacement for Application)
- Make TxFormats a member of ICore instead of a singleton.
PROBLEM: STObject derived classes like STInt16 make direct use of the
singleton. It might have to remain a singleton. At the very least,
it should be a SharedSingleton to resolve ordering issues.
- Rename include guards to boost style, e.g. RIPPLE_LOG_H_INCLUDED
- Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS
- Fix all leaks on exit (!)
Say there's a leak, a ledger that can never be accessed is locked in some
structure. If the organized teardown code frees that structure, the leak
will not be reported.
Yes, so you'll detect some small subset of leaks that way.
You'll still have to be vigilant for the leaks that won't detect.
The problem is ordering. There are lots of circular dependencies.
The biggest problem is the order of destruction of global objects. (I think)
Getting rid of global objects is a good solution to that.
Vinnie Falco: Those I can resolve with my ReferenceCountedSingleton. And
yeah thats a good approach, one that I am doing slowly anyway
Yeah, that's good for other reasons too, not just the unpredictability of
creation order that can hide bugs.
There may also just be some missing destructors.
Some of it may be things being shut down in the wrong order. Like if you shut
down the cache and then something that uses the cache, objects may get
put in the cache after it was shut down.
- Remove "ENABLE_INSECURE" when the time is right.
- lift unique_ptr / auto_ptr into ripple namespace,
or replace with ScopedPointer (preferred)
- Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs
- Go searching through VFALCO notes and fix everything
- Deal with function-level statics used for SqliteDatabase (like in
HSBESQLite::visitAll)
- Document in order:
SerializedType
STObject
SerializedLedgerEntry
- Replace uint160, uint256 in argument lists, template parameter lists, and
data members with tyepdefs from ripple_ProtocolTypes.h
- Consolidate SQLite database classes: DatabaseCon, Database, SqliteDatabase.
--------------------------------------------------------------------------------
LEVELDB TODO
--------------------------------------------------------------------------------
- Add VisualStudio 2012 project file to our fork
- Add LevelDB unity .cpp and .h to our fork
- Replace Beast specific platform macros with universal macros so that the
unity doesn't require Beast
- Submit LevelDB fork changes to Bitcoin upstream
--------------------------------------------------------------------------------
WEBSOCKET TODO
--------------------------------------------------------------------------------
*** Figure out how hard we want to fork websocket first **
- Think about stripping the ripple specifics out of AutoSocket, make AutoSocket
part of our websocketpp fork
- Regroup all the sources together in one directory
- Strip includes and enforce unity
- Put a new front-end on websocket to hide ALL of their classes and templates
from the host application, make this part of the websocket fork
--------------------------------------------------------------------------------
PROTOCOL BUFFERS TODO
--------------------------------------------------------------------------------
- Create/maintain the protobuf Git repo (original uses SVN)
- Update the subtree
- Make a Visual Studio 2012 Project for source browsing
--------------------------------------------------------------------------------
NOTES
--------------------------------------------------------------------------------
LoadEvent
Is referenced with both a shared pointer and an auto pointer.
Should be named LoadMeter::ScopedSample. Or possibly ScopedLoadSample
JobQueue
getLoadEvent and getLoadEventAP differ only in the style of pointer
container which is returned. Unnecessary complexity.
Naming: Some names don't make sense.
Index
Stop using Index to refer to keys in tables. Replace with "Key" ?
Index implies a small integer, or a data structure.
This is all over the place in the Ledger API, "Index" of this and
"Index" of that, the terminology is imprecise and helps neither
understanding nor recall.
Inconsistent names
We have full names like SerializedType and then acronyms like STObject
Two names for some things, e.g. SerializedLedgerEntry and SLE
Shared/Smart pointer typedefs in classes have a variety of different names
for the same thing. e.g. "pointer", "ptr", "ptr_t", "wptr"
Verbose names
The prefix "Flat" is more appealing than "Serialized" because its shorter and
easier to pronounce.
Ledger "Skip List"
Is not really a skip list data structure. This is more appropriately
called an "index" although that name is currently used to identify hashes
used as keys.
Duplicate Code
LedgerEntryFormat and TxFormat
* Resolved with a todo item, create WireFormats<> template class.
Interfaces
Serializer
Upon analysis this class does two incompatible things. Flattening, and
unflattening. The interface should be reimplemented as two distinct
abstract classes, InputStream and OutputStream with suitable implementations
such as to and from a block of memory or dynamically allocated buffer.
The name and conflation of dual roles serves to confuse code at the point
of call. Does set(Serializer& s) flatten or unflatten the data? This
would be more clear:
bool write (OutputStream& stream);
We have beast for InputStream and OutputStream, we can use those now.
boost
Unclear from the class declaration what style of shared object management
is used. Prefer to derive from a SharedObject class so that the
behavior is explicit. Furthermore the use of intrusive containers is
preferred over the alternative.
make_shared <> () is awkward.
boost::recursive_mutex
Recursive mutexes should never be necessary.
They require the "mutable" keyword for const members to acquire the lock (yuck)
Replace recursive_mutex with beast::Mutex to remove boost dependency
--------------------------------------------------------------------------------
Davidisms
--------------------------------------------------------------------------------
(Figure out a good place to record information like this permanently)
Regarding a defect where a failing transaction was being submitted over and over
again on the network (July 3, 2013)
The core problem was an interaction between two bits of logic.
1) Normally, we won't relay a transaction again if we already recently relayed
it. But this is bypassed if the transaction failed in a way that could
allow it to succeed later. This way, if one server discovers a transaction
can now work, it can get all servers to retry it.
2) Normally, we won't relay a transaction if we think it can't claim a fee.
But if we're not sure it can't claim a fee because we're in an unhealthy
state, we propagate the transaction to let other servers decide if they
think it can claim a fee.
With these two bits of logic, two unhealthy servers could infinitely propagate
a transaction back and forth between each other.
A node is "full below" if we believe we have (either in the database or
scheduled to be stored in the database) the contents of every node below that
node in a hash tree. When trying to acquire a hash tree/map, if a node is
full below, we know not to bother with anything below that node.
The fullBelowCache is a cache of hashes of nodes that are full below. Which means
there are no missing children
What we want from the unique node list:
- Some number of trusted roots (known by domain)
probably organizations whose job is to provide a list of validators
- We imagine the IRGA for example would establish some group whose job is to
maintain a list of validators. There would be a public list of criteria
that they would use to vet the validator. Things like:
* Not anonymous
* registered business
* Physical location
* Agree not to cease operations without notice / arbitrarily
* Responsive to complaints
- Identifiable jurisdiction
* Homogeneity in the jurisdiction is a business risk
* If all validators are in the same jurisdiction this is a business risk
- OpenCoin sets criteria for the organizations
- Rippled will ship with a list of trusted root "certificates"
In other words this is a list of trusted domains from which the software
can contact each trusted root and retrieve a list of "good" validators
and then do something with that information
- All the validation information would be public, including the broadcast
messages.
- The goal is to easily identify bad actors and assess network health
* Malicious intent
* Or, just hardware problems (faulty drive or memory)
--------------------------------------------------------------------------------
ChosenValidators
--------------------------------------------------------------------------------
David:
I've cut 2 of the 6 active client-facing servers to hyper. Since then, we've
had 5 spinouts on 3 servers, none of them on the 2 I've cut over. But they
are also the most recently restarted servers, so it's not a 100% fair test.
Maybe OC should have a URL that you can query to get the latest list of URI's
for OC-approved organzations that publish lists of validators. The server and
client can ship with that master trust URL and also the list of URI's at the
time it's released, in case for some reason it can't pull from OC. That would
make the default installation safe even against major changes in the
organizations that publish validator lists.
The difference is that if an organization that provides lists of validators
goes rogue, administrators don't have to act.
TODO:
Write up from end-user perspective on the deployment and administration
of this feature, on the wiki. "DRAFT" or "PROPOSE" to mark it as provisional.
Template: https://ripple.com/wiki/Federation_protocol
- What to do if you're a publisher of ValidatorList
- What to do if you're a rippled administrator
- Overview of how ChosenValidators works
Goals:
Make default configuration of rippled secure.
* Ship with TrustedUriList
* Also have a preset RankedValidators
Eliminate administrative burden of maintaining
Produce the ChosenValidators list.
Allow quantitative analysis of network health.
What determines that a validator is good?
- Are they present (i.e. sending validations)
- Are they on the consensus ledger
- What percentage of consensus rounds do they participate in
- Are they stalling consensus
* Measurements of constructive/destructive behavior is
calculated in units of percentage of ledgers for which
the behavior is measured.
Nouns
Validator
- Signs ledgers and participate in consensus
- Fields
* Public key
* Friendly name
* Jurisdiction
* Org type: profit, nonprofit, "profit/gateway"
- Metadata
* Visible on the network?
* On the consensus ledger?
* Percentage of recent participation in consensus
* Frequency of stalling the consensus process
ValidatorSource
- Abstract
- Provides a list of Validator
ValidatorList
- Essentially an array of Validator
TrustedUriValidatorSource
- ValidatorSource which uses HTTPS and a predefined URI
- Domain owner is responsible for removing bad validators
TrustedUriValidatorSource::List
- Essentially an array of TrustedUriValidatorSource
- Can be read from a file
LocalFileValidatorSource
- ValidatorSource which reads information from a local file.
TrustedUriList // A copy of this ships with the app
* has a KnownValidators
KnownValidators
* A series of KnownValidator that comes from a TrustedUri
* Persistent storage has a timestamp
RankedValidators
* Created as the union of all KnownValidators with "weight" being the
number of appearances.
ChosenValidators
* Result of the algorithm that chooses a random subset of RankedKnownValidators
* "local health" percentage is the percent of validations from this list that
you've seen recently. And have they been behaving.
Algorithm
When updating a source

131
README.md
View File

@@ -1,18 +1,129 @@
Ripple - P2P Payment Network
============================
![Ripple](/images/ripple.png)
[![Build Status](https://ci.ripple.com/jenkins/buildStatus/icon?job=rippled)](https://ci.ripple.com/jenkins/job/rippled/)
#The Worlds Fastest and Most Secure Payment System
Some portions of this source code are currently closed source.
**What is Ripple?**
This is the repository for Ripple's `rippled`, reference P2P network server.
Ripple is the open-source, distributed payment protocol that enables instant
payments with low fees, no chargebacks, and currency flexibility (for example
dollars, yen, euros, bitcoins, or even loyalty points). Businesses of any size
can easily build payment solutions such as banking or remittance apps, and
accelerate the movement of money. Ripple enables the world to move value the
way it moves information on the Internet.
Build instructions:
![Ripple Network](images/network.png)
**What is a Gateway?**
Ripple works with gateways: independent businesses which hold customer
deposits in various currencies such as U.S. dollars (USD) or Euros (EUR),
in exchange for providing cryptographically-signed issuances that users can
send and trade with one another in seconds on the Ripple network. Within the
protocol, exchanges between multiple currencies can occur atomically without
any central authority to monitor them. Later, customers can withdraw their
Ripple balances from the gateways that created those issuances.
**How do Ripple payments work?**
A sender specifies the amount and currency the recipient should receive and
Ripple automatically converts the senders available currencies using the
distributed order books integrated into the Ripple protocol. Independent third
parties acting as market makers provide liquidity in these order books.
Ripple uses a pathfinding algorithm that considers currency pairs when
converting from the source to the destination currency. This algorithm searches
for a series of currency swaps that gives the user the lowest cost. Since
anyone can participate as a market maker, market forces drive fees to the
lowest practical level.
**What can you do with Ripple?**
The protocol is entirely open-source and the networks shared ledger is public
information, so no central authority prevents anyone from participating. Anyone
can become a market maker, create a wallet or a gateway, or monitor network
behavior. Competition drives down spreads and fees, making the network useful
to everyone.
###Key Protocol Features
1. XRP is Ripples native [cryptocurrency]
(http://en.wikipedia.org/wiki/Cryptocurrency) with a fixed supply that
decreases slowly over time, with no mining. XRP acts as a bridge currency, and
pays for transaction fees that protect the network against spam.
![XRP as a bridge currency](/images/vehicle_currency.png)
2. Pathfinding discovers cheap and efficient payment paths through multiple
[order books](https://www.ripplecharts.com) allowing anyone to [trade](https://www.rippletrade.com) anything. When two accounts arent linked by relationships of trust, the Ripple pathfinding engine considers intermediate links and order books to produce a set of possible paths the transaction can take. When the payment is processed, the liquidity along these paths is iteratively consumed in best-first order.
![Pathfinding from Dollars to Euro](/images/pathfinding.png)
3. [Consensus](https://www.youtube.com/watch?v=pj1QVb1vlC0) confirms
transactions in an atomic fashion, without mining, ensuring efficient use of
resources.
[transact]: https://ripple.com/files/ripple-FIs.pdf
[build]: https://ripple.com/build/
[transact.png]: /images/transact.png
[build.png]: /images/build.png
[contribute.png]: /images/contribute.png
###Join The Ripple Community
|![Transact][transact.png]|![Build][build.png]|![Contribute][contribute.png]|
|:-----------------------:|:-----------------:|:---------------------------:|
|[Transact on the fastest payment infrastructure][transact]|[Build Imaginative Apps][build]|Contribute to the Ripple Protocol Implementation|
#rippled - Ripple P2P server
##[![Build Status](https://travis-ci.org/ripple/rippled.png?branch=develop)](https://travis-ci.org/ripple/rippled)
This is the repository for Ripple's `rippled`, reference P2P server.
###Build instructions:
* https://ripple.com/wiki/Rippled_build_instructions
Setup instructions:
###Setup instructions:
* https://ripple.com/wiki/Rippled_setup_instructions
For more information:
* https://ripple.com
* https://ripple.com/wiki
###Issues
* https://ripplelabs.atlassian.net/browse/RIPD
### Repository Contents
#### ./bin
Scripts and data files for Ripple integrators.
#### ./build
Intermediate and final build outputs.
#### ./Builds
Platform or IDE-specific project files.
#### ./doc
Documentation and example configuration files.
#### ./src
Source code directory. Some of the directories contained here are
external repositories inlined via git-subtree, see the corresponding
README for more details.
#### ./test
Javascript / Mocha tests.
## License
Ripple is open source and permissively licensed under the ISC license. See the
LICENSE file for more details.
###For more information:
* Ripple Wiki - https://ripple.com/wiki/
* Ripple Primer - https://ripple.com/ripple_primer.pdf
* Ripple Primer (Market Making) - https://ripple.com/ripple-mm.pdf
* Ripple Gateway Primer - https://ripple.com/ripple-gateways.pdf
* Consensus - https://wiki.ripple.com/Consensus
- - -
Copyright © 2015, Ripple Labs. All rights reserved.
Portions of this document, including but not limited to the Ripple logo, images
and image templates are the property of Ripple Labs and cannot be copied or
used without permission.

1210
SConstruct

File diff suppressed because it is too large Load Diff

View File

@@ -1,72 +0,0 @@
# Subtrees
These directories come from entire outside repositories
brought in using git-subtree.
About git-subtree:
https://github.com/apenwarr/git-subtree <br>
http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ <br>
## LevelDB
Ripple's fork of LevelDB is shared by the Bitcoin reference client project.
Repository <br>
```
git@github.com:ripple/LevelDB.git
```
Branch
```
ripple-fork
```
## LightningDB (a.k.a. MDB)
A supposedly fast memory-mapped key value database system
Repository <br>
```
git://gitorious.org/mdb/mdb.git
```
Branch
```
mdb.master
```
## websocket
Ripple's fork of websocketpp has some incompatible changes and Ripple specific includes.
Repository
```
git@github.com:ripple/websocketpp.git
```
Branch
```
ripple-fork
```
## protobuf
Ripple's fork of protobuf doesn't have any actual changes, but since the upstream
repository uses SVN, we have created a Git version to use with the git-subtree command.
Repository
```
git@github.com:ripple/protobuf.git
```
Branch
```
master
```
**NOTE** Linux builds use the protobuf installed in /usr/lib. This will be
fixed in a future revision.
## SQLite
Not technically a subtree but included here because it is a direct
copy of the official SQLite distributions available here:
http://sqlite.org/download.html

View File

@@ -1,26 +0,0 @@
Docs
._*
*.mode1v3
*.pbxuser
*.perspectivev3
*.user
*.ncb
*.suo
*.obj
*.ilk
*.pch
*.pdb
*.dep
*.idb
*.manifest
*.manifest.res
*.o
*.d
*.sdf
xcuserdata
contents.xcworkspacedata
.DS_Store
.svn
profile
Builds/VisualStudio2012/Debug
Builds/VisualStudio2012/Release

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>_CRTDBG_MAP_ALLOC;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View File

@@ -1,145 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
#define BEAST_BEASTCONFIG_H_INCLUDED
/** Configuration file for Beast.
This sets various configurable options for Beast. In order to compile you
must place a copy of this file in a location where your build environment
can find it, and then customize its contents to suit your needs.
@file BeastConfig.h
*/
//------------------------------------------------------------------------------
/** Config: BEAST_FORCE_DEBUG
Normally, BEAST_DEBUG is set to 1 or 0 based on compiler and project
settings, but if you define this value, you can override this to force it
to be true or false.
*/
#ifndef BEAST_FORCE_DEBUG
//#define BEAST_FORCE_DEBUG 0
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_LOG_ASSERTIONS
If this flag is enabled, the the bassert and bassertfalse macros will always
use Logger::writeToLog() to write a message when an assertion happens.
Enabling it will also leave this turned on in release builds. When it's
disabled, however, the bassert and bassertfalse macros will not be compiled
in a release build.
@see bassert, bassertfalse, Logger
*/
#ifndef BEAST_LOG_ASSERTIONS
//#define BEAST_LOG_ASSERTIONS 0
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_CHECK_MEMORY_LEAKS
Enables a memory-leak check for certain objects when the app terminates.
See the LeakChecked class for more details about enabling leak checking for
specific classes.
*/
#ifndef BEAST_CHECK_MEMORY_LEAKS
//#define BEAST_CHECK_MEMORY_LEAKS 1
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
In a Visual C++ build, this can be used to stop the required system libs
being automatically added to the link stage.
*/
#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
//#define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES 1
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_INCLUDE_ZLIB_CODE
This can be used to disable Beast's embedded 3rd-party zlib code.
You might need to tweak this if you're linking to an external zlib library in your app,
but for normal apps, this option should be left alone.
If you disable this, you might also want to set a value for BEAST_ZLIB_INCLUDE_PATH, to
specify the path where your zlib headers live.
*/
#ifndef BEAST_INCLUDE_ZLIB_CODE
//#define BEAST_INCLUDE_ZLIB_CODE 0
#endif
#ifndef BEAST_ZLIB_INCLUDE_PATH
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_BOOST_IS_AVAILABLE
This activates boost specific features and improvements.
*/
#ifndef BEAST_BOOST_IS_AVAILABLE
#define BEAST_BOOST_IS_AVAILABLE 0
#endif
//------------------------------------------------------------------------------
/** Config: BEAST_DISABLE_BEAST_VERSION_PRINTING
Turns off the debugging display of the beast version number
*/
#ifndef BEAST_DISABLE_BEAST_VERSION_PRINTING
//#define BEAST_DISABLE_BEAST_VERSION_PRINTING 1
#endif
//------------------------------------------------------------------------------
/** Bind source configuration.
Set one of these to manually force a particular implementation of bind().
If nothing is chosen then beast will use whatever is appropriate for your
environment based on what is available.
*/
//#define BEAST_BIND_USES_STD 1
//#define BEAST_BIND_USES_TR1 1
//#define BEAST_BIND_USES_BOOST 1
//------------------------------------------------------------------------------
/** Config: BEAST_DISABLE_CONTRACT_CHECKS
Set this to 1 to prevent check_contract macros from evaluating their
conditions, which might be expensive. meet_contract macros will still
evaluate their conditions since their return values are checked.
*/
#ifndef BEAST_DISABLE_CONTRACT_CHECKS
#define BEAST_DISABLE_CONTRACT_CHECKS 0
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,228 +0,0 @@
Write code in a clear, self-documenting style but use comments where necessary.
Use Test Driven Development. It encourages designing interfaces first, before implementation.
Don't Repeat Yourself, <20>D.R.Y.<2E>. Put redundant code in a class so it can be re-used and unit tested.
Expose as little of a class as possible. Prefer private over protected. Prefer protected over public. The smaller the interface footprint, the easier it is to write unit tests and comprehend the operation of the class. This is the Interface Segregation Principle.
Use language constants (enum or static const) with descriptive names instead of hard-coded <20>magic numbers.<2E>
Make classes depend on as few external classes or routines as possible. Ideally, no dependencies.
Don't limit flexibility of parameters by forcing the caller to use specific types where general types would work.
--------------------------------------------------------------------------------
# Coding Standards
Coding standards used here are extreme strict and consistent. The style
evolved gradually over the years, incorporating generally acknowledged
best-practice C++ advice, experience, and personal preference.
## Don't Repeat Yourself!
The [Don't Repeat Yourself][1] principle summarises the essence of what it
means to write good code, in all languages, at all levels.
## Formatting
The goal of source code formatting should always be to make things as easy to
read as possible. White space is used to guide the eye so that details are not
overlooked. Blank lines are used to separate code into "paragraphs."
* No tab characters please.
* Tab stops are set to 4 spaces.
* Braces are indented in the [Allman style][2].
* Always place a space before and after all binary operators,
especially assignments (`operator=`).
* The `!` operator should always be followed by a space.
* The `~` operator should be preceded by a space, but not followed by one.
* The `++` and `--` operators should have no spaces between the operator and
the operand.
* A space never appears before a comma, and always appears after a comma.
* Always place a space before an opening parenthesis. One exception is if
the parentheses are empty.
* Don't put spaces after a parenthesis. A typical member function call might
look like this: `foobar (1, 2, 3);`
* In general, leave a blank line before an `if` statement.
* In general, leave a blank line after a closing brace `}`.
* Do not place code or comments on the same line as any opening or
closing brace.
* Do not write `if` statements all-on-one-line. The exception to this is when
you've got a sequence of similar `if` statements, and are aligning them all
vertically to highlight their similarities.
* In an `if-else` statement, if you surround one half of the statement with
braces, you also need to put braces around the other half, to match.
* When writing a pointer type, use this spacing: `SomeObject* myObject`.
Technically, a more correct spacing would be `SomeObject *myObject`, but
it makes more sense for the asterisk to be grouped with the type name,
since being a pointer is part of the type, not the variable name. The only
time that this can lead to any problems is when you're declaring multiple
pointers of the same type in the same statement - which leads on to the next
rule:
* When declaring multiple pointers, never do so in a single statement, e.g.
`SomeObject* p1, *p2;` - instead, always split them out onto separate lines
and write the type name again, to make it quite clear what's going on, and
avoid the danger of missing out any vital asterisks.
* The previous point also applies to references, so always put the `&` next to
the type rather than the variable, e.g. `void foo (Thing const& thing)`. And
don't put a space on both sides of the `*` or `&` - always put a space after
it, but never before it.
* The word `const` should be placed to the right of the thing that it modifies,
for consistency. For example `int const` refers to an int which is const.
`int const*` is a pointer to an int which is const. `int *const` is a const
pointer to an int.
* Always place a space in between the template angle brackets and the type
name. Template code is already hard enough to read!
## Naming conventions
* Member variables and method names are written with camel-case, and never
begin with a capital letter.
* Class names are also written in camel-case, but always begin with a capital
letter.
* For global variables... well, you shouldn't have any, so it doesn't matter.
* Class data members begin with `m_`, static data members begin with `s_`.
Global variables begin with `g_`. This is so the scope of the corresponding
declaration can be easily determined.
* Avoid underscores in your names, especially leading or trailing underscores.
In particular, leading underscores should be avoided, as these are often used
in standard library code, so to use them in your own code looks quite jarring.
* If you really have to write a macro for some reason, then make it all caps,
with underscores to separate the words. And obviously make sure that its name
is unlikely to clash with symbols used in other libraries or 3rd party code.
## Types, const-correctness
* If a method can (and should!) be const, make it const!
* If a method definitely doesn't throw an exception (be careful!), mark it as
`noexcept`
* When returning a temporary object, e.g. a String, the returned object should
be non-const, so that if the class has a C++11 move operator, it can be used.
* If a local variable can be const, then make it const!
* Remember that pointers can be const as well as primitives; For example, if
you have a `char*` whose contents are going to be altered, you may still be
able to make the pointer itself const, e.g. `char* const foobar = getFoobar();`.
* Do not declare all your local variables at the top of a function or method
(i.e. in the old-fashioned C-style). Declare them at the last possible moment,
and give them as small a scope as possible.
* Object parameters should be passed as `const&` wherever possible. Only
pass a parameter as a copy-by-value object if you really need to mutate
a local copy inside the method, and if making a local copy inside the method
would be difficult.
* Use portable `for()` loop variable scoping (i.e. do not have multiple for
loops in the same scope that each re-declare the same variable name, as
this fails on older compilers)
* When you're testing a pointer to see if it's null, never write
`if (myPointer)`. Always avoid that implicit cast-to-bool by writing it more
fully: `if (myPointer != nullptr)`. And likewise, never ever write
`if (! myPointer)`, instead always write `if (myPointer == nullptr)`.
It is more readable that way.
* Avoid C-style casts except when converting between primitive numeric types.
Some people would say "avoid C-style casts altogether", but `static_cast` is
a bit unreadable when you just want to cast an `int` to a `float`. But
whenever a pointer is involved, or a non-primitive object, always use
`static_cast`. And when you're reinterpreting data, always use
`reinterpret_cast`.
* Until C++ gets a universal 64-bit primitive type (part of the C++11
standard), it's best to stick to the `int64` and `uint64` typedefs.
## Object lifetime and ownership
* Absolutely do NOT use `delete`, `deleteAndZero`, etc. There are very very few
situations where you can't use a `ScopedPointer` or some other automatic
lifetime management class.
* Do not use `new` unless there's no alternative. Whenever you type `new`, always
treat it as a failure to find a better solution. If a local variable can be
allocated on the stack rather than the heap, then always do so.
* Do not ever use `new` or `malloc` to allocate a C++ array. Always use a
`HeapBlock` instead.
* And just to make it doubly clear: Never use `malloc` or `calloc`.
* If a parent object needs to create and own some kind of child object, always
use composition as your first choice. If that's not possible (e.g. if the
child needs a pointer to the parent for its constructor), then use a
`ScopedPointer`.
* If possible, pass an object as a reference rather than a pointer. If possible,
make it a `const` reference.
* Obviously avoid static and global values. Sometimes there's no alternative,
but if there is an alternative, then use it, no matter how much effort it
involves.
* If allocating a local POD structure (e.g. an operating-system structure in
native code), and you need to initialise it with zeros, use the `= { 0 };`
syntax as your first choice for doing this. If for some reason that's not
appropriate, use the `zerostruct()` function, or in case that isn't suitable,
use `zeromem()`. Don't use `memset()`.
## Classes
* Declare a class's public section first, and put its constructors and
destructor first. Any protected items come next, and then private ones.
* Use the most restrictive access-specifier possible for each member. Prefer
`private` over `protected`, and `protected` over `public`. Don't expose
things unnecessarily.
* Preferred positioning for any inherited classes is to put them to the right
of the class name, vertically aligned, e.g.:
class Thing : public Foo,
private Bar
{
}
* Put a class's member variables (which should almost always be private, of course),
after all the public and protected method declarations.
* Any private methods can go towards the end of the class, after the member
variables.
* If your class does not have copy-by-value semantics, derive the class from
`Uncopyable`.
* If your class is likely to be leaked, then derive your class from
`LeakChecked<>`.
* Constructors that take a single parameter should be default be marked
`explicit`. Obviously there are cases where you do want implicit conversion,
but always think about it carefully before writing a non-explicit constructor.
* Do not use `NULL`, `null`, or 0 for a null-pointer. And especially never use
'0L', which is particulary burdensome. Use `nullptr` instead - this is the
C++2011 standard, so get used to it. There's a fallback definition for `nullptr`
in Beast, so it's always possible to use it even if your compiler isn't yet
C++2011 compliant.
* All the C++ 'guru' books and articles are full of excellent and detailed advice
on when it's best to use inheritance vs composition. If you're not already
familiar with the received wisdom in these matters, then do some reading!
## Miscellaneous
* Constrain the scope of identifiers to the smallest area that needs it. Consider
using nested classes or classes inside functions, if doing so will expose less
interface and implementation overall.
* `goto` statements should not be used at all, even if the alternative is
more verbose code. The only exception is when implementing an algorithm in
a function as a state machine.
* Don't use macros! OK, obviously there are many situations where they're the
right tool for the job, but treat them as a last resort. Certainly don't ever
use a macro just to hold a constant value or to perform any kind of function
that could have been done as a real inline function. And it goes without saying
that you should give them names which aren't going to clash with other code.
And `#undef` them after you've used them, if possible.
* When using the `++` or `--` operators, never use post-increment if
pre-increment could be used instead. Although it doesn't matter for
primitive types, it's good practice to pre-increment since this can be
much more efficient for more complex objects. In particular, if you're
writing a for loop, always use pre-increment,
e.g. `for (int = 0; i < 10; ++i)`
* Never put an "else" statement after a "return"! This is well-explained in the
LLVM coding standards...and a couple of other very good pieces of advice from
the LLVM standards are in there as well.
* When getting a possibly-null pointer and using it only if it's non-null, limit
the scope of the pointer as much as possible - e.g. Do NOT do this:
Foo* f = getFoo ();
if (f != nullptr)
f->doSomething ();
// other code
f->doSomething (); // oops! f may be null!
..instead, prefer to write it like this, which reduces the scope of the
pointer, making it impossible to write code that accidentally uses a null
pointer:
if (Foo* f = getFoo ())
f->doSomethingElse ();
// f is out-of-scope here, so impossible to use it if it's null
(This also results in smaller, cleaner code)
[1]: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[2]: http://en.wikipedia.org/wiki/Indent_style#Allman_style

View File

@@ -1,303 +0,0 @@
# Doxyfile 1.8.3.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Beast"
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = Docs
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
AUTOLINK_SUPPORT = YES
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = modules
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
RECURSIVE = YES
EXCLUDE = modules/beast_core/beast_core.h \
modules/beast_core/beast_core.cpp \
modules/beast_basics/beast_basics.h \
modules/beast_basics/beast_basics.cpp \
modules/beast_basics/native \
modules/beast_basics/zip/zlib
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@@ -1,85 +0,0 @@
--------------------------------------------------------------------------------
BEAST TODO
--------------------------------------------------------------------------------
- Use SemanticVersion for beast version numbers to replace BEAST_VERSION
- add support for a __PRETTY_FUNCTION__ equivalent for all environments
- add expectThrow() to UnitTest, where it expects an exception
- Import secp256k1 from sipa
- HashMap work:
- Add unit test
- Return size_t from hash function, take out upperLimit, move mod % to caller
- Make hash function a functor using operator()
- Implement HardenedHashFunctions
- Fix problem with assigning to the result of operator[] maybe use a proxy?
- Set sqlite thread safety model to '2' in beast_sqlite
- Document and rename all the sqdb files and classes
- Specialize UnsignedInteger<> for peformance in the storage format
- Macro for acquiring a ScopedLock that records file and line.
- Rename HeapBlock routines to not conflict with _CRTDBG_MAP_ALLOC macros
- Design a WeakPtr / SharedPtr / SharedObject intrusive system
- Implement beast::Bimap?
- Use Bimap for storage in the DeadlineTimer::Manager, to support
thousands of timers.
- Think about adding a shouldStop bool to InterruptibleThread, along
with a shouldStop () function returning bool, and a stop() method.
- Make OwnedArray add routines return a pointer instead of reference
- Tidy up CacheLine, MemoryAlignment
- Remove anything having to do with DLL builds like
BEAST_DLL, BEAST_DLL_BUILD, BEAST_DISABLE_DLL_ALLOCATORS
- Fix FifoFreeStoreWithTLS reference counting bug
- Implement a reasonable substitute for boost's thread_local_storage
- Think about doing away with BEAST_CALLTYPE and BEAST_API
- Decide if headers should just include BeastConfig.h instead of making the
host program do it.
- Rename malloc/calloc JUCE members that conflict with the debug CRT from MSVC
- Make beast::HashMap support assignment via operator[]
- Reformat every Doxygen comment
- Fix Doxygen metatags
- update Beast Doxyfile
- Rename include guards to boost style, e.g. BEAST_THROW_H_INCLUDED
- Decide if we should get rid of AtomicCounter, AtomicFlag, AtomicPointer, AtomicState
- Clean up CacheLine, StaticObject
- Clean up ConcurrentObject
- Rename SharedData to SharedState or something?
- Figure out what to do with ReadWriteLock, and NamedPipe which uses it?
- Put BEAST_PUBLIC_FUNCTION in front of all loose functions
- restructure the repo sources to look like this:
/Source/beast/beast_core/beast_core.h
etc...
- Put the BeastConfig.h at the root of the repo.
- Make sure the template BeastConfig.h is included in the Doxyfile
- Implement robust key/value database with bulk write

View File

@@ -1,103 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_BUFFERTYPE_H_INCLUDED
#define BEAST_BUFFERTYPE_H_INCLUDED
/** Storage for a BufferSequence.
Meets these requirements:
BufferSequence
ConstBufferSequence (when Buffer is mutable_buffer)
MutableBufferSequence (when Buffer is const_buffer)
*/
template <class Buffer>
class BufferType
{
public:
typedef Buffer value_type;
typedef typename std::vector <Buffer>::const_iterator const_iterator;
BufferType ()
: m_size (0)
{
}
template <class OtherBuffers>
explicit BufferType (OtherBuffers const& buffers)
: m_size (0)
{
m_buffers.reserve (std::distance (buffers.begin (), buffers.end ()));
BOOST_FOREACH (typename OtherBuffers::value_type buffer, buffers)
{
m_size += boost::asio::buffer_size (buffer);
m_buffers.push_back (buffer);
}
}
/** Determine the total size of all buffers.
This is faster than calling boost::asio::buffer_size.
*/
std::size_t size () const noexcept
{
return m_size;
}
const_iterator begin () const noexcept
{
return m_buffers.begin ();
}
const_iterator end () const noexcept
{
return m_buffers.end ();
}
/** Retrieve a consumed BufferSequence. */
BufferType consumed (std::size_t bytes) const
{
BufferType result;
result.m_buffers.reserve (m_buffers.size ());
BOOST_FOREACH (Buffer buffer, m_buffers)
{
std::size_t const have = boost::asio::buffer_size (buffer);
std::size_t const reduce = std::min (bytes, have);
bytes -= reduce;
if (have > reduce)
result.m_buffers.push_back (buffer + reduce);
}
return result;
}
private:
std::size_t m_size;
std::vector <Buffer> m_buffers;
};
typedef boost::asio::const_buffer ConstBuffer;
typedef boost::asio::mutable_buffer MutableBuffer;
/** Meets the requirements of ConstBufferSequence */
typedef BufferType <ConstBuffer> ConstBuffers;
/** Meets the requirements of MutableBufferSequence */
typedef BufferType <MutableBuffer> MutableBuffers;
#endif

View File

@@ -1,75 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_COMPLETIONCALL_H_INCLUDED
#define BEAST_COMPLETIONCALL_H_INCLUDED
// Meets these requirements:
//
// CompletionHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/CompletionHandler.html
//
class CompletionCall
{
public:
typedef void result_type;
template <class Handler>
CompletionCall (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_call (new CallType <Handler> (BOOST_ASIO_MOVE_CAST(Handler)(handler)))
{
}
CompletionCall (CompletionCall const& other)
: m_call (other.m_call)
{
}
void operator() ()
{
(*m_call) ();
}
private:
struct Call : SharedObject, LeakChecked <Call>
{
virtual void operator() () = 0;
};
template <class Handler>
struct CallType : Call
{
CallType (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_handler (handler)
{
}
void operator() ()
{
m_handler ();
}
Handler m_handler;
};
private:
SharedObjectPtr <Call> m_call;
};
#endif

View File

@@ -1,84 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_ERRORCALL_H_INCLUDED
#define BEAST_ERRORCALL_H_INCLUDED
// Meets these requirements:
//
// AcceptHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AcceptHandler.html
//
// ConnectHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ConnectHandler.html
//
// ShutdownHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ShutdownHandler.html
//
// HandshakeHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/HandshakeHandler.html
//
class ErrorCall
{
public:
typedef void result_type;
template <class Handler>
ErrorCall (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_call (new CallType <Handler> (BOOST_ASIO_MOVE_CAST(Handler)(handler)))
{
}
ErrorCall (ErrorCall const& other)
: m_call (other.m_call)
{
}
void operator() (boost::system::error_code const& ec)
{
(*m_call) (ec);
}
private:
struct Call : SharedObject, LeakChecked <Call>
{
virtual void operator() (boost::system::error_code const&) = 0;
};
template <class Handler>
struct CallType : Call
{
CallType (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_handler (handler)
{
}
void operator() (boost::system::error_code const& ec)
{
m_handler (ec);
}
Handler m_handler;
};
private:
SharedObjectPtr <Call> m_call;
};
#endif

View File

@@ -1,44 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
PeerRole::PeerRole (role_t role)
: m_role (role)
{
}
String PeerRole::name () const noexcept
{
if (m_role == server)
return "server";
return "client";
}
bool PeerRole::operator== (role_t role) const noexcept
{
return m_role == role;
}
#if 0
PeerRole::operator Socket::handshake_type () const noexcept
{
if (m_role == server)
return Socket::server;
return Socket::client;
}
#endif

View File

@@ -1,40 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_PEERROLE_H_INCLUDED
#define BEAST_PEERROLE_H_INCLUDED
/** Identifies if the peer is a client or a server. */
struct PeerRole
{
enum role_t
{
client,
server
};
PeerRole (role_t role);
String name () const noexcept;
bool operator== (role_t role) const noexcept;
private:
role_t m_role;
};
#endif

View File

@@ -1,81 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TRANSFERCALL_H_INCLUDED
#define BEAST_TRANSFERCALL_H_INCLUDED
// Meets these requirements
//
// ReadHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ReadHandler.html
//
// WriteHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/WriteHandler.html
//
// BUfferedHandshakeHandler
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/BufferedHandshakeHandler.html
//
class TransferCall
{
public:
typedef void result_type;
template <class Handler>
TransferCall (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_call (new CallType <Handler> (BOOST_ASIO_MOVE_CAST(Handler)(handler)))
{
}
TransferCall (TransferCall const& other)
: m_call (other.m_call)
{
}
void operator() (boost::system::error_code const& ec, std::size_t bytes_transferred)
{
(*m_call) (ec, bytes_transferred);
}
private:
struct Call : SharedObject, LeakChecked <Call>
{
virtual void operator() (boost::system::error_code const&, std::size_t) = 0;
};
template <class Handler>
struct CallType : Call
{
CallType (BOOST_ASIO_MOVE_ARG(Handler) handler)
: m_handler (handler)
{
}
void operator() (boost::system::error_code const& ec, std::size_t bytes_transferred)
{
m_handler (ec, bytes_transferred);
}
Handler m_handler;
};
private:
SharedObjectPtr <Call> m_call;
};
#endif

View File

@@ -1,46 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include "BeastConfig.h"
#include "beast_asio.h"
namespace beast
{
#include "basics/beast_PeerRole.cpp"
#include "sockets/beast_SocketBase.cpp"
#include "sockets/beast_Socket.cpp"
#include "sockets/beast_SslContext.cpp"
#include "protocol/beast_ProxyHandshake.cpp"
#include "protocol/beast_StreamHandshakeDetectorType.cpp"
#include "tests/beast_TestPeerBasics.cpp"
#include "tests/beast_TestPeerLogic.cpp"
#include "tests/beast_TestPeerLogicSyncServer.cpp"
#include "tests/beast_TestPeerLogicSyncClient.cpp"
#include "tests/beast_TestPeerLogicAsyncServer.cpp"
#include "tests/beast_TestPeerLogicAsyncClient.cpp"
#include "tests/beast_PeerTest.cpp"
#include "tests/beast_TestPeerUnitTests.cpp"
}

View File

@@ -1,85 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_ASIO_H_INCLUDED
#define BEAST_ASIO_H_INCLUDED
//------------------------------------------------------------------------------
/* If you fail to make sure that all your compile units are building Beast with
the same set of option flags, then there's a risk that different compile
units will treat the classes as having different memory layouts, leading to
very nasty memory corruption errors when they all get linked together.
That's why it's best to always include the BeastConfig.h file before any
beast headers.
*/
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
# ifdef _MSC_VER
# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?")
# else
# warning "Have you included your BeastConfig.h file before including the Beast headers?"
# endif
#endif
// Must come before boost includes to fix the bost placeholders.
#include "../beast_core/beast_core.h"
/* This module requires boost and possibly OpenSSL */
#include "system/beast_BoostIncludes.h"
namespace beast
{
// Order matters
#include "basics/beast_PeerRole.h"
#include "basics/beast_BufferType.h"
#include "basics/beast_CompletionCall.h"
#include "basics/beast_ErrorCall.h"
#include "basics/beast_TransferCall.h"
#include "sockets/beast_SocketBase.h"
#include "sockets/beast_Socket.h"
#include "sockets/beast_SocketInterface.h"
#include "sockets/beast_SocketWrapperBasics.h"
#include "sockets/beast_SocketWrapper.h"
#include "sockets/beast_SharedSocket.h"
#include "sockets/beast_SslContext.h"
#include "protocol/beast_ProxyHandshake.h"
#include "protocol/beast_HandshakeDetectorType.h"
#include "protocol/beast_StreamHandshakeDetectorType.h"
#include "tests/beast_TestPeerBasics.h"
#include "tests/beast_TestPeer.h"
#include "tests/beast_TestPeerDetails.h"
#include "tests/beast_TestPeerLogic.h"
#include "tests/beast_TestPeerLogicSyncServer.h"
#include "tests/beast_TestPeerLogicSyncClient.h"
#include "tests/beast_TestPeerLogicProxyClient.h"
#include "tests/beast_TestPeerLogicAsyncServer.h"
#include "tests/beast_TestPeerLogicAsyncClient.h"
#include "tests/beast_TestPeerType.h"
#include "tests/beast_TestPeerDetailsTcp.h"
#include "tests/beast_PeerTest.h"
}
#endif

View File

@@ -1,344 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_HANDSHAKEDETECTORTYPE_H_INCLUDED
#define BEAST_HANDSHAKEDETECTORTYPE_H_INCLUDED
class DetectPolicy
{
public:
DetectPolicy ()
: m_finished (false)
, m_success (false)
{
}
/** Returns the minimum number of bytes we need to succeed.
*/
virtual std::size_t needed () = 0;
/** Returns true if the return value of success() is valid.
*/
bool finished () const noexcept
{
return m_finished;
}
/** Returns true if the buffers matched the Handshake
*/
bool success () const noexcept
{
bassert (m_finished);
return m_success;
}
protected:
void conclude (bool success = true)
{
m_finished = true;
m_success = success;
}
void fail ()
{
conclude (false);
}
//--------------------------------------------------------------------------
/** Represents a small, fixed size buffer.
This provides a convenient interface for doing a bytewise
verification/reject test on a handshake protocol.
*/
template <int Bytes>
struct Input
{
template <typename ConstBufferSequence>
explicit Input (ConstBufferSequence const& buffer)
: m_buffer (boost::asio::buffer (m_storage))
, m_size (boost::asio::buffer_copy (m_buffer, buffer))
, m_data (boost::asio::buffer_cast <uint8 const*> (m_buffer))
{
}
#if 0
uint8 const* data () const noexcept
{
return m_data;
}
#endif
uint8 operator[] (std::size_t index) const noexcept
{
bassert (index >= 0 && index < m_size);
return m_data [index];
}
bool peek (std::size_t bytes) const noexcept
{
if (m_size >= bytes)
return true;
return false;
}
template <typename T>
bool peek (T* t) noexcept
{
std::size_t const bytes = sizeof (T);
if (m_size >= bytes)
{
std::copy (m_data, m_data + bytes, t);
return true;
}
return false;
}
bool consume (std::size_t bytes) noexcept
{
if (m_size >= bytes)
{
m_data += bytes;
m_size -= bytes;
return true;
}
return false;
}
template <typename T>
bool read (T* t) noexcept
{
std::size_t const bytes = sizeof (T);
if (m_size >= bytes)
{
//this causes a stack corruption.
//std::copy (m_data, m_data + bytes, t);
memcpy (t, m_data, bytes);
m_data += bytes;
m_size -= bytes;
return true;
}
return false;
}
// Reads an integraltype in network byte order
template <typename IntegerType>
bool readNetworkInteger (IntegerType* value)
{
// Must be an integral type!
// not available in all versions of std:: unfortunately
//static_bassert (std::is_integral <IntegerType>::value);
IntegerType networkValue;
if (! read (&networkValue))
return false;
*value = fromNetworkByteOrder (networkValue);
return true;
}
private:
boost::array <uint8, Bytes> m_storage;
MutableBuffer m_buffer;
std::size_t m_size;
uint8 const* m_data;
};
private:
bool m_finished;
bool m_success;
};
// Handshake for SSL 2
//
// http://tools.ietf.org/html/rfc5246#appendix-E.2
//
// uint8 V2CipherSpec[3];
// struct {
// uint16 msg_length;
// uint8 msg_type;
// Version version; Should be 'ProtocolVersion'?
// uint16 cipher_spec_length;
// uint16 session_id_length;
// uint16 challenge_length;
// ...
//
class SSL2 : public DetectPolicy
{
public:
typedef int arg_type;
explicit SSL2 (arg_type const&)
{
}
enum
{
bytesNeeded = 3
};
std::size_t needed ()
{
return bytesNeeded;
}
template <typename ConstBufferSequence>
void analyze (ConstBufferSequence const& buffer)
{
Input <bytesNeeded> in (buffer);
{
uint8 byte;
if (! in.peek (&byte))
return;
// First byte must have the high bit set
//
if((byte & 0x80) != 0x80)
return fail ();
}
// The remaining bits contain the
// length of the following data in bytes.
//
uint16 msg_length;
if (! in.readNetworkInteger(&msg_length))
return;
// sizeof (msg_type +
// Version (ProtcolVersion?) +
// cipher_spec_length +
// session_id_length +
// challenge_length)
//
// Should be 9 or greater.
//
if (msg_length < 9)
return fail ();
uint8 msg_type;
if (! in.read (&msg_type))
return;
// The msg_type must be 0x01 for a version 2 ClientHello
//
if (msg_type != 0x01)
return fail ();
conclude ();
}
};
// Handshake for SSL 3 (Also TLS 1.0 and 1.1)
//
// http://www.ietf.org/rfc/rfc2246.txt
//
// Section 7.4. Handshake protocol
//
class SSL3 : public DetectPolicy
{
public:
typedef int arg_type; // dummy
explicit SSL3 (arg_type const&)
{
}
enum
{
bytesNeeded = 6
};
std::size_t needed ()
{
return bytesNeeded;
}
template <typename ConstBufferSequence>
void analyze (ConstBufferSequence const& buffer)
{
uint16 version;
Input <bytesNeeded> in (buffer);
uint8 msg_type;
if (! in.read (&msg_type))
return;
// msg_type must be 0x16 = "SSL Handshake"
//
if (msg_type != 0x16)
return fail ();
if (! in.read (&version))
return;
version = fromNetworkByteOrder (version);
uint16 length;
if (! in.read (&length))
return;
length = fromNetworkByteOrder (length);
conclude ();
}
};
//--------------------------------------------------------------------------
template <typename Logic>
class HandshakeDetectorType
{
public:
typedef typename Logic::arg_type arg_type;
explicit HandshakeDetectorType (arg_type const& arg = arg_type ())
: m_logic (arg)
{
}
std::size_t needed () noexcept
{
return m_logic.needed ();
}
bool finished () noexcept
{
return m_logic.finished ();
}
/** If finished is true, this tells us if the handshake was detected.
*/
bool success () noexcept
{
return m_logic.success ();
}
/** Analyze the buffer to match the Handshake.
Returns `true` if the analysis is complete.
*/
template <typename ConstBufferSequence>
bool analyze (ConstBufferSequence const& buffer)
{
bassert (! m_logic.finished ());
m_logic.analyze (buffer);
return m_logic.finished ();
}
private:
Logic m_logic;
};
#endif

View File

@@ -1,384 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
ProxyHandshake::ProxyHandshake (bool expectHandshake)
: m_status (expectHandshake ? statusHandshake : statusNone)
, m_gotCR (false)
{
m_buffer.preallocateBytes (maxVersion1Bytes);
}
ProxyHandshake::~ProxyHandshake ()
{
}
std::size_t ProxyHandshake::feed (void const* inputBuffer, size_t inputBytes)
{
std::size_t bytesConsumed = 0;
char const* p = static_cast <char const*> (inputBuffer);
if (m_status == statusHandshake)
{
if (! m_gotCR)
{
while (inputBytes > 0 && m_buffer.length () < maxVersion1Bytes - 1)
{
beast_wchar c = *p++;
++bytesConsumed;
--inputBytes;
m_buffer += c;
if (c == '\r')
{
m_gotCR = true;
break;
}
else if (c == '\n')
{
m_status = statusFailed;
}
}
if (m_buffer.length () > maxVersion1Bytes - 1)
{
m_status = statusFailed;
}
}
}
if (m_status == statusHandshake)
{
if (inputBytes > 0 && m_gotCR)
{
bassert (m_buffer.length () < maxVersion1Bytes);
char const lf ('\n');
if (*p == lf)
{
++bytesConsumed;
--inputBytes;
m_buffer += lf;
parseLine ();
}
else
{
m_status = statusFailed;
}
}
}
return bytesConsumed;
}
void ProxyHandshake::parseLine ()
{
Version1 p;
bool success = p.parse (m_buffer.getCharPointer (), m_buffer.length ());
if (success)
{
m_endpoints = p.endpoints;
m_status = statusOk;
}
else
{
m_status = statusFailed;
}
}
int ProxyHandshake::indexOfFirstNonNumber (String const& input)
{
bassert (input.length () > 0);
int i = 0;
for (; i < input.length (); ++i)
{
if (! CharacterFunctions::isDigit (input [i]))
break;
}
return i;
}
bool ProxyHandshake::chop (String const& what, String& input)
{
if (input.startsWith (what))
{
input = input.substring (what.length ());
return true;
}
return false;
}
bool ProxyHandshake::chopUInt (int* value, int limit, String& input)
{
if (input.length () <= 0)
return false;
String const s = input.substring (0, indexOfFirstNonNumber (input));
if (s.length () <= 0)
return false;
int const n = s.getIntValue ();
// Leading zeroes disallowed as per spec, to prevent confusion with octal
if (String (n) != s)
return false;
if (n < 0 || n > limit)
return false;
input = input.substring (s.length ());
*value = n;
return true;
}
//------------------------------------------------------------------------------
/*
steps:
Proxy protocol lets us filter attackers by learning the source ip and port
1. Determine if we should use the proxy on a connection
- Port just for proxy protocol connections
- Filter on source IPs
2. Read a line from the connection to get the proxy information
3. Parse the line (human or binary?)
4. Code Interface to retrieve proxy information (ip/port) on connection
*/
ProxyHandshake::Version1::Version1 ()
{
}
bool ProxyHandshake::IPv4::Addr::chop (String& input)
{
if (!ProxyHandshake::chopUInt (&a, 255, input))
return false;
if (!ProxyHandshake::chop (".", input))
return false;
if (!ProxyHandshake::chopUInt (&b, 255, input))
return false;
if (!ProxyHandshake::chop (".", input))
return false;
if (!ProxyHandshake::chopUInt (&c, 255, input))
return false;
if (!ProxyHandshake::chop (".", input))
return false;
if (!ProxyHandshake::chopUInt (&d, 255, input))
return false;
return true;
}
bool ProxyHandshake::Version1::parse (void const* headerData, size_t headerBytes)
{
String input (static_cast <CharPointer_UTF8::CharType const*> (headerData), headerBytes);
if (input.length () < 2)
return false;
if (! input.endsWith ("\r\n"))
return false;
input = input.dropLastCharacters (2);
if (! ProxyHandshake::chop ("PROXY ", input))
return false;
if (ProxyHandshake::chop ("UNKNOWN", input))
{
endpoints.proto = protoUnknown;
input = "";
}
else
{
if (ProxyHandshake::chop ("TCP4 ", input))
{
endpoints.proto = protoTcp4;
if (! endpoints.ipv4.sourceAddr.chop (input))
return false;
if (! ProxyHandshake::chop (" ", input))
return false;
if (! endpoints.ipv4.destAddr.chop (input))
return false;
if (! ProxyHandshake::chop (" ", input))
return false;
if (! ProxyHandshake::chopUInt (&endpoints.ipv4.sourcePort, 65535, input))
return false;
if (! ProxyHandshake::chop (" ", input))
return false;
if (! ProxyHandshake::chopUInt (&endpoints.ipv4.destPort, 65535, input))
return false;
}
else if (ProxyHandshake::chop ("TCP6 ", input))
{
endpoints.proto = protoTcp6;
//bassertfalse;
return false;
}
else
{
return false;
}
}
// Can't have anything extra between the last port number and the CRLF
if (input.length () > 0)
return false;
return true;
}
//------------------------------------------------------------------------------
class ProxyHandshakeTests : public UnitTest
{
public:
ProxyHandshakeTests () : UnitTest ("ProxyHandshake", "beast")
{
}
static std::string goodIpv4 ()
{
return "PROXY TCP4 255.255.255.255 255.255.255.255 65535 65535\r\n"; // 56 chars
}
static std::string goodIpv6 ()
{
return "PROXY TCP6 fffffffffffffffffffffffffffffffffffffff.fffffffffffffffffffffffffffffffffffffff 65535 65535\r\n";
//1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123 4 (104 chars)
}
static std::string goodUnknown ()
{
return "PROXY UNKNOWN\r\n";
}
static std::string goodUnknownBig ()
{
return "PROXY UNKNOWN fffffffffffffffffffffffffffffffffffffff.fffffffffffffffffffffffffffffffffffffff 65535 65535\r\n";
//1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 7 (107 chars)
}
void testHandshake (std::string const& s, bool shouldSucceed)
{
if (s.size () > 1)
{
ProxyHandshake h (true);
expect (h.getStatus () == ProxyHandshake::statusHandshake);
for (std::size_t i = 0; i < s.size () && h.getStatus () == ProxyHandshake::statusHandshake ; ++i)
{
std::size_t const bytesConsumed = h.feed (& s[i], 1);
if (i != s.size () - 1)
expect (h.getStatus () == ProxyHandshake::statusHandshake);
expect (bytesConsumed == 1);
}
if (shouldSucceed)
{
expect (h.getStatus () == ProxyHandshake::statusOk);
}
else
{
expect (h.getStatus () == ProxyHandshake::statusFailed);
}
}
else
{
bassertfalse;
}
}
void testVersion1String (std::string const& s, bool shouldSucceed)
{
ProxyHandshake::Version1 p;
if (shouldSucceed)
{
expect (p.parse (s.c_str (), s.size ()));
}
else
{
unexpected (p.parse (s.c_str (), s.size ()));
}
for (std::size_t i = 1; i < s.size () - 1; ++i)
{
String const partial = String (s).dropLastCharacters (i);
std::string ss (partial.toStdString ());
expect (! p.parse (ss.c_str (), ss.size ()));
}
testHandshake (s, shouldSucceed);
}
void testVersion1 ()
{
beginTestCase ("version1");
testVersion1String (goodIpv4 (), true);
testVersion1String (goodIpv6 (), false);
testVersion1String (goodUnknown (), true);
testVersion1String (goodUnknownBig (), true);
}
void runTest ()
{
testVersion1 ();
}
};
static ProxyHandshakeTests proxyHandshakeTests;

View File

@@ -1,164 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_PROXYYHANDSHAKE_H_INCLUDED
#define BEAST_PROXYYHANDSHAKE_H_INCLUDED
/** PROXY protocol handshake state machine.
The PROXY Protocol:
http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt
*/
class ProxyHandshake
{
public:
/** Status of the handshake state machine. */
enum Status
{
statusNone, // No handshake expected
statusHandshake, // Handshake in progress
statusFailed, // Handshake failed
statusOk, // Handshake succeeded
};
enum Proto
{
protoTcp4,
protoTcp6,
protoUnknown
};
/** PROXY information for IPv4 families. */
struct IPv4
{
struct Addr
{
int a;
int b;
int c;
int d;
bool chop (String& input);
};
Addr sourceAddr;
Addr destAddr;
int sourcePort;
int destPort;
};
/** PROXY information for IPv6 families. */
struct IPv6
{
struct Addr
{
int a;
int b;
int c;
int d;
};
Addr sourceAddr;
Addr destAddr;
int sourcePort;
int destPort;
};
/** Fully decoded PROXY information. */
struct Endpoints
{
Endpoints ()
: proto (protoUnknown)
{
}
Proto proto;
IPv4 ipv4; // valid if proto == protoTcp4
IPv6 ipv6; // valid if proto == protoTcp6;
};
//--------------------------------------------------------------------------
/** Parser for PROXY version 1. */
struct Version1
{
enum
{
// Maximum input buffer size needed, including a null
// terminator, as per the PROXY protocol specification.
maxBufferBytes = 108
};
Endpoints endpoints;
Version1 ();
/** Parse the header.
@param rawHeader a pointer to the header data
@return `true` If it was parsed successfully.
*/
bool parse (void const* headerData, size_t headerBytes);
};
//--------------------------------------------------------------------------
/** Create the handshake state.
If a handshake is expected, then it is required.
@param wantHandshake `false` to skip handshaking.
*/
explicit ProxyHandshake (bool expectHandshake = false);
~ProxyHandshake ();
inline Status getStatus () const noexcept
{
return m_status;
}
inline Endpoints const& getEndpoints () const noexcept
{
return m_endpoints;
};
/** Feed the handshaking state engine.
@return The number of bytes consumed in the input buffer.
*/
std::size_t feed (void const* inputBuffer, std::size_t inputBytes);
// Utility functions used by parsers
static int indexOfFirstNonNumber (String const& input);
static bool chop (String const& what, String& input);
static bool chopUInt (int* value, int limit, String& input);
private:
void parseLine ();
private:
enum
{
maxVersion1Bytes = 107 // including crlf, not including null term
};
Status m_status;
String m_buffer;
bool m_gotCR;
Endpoints m_endpoints;
};
#endif

View File

@@ -1,19 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================

View File

@@ -1,78 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_STREAMHANDSHAKEDETECTORTYPE_H_INCLUDED
#define BEAST_STREAMHANDSHAKEDETECTORTYPE_H_INCLUDED
/** Wraps a HandshakeDetector and does the work on the Socket for you.
*/
template <class Detector>
class StreamHandshakeDetectorType
{
protected:
typedef boost::system::error_code error_code;
typedef StreamHandshakeDetectorType <Detector> This;
public:
typedef typename Detector::arg_type arg_type;
explicit StreamHandshakeDetectorType (arg_type const& arg = arg_type ())
{
}
template <typename HandshakeHandler>
void async_handshake (Socket& socket, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler)
{
#if 0
std::size_t const bytes = m_detector.needed ();
#if 1
boost::asio::async_read (socket, m_buffer.prepare (bytes), boost::bind (
&This::on_read <typename HandshakeHandler>, this, &socket,
handler,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
#else
boost::asio::async_read (socket, m_buffer.prepare (bytes), boost::bind (
&This::on_read2, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
#endif
#endif
}
protected:
template <typename HandshakeHandler>
void on_read (Socket* socket, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler,
error_code const& ec, std::size_t bytes_transferred)
{
m_buffer.commit (bytes_transferred);
if (m_detector.analyze (m_buffer.data ()))
{
if (m_detector.success ())
{
//socket->async_handshake (Socket::server, m_buffer.data (), handler);
}
}
}
private:
Detector m_detector;
boost::asio::streambuf m_buffer;
};
#endif

View File

@@ -1,83 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SHAREDSOCKET_H_INCLUDED
#define BEAST_SHAREDSOCKET_H_INCLUDED
/** A Socket interface with reference counting.
You can keep a pointer to the base class so that you don't have
to see the template or underlying object implementation.
@see SharedSocketTYpe, SharedObjectPtr
*/
/** @{ */
class SharedSocket
: public SharedObject
, public virtual Socket
{
public:
/** Store your SharedSocket in one of these! */
typedef SharedObjectPtr <SharedSocket> Ptr;
};
//------------------------------------------------------------------------------
/** A RAII container for wrapping an object as a Socket.
To use this, construct the class with an instance of your object
created with operator new. The constructor will take ownership,
and delete it when the last reference is removed. For example:
@code
boost::asio::io_service ios;
boost::asio::ssl:context ctx;
SharedSocket::Ptr mySocket (
new (boost::asio::ssl::stream (ios, ctx)));
mySocket->handshake ();
@endcode
@see SharedSocket
*/
template <class Object>
class SharedSocketType
: public SharedSocket
, public SocketWrapper <Object>
{
public:
/** Create the shared socket.
This takes posession of the object, which will be deleted
when the last reference goes away.
*/
SharedSocketType (Object* object)
: SocketWrapper <Object> (object)
, m_object (object)
{
}
private:
ScopedPointer <Object> m_object;
};
/** @} */
#endif

View File

@@ -1,277 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
Socket::~Socket ()
{
}
//-----------------------------------------------------------------------------
//
// basic_io_object
//
boost::asio::io_service& Socket::get_io_service ()
{
pure_virtual ();
return *static_cast <boost::asio::io_service*>(nullptr);
}
//-----------------------------------------------------------------------------
//
// basic_socket
//
void* Socket::lowest_layer (char const*) const
{
pure_virtual ();
return nullptr;
}
void* Socket::native_handle (char const*) const
{
pure_virtual ();
return nullptr;
}
boost::system::error_code Socket::cancel (boost::system::error_code& ec)
{
return pure_virtual (ec);
}
boost::system::error_code Socket::shutdown (shutdown_type, boost::system::error_code& ec)
{
return pure_virtual (ec);
}
boost::system::error_code Socket::close (boost::system::error_code& ec)
{
return pure_virtual (ec);
}
//------------------------------------------------------------------------------
//
// basic_socket_acceptor
//
boost::system::error_code Socket::accept (Socket&, boost::system::error_code& ec)
{
return pure_virtual (ec);
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (boost::system::error_code))
Socket::async_accept (Socket&, BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ErrorCall, void (boost::system::error_code)> init(
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
#endif
}
//------------------------------------------------------------------------------
//
// basic_stream_socket
//
std::size_t Socket::read_some (MutableBuffers const&, boost::system::error_code& ec)
{
pure_virtual (ec);
return 0;
}
std::size_t Socket::write_some (ConstBuffers const&, boost::system::error_code& ec)
{
pure_virtual (ec);
return 0;
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (boost::system::error_code, std::size_t))
Socket::async_read_some (MutableBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
TransferCall, void (boost::system::error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
#endif
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (boost::system::error_code, std::size_t))
Socket::async_write_some (ConstBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
TransferCall, void (boost::system::error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
#endif
}
//--------------------------------------------------------------------------
//
// ssl::stream
//
bool Socket::requires_handshake ()
{
return false;
}
boost::system::error_code Socket::handshake (handshake_type, boost::system::error_code& ec)
{
return pure_virtual (ec);
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (boost::system::error_code))
Socket::async_handshake (handshake_type, BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ErrorCall, void (boost::system::error_code)> init(
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
#endif
}
#if BEAST_ASIO_HAS_BUFFEREDHANDSHAKE
boost::system::error_code Socket::handshake (handshake_type,
ConstBuffers const&, boost::system::error_code& ec)
{
return pure_virtual (ec);
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (boost::system::error_code, std::size_t))
Socket::async_handshake (handshake_type, ConstBuffers const&,
BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
TransferCall, void (boost::system::error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
#endif
}
#endif
boost::system::error_code Socket::shutdown (boost::system::error_code& ec)
{
return pure_virtual (ec);
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (boost::system::error_code))
Socket::async_shutdown (BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ErrorCall, void (boost::system::error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
return init.result.get();
#else
boost::system::error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
#endif
}
//------------------------------------------------------------------------------
/* members, and the most common base class in which they appear:
basic_io_object
io_service& get_io_service ()
basic_socket <Protocol> : basic_io_object
typedef protocol_type
typedef lowest_layer_type
lowest_layer_type& lowest_layer ()
lowest_layer_type const& lowest_layer () const
native_handle ()
cancel ()
shutdon (shutdown_type)
close ()
<various>
basic_socket_acceptor <Protocol> : basic_io_object
typedef protocol_type
native_handle ()
listen ()
accept ()
async_accept ()
cancel ()
close ()
basic_stream_socket <Protocol> : basic_socket <Protocol>
ssl::stream
handshake ()
async_handshake ()
shutdown ()
*/

View File

@@ -1,360 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SOCKET_H_INCLUDED
#define BEAST_SOCKET_H_INCLUDED
/** A high level socket abstraction.
This combines the capabilities of multiple socket interfaces such
as listening, connecting, streaming, and handshaking. It brings
everything together into a single abstract interface.
When member functions are called and the underlying implementation does
not support the operation, a fatal error is generated.
*/
class Socket
: public SocketBase
, public boost::asio::ssl::stream_base
, public boost::asio::socket_base
{
protected:
typedef boost::system::error_code error_code;
public:
virtual ~Socket ();
//--------------------------------------------------------------------------
//
// basic_io_object
//
virtual boost::asio::io_service& get_io_service ();
//--------------------------------------------------------------------------
//
// basic_socket
//
/** Retrieve the lowest layer object.
Note that you must know the type name for this to work, or
else a fatal error will occur.
*/
/** @{ */
template <class Object>
Object& lowest_layer ()
{
Object* object (this->lowest_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
return *object;
}
template <class Object>
Object const& lowest_layer () const
{
Object const* object (this->lowest_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
return *object;
}
template <class Object>
Object* lowest_layer_ptr ()
{
return static_cast <Object*> (
this->lowest_layer (typeid (Object).name ()));
}
template <class Object>
Object const* lowest_layer_ptr () const
{
return static_cast <Object const*> (
this->lowest_layer (typeid (Object).name ()));
}
/** @} */
virtual void* lowest_layer (char const* type_name) const;
/** Retrieve the underlying object.
Note that you must know the type name for this to work, or
else a fatal error will occur.
*/
/** @{ */
template <class Object>
Object& native_handle ()
{
Object* object (this->native_handle_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
return *object;
}
template <class Object>
Object const& native_handle () const
{
Object const* object (this->native_handle_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
return *object;
}
template <class Object>
Object* native_handle_ptr ()
{
return static_cast <Object*> (
this->native_handle (typeid (Object).name ()));
}
template <class Object>
Object const* native_handle_ptr () const
{
return static_cast <Object const*> (
this->native_handle (typeid (Object).name ()));
}
/** @} */
virtual void* native_handle (char const* type_name) const;
void cancel ()
{
error_code ec;
throw_error (cancel (ec));
}
virtual error_code cancel (error_code& ec);
void shutdown (shutdown_type what)
{
error_code ec;
throw_error (shutdown (what, ec));
}
virtual error_code shutdown (shutdown_type what,
error_code& ec);
void close ()
{
error_code ec;
throw_error (close (ec));
}
virtual error_code close (error_code& ec);
//--------------------------------------------------------------------------
//
// basic_socket_acceptor
//
virtual error_code accept (Socket& peer, error_code& ec);
template <class AcceptHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, void (error_code))
async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
{
return async_accept (peer,
BOOST_ASIO_MOVE_CAST(ErrorCall)(ErrorCall (
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(ErrorCall) handler);
//--------------------------------------------------------------------------
//
// basic_stream_socket
//
// SyncReadStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncReadStream.html
template <class MutableBufferSequence>
std::size_t read_some (MutableBufferSequence const& buffers,
error_code& ec)
{
return read_some (MutableBuffers (buffers), ec);
}
virtual std::size_t read_some (MutableBuffers const& buffers, error_code& ec);
// SyncWriteStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncWriteStream.html
template <class ConstBufferSequence>
std::size_t write_some (ConstBufferSequence const& buffers, error_code &ec)
{
return write_some (ConstBuffers (buffers), ec);
}
virtual std::size_t write_some (ConstBuffers const& buffers, error_code& ec);
// AsyncReadStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncReadStream.html
template <class MutableBufferSequence, class ReadHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (error_code, std::size_t))
async_read_some (MutableBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
return async_read_some (MutableBuffers (buffers),
BOOST_ASIO_MOVE_CAST(TransferCall)(TransferCall (
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_read_some (MutableBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler);
// AsyncWriteStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncWriteStream.html
template <class ConstBufferSequence, class WriteHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (error_code, std::size_t))
async_write_some (ConstBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
return async_write_some (ConstBuffers (buffers),
BOOST_ASIO_MOVE_CAST(TransferCall)(TransferCall (
BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_write_some (ConstBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler);
//--------------------------------------------------------------------------
//
// ssl::stream
//
/** Determines if the underlying stream requires a handshake.
If requires_handshake is true, it will be necessary to call handshake or
async_handshake after the connection is established. Furthermore it
will be necessary to call the shutdown member from the
HandshakeInterface to close the connection. Do not close the underlying
socket or else the closure will not be graceful. Only one side should
initiate the handshaking shutdon. The other side should observe it.
Which side does what is up to the user.
The default version returns false.
*/
virtual bool requires_handshake ();
// ssl::stream::handshake (1 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload1.html
//
void handshake (handshake_type type)
{
error_code ec;
throw_error (handshake (type, ec));
}
// ssl::stream::handshake (2 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload2.html
//
virtual error_code handshake (handshake_type type,
error_code& ec);
// ssl::stream::async_handshake (1 of 2)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload1.html
//
template <typename HandshakeHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler, void (error_code))
async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler)
{
return async_handshake (type,
BOOST_ASIO_MOVE_CAST(ErrorCall)(ErrorCall (
BOOST_ASIO_MOVE_CAST(HandshakeHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(ErrorCall) handler);
//--------------------------------------------------------------------------
#if BEAST_ASIO_HAS_BUFFEREDHANDSHAKE
// ssl::stream::handshake (3 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload3.html
//
template <class ConstBufferSequence>
void handshake (handshake_type type, ConstBufferSequence const& buffers)
{
error_code ec;
throw_error (handshake (type, buffers, ec));
}
// ssl::stream::handshake (4 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload4.html
//
template <class ConstBufferSequence>
error_code handshake (handshake_type type,
ConstBufferSequence const& buffers, error_code& ec)
{
return handshake (type, ConstBuffers (buffers), ec);
}
virtual error_code handshake (handshake_type type,
ConstBuffers const& buffers, error_code& ec);
// ssl::stream::async_handshake (2 of 2)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload2.html
//
template <class ConstBufferSequence, class BufferedHandshakeHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler, void (error_code, std::size_t))
async_handshake (handshake_type type, ConstBufferSequence const& buffers,
BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler)
{
return async_handshake (type, ConstBuffers (buffers),
BOOST_ASIO_MOVE_CAST(TransferCall)(TransferCall (
BOOST_ASIO_MOVE_CAST(BufferedHandshakeHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_handshake (handshake_type type, ConstBuffers const& buffers,
BOOST_ASIO_MOVE_ARG(TransferCall) handler);
#endif
//--------------------------------------------------------------------------
// ssl::stream::shutdown
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/shutdown.html
//
void shutdown ()
{
error_code ec;
throw_error (shutdown (ec));
}
virtual error_code shutdown (error_code& ec);
// ssl::stream::async_shutdown
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_shutdown.html
//
template <class ShutdownHandler>
void async_shutdown (BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler)
{
return async_shutdown (
BOOST_ASIO_MOVE_CAST(ErrorCall)(ErrorCall (
BOOST_ASIO_MOVE_CAST(ShutdownHandler)(handler))));
}
virtual
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_shutdown (BOOST_ASIO_MOVE_ARG(ErrorCall) handler);
};
#endif

View File

@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
void SocketBase::pure_virtual ()
{
fatal_error ("A beast::Socket function was called on an object that doesn't support the interface");
}
boost::system::error_code SocketBase::pure_virtual (boost::system::error_code& ec)
{
pure_virtual ();
return ec = boost::system::errc::make_error_code (
boost::system::errc::function_not_supported);
}

View File

@@ -1,39 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SOCKETBASE_H_INCLUDED
#define BEAST_SOCKETBASE_H_INCLUDED
/** Implementation details for Socket.
Normally you wont need to use this.
*/
struct SocketBase
{
static void pure_virtual ();
static boost::system::error_code pure_virtual (boost::system::error_code& ec);
/** Called when the underlying object does not support the interface. */
void throw_error (boost::system::error_code const& ec)
{
if (ec)
Throw (boost::system::system_error (ec), __FILE__, __LINE__);
}
};
#endif

View File

@@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SOCKETINTERFACE_H_INCLUDED
#define BEAST_SOCKETINTERFACE_H_INCLUDED
/** These define the interfaces that SocketWrapper can adapt with SFINAE. */
struct SocketInterface
{
// has close()
struct Close { };
/** Tag for some compatibility with boost::asio::basic_socket_acceptor
http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/basic_socket_acceptor.html
*/
struct Acceptor : Close { };
// Has lowest_layer() and lowest_layer_type
struct LowestLayer { };
/** Tag for parts of boost::asio::basic_socket
http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/basic_socket.html
*/
struct Socket : Close, LowestLayer { };
/** Tag for parts of boost::asio::basic_stream_socket
http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/basic_stream_socket.html
*/
struct SyncStream { };
struct AsyncStream { };
struct Stream : SyncStream, AsyncStream { };
/** Tags for parts of boost::asio::ssl::stream
http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream.html
*/
struct AnyHandshake { };
struct SyncHandshake : AnyHandshake { };
struct AsyncHandshake : AnyHandshake { };
struct BufferedSyncHandshake : AnyHandshake { };
struct BufferedAsyncHandshake : AnyHandshake { };
struct Handshake : SyncHandshake, AsyncHandshake,
BufferedSyncHandshake, BufferedAsyncHandshake,
LowestLayer { };
};
#endif

View File

@@ -1,729 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SOCKETWRAPPER_H_INCLUDED
#define BEAST_SOCKETWRAPPER_H_INCLUDED
/** Wraps a reference to any object and exports all availble interfaces.
If the object does not support an interface, calling those
member functions will behave as if a pure virtual was called.
Note that only a reference to the underlying is stored. Management
of the lifetime of the object is controlled by the caller.
Examples of the type of WrappedObject:
asio::ip::tcp::socket
arg must be an io_context
SocketWrapper will create and take ownership of the tcp::socket
WrappedObjectType will be tcp::socket
next_layer () returns a asio::ip::tcp::socket&
lowest_layer () returns a asio::ip::tcp::socket&
asio::ip::tcp::socket&
arg must be an existing socket&
The caller owns the underlying socket object
WrappedObjectType will be tcp::socket
next_layer () returns a asio::ip::tcp::socket&
lowest_layer () returns a asio::ip::tcp::socket&
asio::ssl::stream <asio::ip::tcp::socket>
arg must be an io_context
SocketWrapper creates and takes ownership of the ssl::stream
WrappedObjecType will be asio::ssl::stream <asio::ip::tcp::socket>
next_layer () returns a asio::ip::tcp::socket&
lowest_layer () returns a asio::ip::tcp::socket&
asio::ssl::stream <asio::ip::tcp::socket&>
arg must be an existing socket&
The caller owns the socket, but SocketWrapper owns the ssl::stream
WrappedObjectType will be asio::ssl::stream <asio::ip::tcp::socket&>
next_layer () returns a asio::ip::tcp::socket&
lowest_layer () returns a asio::ip::tcp::socket&
asio::ssl::stream <asio::buffered_stream <asio::ip::tcp::socket> > >
This makes my head explode
*/
//------------------------------------------------------------------------------
namespace SocketWrapperMemberChecks
{
template <bool Enable>
struct EnableIf : boost::false_type { };
template <>
struct EnableIf <true> : boost::true_type { };
BEAST_DEFINE_IS_CALL_POSSIBLE(has_get_io_service, get_io_service);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_lowest_layer, lowest_layer);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_cancel, cancel);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_shutdown, shutdown);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_close, close);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_accept, accept);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_async_accept, async_accept);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_read_some, read_some);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_write_some, write_some);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_async_read_some, async_read_some);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_async_write_some, async_write_some);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_handshake, handshake);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_async_handshake, async_handshake);
BEAST_DEFINE_IS_CALL_POSSIBLE(has_async_shutdown, async_shutdown);
// Extracts the underlying socket type from the protocol of another asio object
template <typename T, typename Enable = void>
struct native_socket
{
typedef void* socket_type;
inline native_socket (Socket&) : m_socket (nullptr) { SocketBase::pure_virtual (); }
inline socket_type& get () { SocketBase::pure_virtual (); return m_socket; }
inline socket_type& operator-> () { return get (); }
private:
socket_type m_socket;
};
// Enabled if T::protocol_type::socket exists as a type
template <typename T>
struct native_socket <T, typename boost::enable_if <boost::is_class <
typename T::protocol_type::socket> >::type>
{
typedef typename T::protocol_type::socket socket_type;
inline native_socket (Socket& peer) : m_socket_ptr (&peer.native_handle <socket_type> ()) { }
inline socket_type& get () noexcept { return *m_socket_ptr; }
inline socket_type& operator-> () noexcept { return get (); }
private:
socket_type* m_socket_ptr;
};
};
template <typename WrappedObject>
class SocketWrapper
: public virtual Socket
, public SocketWrapperBasics
, public Uncopyable
{
private:
typedef typename boost::remove_reference <WrappedObject>::type wrapped_type;
public:
typedef typename boost::remove_reference <WrappedObject>::type WrappedObjectType;
template <typename Arg>
explicit SocketWrapper (Arg& arg)
: m_object (arg)
{
}
template <typename Arg1, typename Arg2>
SocketWrapper (Arg1& arg1, Arg2& arg2)
: m_object (arg1, arg2)
{
}
//--------------------------------------------------------------------------
//
// basic_io_object
//
boost::asio::io_service& get_io_service ()
{
using namespace SocketWrapperMemberChecks;
#if 0
// This is the one that doesn't work, (void) arg lists
return get_io_service (
EnableIf <has_get_io_service <wrapped_type,
io_service ()>::value> ());
#else
return get_io_service (boost::true_type ());
#endif
}
boost::asio::io_service& get_io_service (
boost::true_type)
{
return m_object.get_io_service ();
}
boost::asio::io_service& get_io_service (
boost::false_type)
{
pure_virtual ();
return *static_cast <boost::asio::io_service*>(nullptr);
}
//--------------------------------------------------------------------------
//
// basic_socket
//
#if 0
// This is a potential work-around for the problem with
// the has_type_lowest_layer_type template, but requires
// Boost 1.54 or later.
//
// This include will be needed:
//
// #include <boost/tti/has_type.hpp>
//
//
BOOST_TTI_HAS_TYPE(lowest_layer_type)
#endif
template <class T>
struct has_type_lowest_layer_type
{
typedef char yes;
typedef struct {char dummy[2];} no;
template <class C> static yes f(typename C::lowest_layer_type*);
template <class C> static no f(...);
#ifdef _MSC_VER
static bool const value = sizeof(f<T>(0)) == 1;
#else
// This line fails to compile under Visual Studio 2012
static bool const value = sizeof(has_type_lowest_layer_type<T>::f<T>(0)) == 1;
#endif
};
void* lowest_layer (char const* type_name) const
{
using namespace SocketWrapperMemberChecks;
return lowest_layer (type_name,
EnableIf <has_type_lowest_layer_type <wrapped_type>::value> ());
}
void* lowest_layer (char const* type_name,
boost::true_type) const
{
char const* const name (typeid (typename wrapped_type::lowest_layer_type).name ());
if (strcmp (name, type_name) == 0)
return const_cast <void*> (static_cast <void const*> (&m_object.lowest_layer ()));
return nullptr;
}
void* lowest_layer (char const*,
boost::false_type) const
{
pure_virtual ();
return nullptr;
}
//--------------------------------------------------------------------------
void* native_handle (char const* type_name) const
{
char const* const name (typeid (wrapped_type).name ());
if (strcmp (name, type_name) == 0)
return const_cast <void*> (static_cast <void const*> (&m_object));
return nullptr;
}
//--------------------------------------------------------------------------
error_code cancel (error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return cancel (ec,
EnableIf <has_cancel <wrapped_type,
error_code (error_code&)>::value> ());
}
error_code cancel (error_code& ec,
boost::true_type)
{
return m_object.cancel (ec);
}
error_code cancel (error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
error_code shutdown (shutdown_type what, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return shutdown (what, ec,
EnableIf <has_shutdown <wrapped_type,
error_code (shutdown_type, error_code&)>::value> ());
}
error_code shutdown (shutdown_type what, error_code& ec,
boost::true_type)
{
return m_object.shutdown (what, ec);
}
error_code shutdown (shutdown_type, error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
error_code close (error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return close (ec,
EnableIf <has_close <wrapped_type,
error_code (error_code&)>::value> ());
}
error_code close (error_code& ec,
boost::true_type)
{
return m_object.close (ec);
}
error_code close (error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
//
// basic_socket_acceptor
//
error_code accept (Socket& peer, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
typedef typename native_socket <wrapped_type>::socket_type socket_type;
return accept (peer, ec,
EnableIf <has_accept <wrapped_type,
error_code (socket_type&, error_code&)>::value> ());
}
error_code accept (Socket& peer, error_code& ec,
boost::true_type)
{
using namespace SocketWrapperMemberChecks;
return m_object.accept (
native_socket <wrapped_type> (peer).get (), ec);
}
error_code accept (Socket&, error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
using namespace SocketWrapperMemberChecks;
typedef typename native_socket <wrapped_type>::socket_type socket_type;
return async_accept (peer, BOOST_ASIO_MOVE_CAST(ErrorCall)(handler),
EnableIf <has_async_accept <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
(socket_type&, BOOST_ASIO_MOVE_ARG(TransferCall))>::value> ());
}
template <typename AcceptHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ErrorCall, void (error_code))
async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler,
boost::true_type)
{
using namespace SocketWrapperMemberChecks;
return m_object.async_accept (
native_socket <wrapped_type> (peer).get (),
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
}
template <typename AcceptHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, void (error_code))
async_accept (Socket&, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
AcceptHandler, void (error_code)> init(
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler), ec));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler), ec));
#endif
}
//--------------------------------------------------------------------------
//
// basic_stream_socket
//
std::size_t read_some (MutableBuffers const& buffers, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return read_some (buffers, ec,
EnableIf <has_read_some <wrapped_type,
std::size_t (MutableBuffers const&, error_code&)>::value> ());
}
template <typename MutableBufferSequence>
std::size_t read_some (MutableBufferSequence const& buffers, error_code& ec,
boost::true_type)
{
return m_object.read_some (buffers, ec);
}
template <typename MutableBufferSequence>
std::size_t read_some (MutableBufferSequence const&, error_code& ec,
boost::false_type)
{
pure_virtual (ec);
return 0;
}
//--------------------------------------------------------------------------
std::size_t write_some (ConstBuffers const& buffers, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return write_some (buffers, ec,
EnableIf <has_write_some <wrapped_type,
std::size_t (ConstBuffers const&, error_code&)>::value> ());
}
template <typename ConstBufferSequence>
std::size_t write_some (ConstBufferSequence const& buffers, error_code& ec,
boost::true_type)
{
return m_object.write_some (buffers, ec);
}
template <typename ConstBufferSequence>
std::size_t write_some (ConstBufferSequence const&, error_code& ec,
boost::false_type)
{
pure_virtual (ec);
return 0;
}
//--------------------------------------------------------------------------
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_read_some (MutableBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
using namespace SocketWrapperMemberChecks;
return async_read_some (buffers, BOOST_ASIO_MOVE_CAST(TransferCall)(handler),
EnableIf <has_async_read_some <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
(MutableBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall))>::value> ());
}
template <typename MutableBufferSequence, typename ReadHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (error_code, std::size_t))
async_read_some (MutableBufferSequence const& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
boost::true_type)
{
return m_object.async_read_some (buffers,
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
template <typename MutableBufferSequence, typename ReadHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (error_code, std::size_t))
async_read_some (MutableBufferSequence const&, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ReadHandler, void (error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (BOOST_ASIO_MOVE_CAST(ReadHandler)(handler), ec, 0));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (BOOST_ASIO_MOVE_CAST(ReadHandler)(handler), ec, 0));
#endif
}
//--------------------------------------------------------------------------
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_write_some (ConstBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
using namespace SocketWrapperMemberChecks;
return async_write_some (buffers, BOOST_ASIO_MOVE_CAST(TransferCall)(handler),
EnableIf <has_async_write_some <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
(ConstBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall))>::value> ());
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_write_some (ConstBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler,
boost::true_type)
{
return m_object.async_write_some (buffers,
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_write_some (ConstBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
TransferCall, void (error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
#endif
}
//--------------------------------------------------------------------------
//
// ssl::stream
//
bool requires_handshake ()
{
using namespace SocketWrapperMemberChecks;
return
has_handshake <wrapped_type,
error_code (handshake_type, error_code&)>::value ||
has_async_handshake <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
(handshake_type, BOOST_ASIO_MOVE_ARG(ErrorCall))>::value;
}
//--------------------------------------------------------------------------
error_code handshake (handshake_type type, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return handshake (type, ec,
EnableIf <has_handshake <wrapped_type,
error_code (handshake_type, error_code&)>::value> ());
}
error_code handshake (handshake_type type, error_code& ec,
boost::true_type)
{
return m_object.handshake (type, ec);
}
error_code handshake (handshake_type, error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
using namespace SocketWrapperMemberChecks;
return async_handshake (type, BOOST_ASIO_MOVE_CAST(ErrorCall)(handler),
EnableIf <has_async_handshake <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
(handshake_type, BOOST_ASIO_MOVE_ARG(ErrorCall))>::value> ());
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(ErrorCall) handler,
boost::true_type)
{
return m_object.async_handshake (type,
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_handshake (handshake_type, BOOST_ASIO_MOVE_ARG(ErrorCall) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ErrorCall, void (error_code)> init(
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
#endif
}
//--------------------------------------------------------------------------
#if BEAST_ASIO_HAS_BUFFEREDHANDSHAKE
error_code handshake (handshake_type type, ConstBuffers const& buffers, error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return handshake (type, buffers, ec,
EnableIf <has_handshake <wrapped_type,
error_code (handshake_type, ConstBuffers const&, error_code&)>::value> ());
}
error_code handshake (handshake_type type, ConstBuffers const& buffers, error_code& ec,
boost::true_type)
{
return m_object.handshake (type, buffers, ec);
}
error_code handshake (handshake_type, ConstBuffers const&, error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_handshake (handshake_type type, ConstBuffers const& buffers,
BOOST_ASIO_MOVE_ARG(TransferCall) handler)
{
using namespace SocketWrapperMemberChecks;
return async_handshake (type, buffers, BOOST_ASIO_MOVE_CAST(TransferCall)(handler),
EnableIf <has_async_handshake <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
(handshake_type, ConstBuffers const&, error_code&)>::value> ());
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_handshake (handshake_type type, ConstBuffers const& buffers, BOOST_ASIO_MOVE_ARG(TransferCall) handler,
boost::true_type)
{
return m_object.async_handshake (type, buffers,
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(TransferCall, void (error_code, std::size_t))
async_handshake (handshake_type, ConstBuffers const&, BOOST_ASIO_MOVE_ARG(TransferCall) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
TransferCall, void (error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
#endif
}
#endif
//--------------------------------------------------------------------------
error_code shutdown (error_code& ec)
{
using namespace SocketWrapperMemberChecks;
return shutdown (ec,
EnableIf <has_shutdown <wrapped_type,
error_code (error_code&)>::value> ());
}
error_code shutdown (error_code& ec,
boost::true_type)
{
return m_object.shutdown (ec);
}
error_code shutdown (error_code& ec,
boost::false_type)
{
return pure_virtual (ec);
}
//--------------------------------------------------------------------------
void async_shutdown (BOOST_ASIO_MOVE_ARG(ErrorCall) handler)
{
using namespace SocketWrapperMemberChecks;
return async_shutdown (BOOST_ASIO_MOVE_CAST(ErrorCall)(handler),
EnableIf <has_async_shutdown <wrapped_type,
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
(BOOST_ASIO_MOVE_ARG(ErrorCall))>::value> ());
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_shutdown (BOOST_ASIO_MOVE_ARG(ErrorCall) handler,
boost::true_type)
{
return m_object.async_shutdown (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(ErrorCall, void (error_code))
async_shutdown (BOOST_ASIO_MOVE_ARG(ErrorCall) handler,
boost::false_type)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<
ErrorCall, void (error_code, std::size_t)> init(
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
return init.result.get();
#else
error_code ec;
ec = pure_virtual (ec);
get_io_service ().post (boost::bind (
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
#endif
}
private:
WrappedObject m_object;
};
#endif

View File

@@ -1,136 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SOCKETWRAPPERBASICS_H_INCLUDED
#define BEAST_SOCKETWRAPPERBASICS_H_INCLUDED
/** Some utilities for SocketWrapper and others.
*/
class SocketWrapperBasics
{
public:
#if 0
/** Template specialization to determine available interfaces. */
template <typename Object>
struct InterfacesOf
{
/** Intrusive tag support.
To use this, add a struct called SocketInterfaces to your
class and derive it from the interfaces that you support.
For example:
@code
struct MyHandshakingStream
{
struct SocketInterfaces
: SocketInterface::Stream
, SocketInterface::Handshake
{
};
}
@endcode
*/
typedef typename Object::SocketInterfaces type;
typedef type value;
};
// Specialization for boost::asio::basic_socket_acceptor
template <typename Protocol, typename SocketService>
struct InterfacesOf <boost::asio::basic_socket_acceptor <Protocol, SocketService> >
{
struct value : SocketInterface::Acceptor { };
typedef value type;
};
// Specialization for boost::asio::basic_socket
template <typename Protocol, typename SocketService>
struct InterfacesOf <boost::asio::basic_socket <Protocol, SocketService> >
{
struct value : SocketInterface::Socket { };
typedef value type;
};
// Specialization for boost::asio::basic_stream_socket
template <typename Protocol, typename SocketService>
struct InterfacesOf <boost::asio::basic_stream_socket <Protocol, SocketService> >
{
struct value : SocketInterface::Socket, SocketInterface::Stream { };
typedef value type;
};
// Specialization for boost::asio::buffered_stream
template <typename Stream>
struct InterfacesOf <boost::asio::buffered_stream <Stream> >
{
struct value : SocketInterface::Stream { };
typedef value type;
};
// Specialization for boost::asio::buffered_read_stream
template <typename Stream>
struct InterfacesOf <boost::asio::buffered_read_stream <Stream> >
{
struct value : SocketInterface::Stream { };
typedef value type;
};
// Specialization for boost::asio::buffered_write_stream
template <typename Stream>
struct InterfacesOf <boost::asio::buffered_write_stream <Stream> >
{
struct value : SocketInterface::Stream { };
typedef value type;
};
// Specialization for boost::asio::ssl::stream
template <typename Stream>
struct InterfacesOf <boost::asio::ssl::stream <Stream> >
{
struct value : SocketInterface::Stream , SocketInterface::Handshake { };
typedef value type;
};
#if 1
// Less elegant, but works.
// Determines if Object supports the specified Interface
template <typename Object, typename Interface, class Enable = void>
struct HasInterface : boost::false_type { };
template <typename Object, typename Interface>
struct HasInterface <Object, Interface,
typename boost::enable_if <boost::is_base_of <
Interface, typename InterfacesOf <Object>::type> >::type >
: boost::true_type { };
#else
// This should work, but doesn't.
// K-ballo from #boost suggested it.
//
// Determines if Object supports the specified Interface
template <typename Object, typename Interface>
struct HasInterface : boost::is_base_of <Interface, typename InterfacesOf <Object> >
{
};
#endif
#endif
};
#endif

View File

@@ -1,18 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================

View File

@@ -1,41 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SSLCONTEXT_H_INCLUDED
#define BEAST_SSLCONTEXT_H_INCLUDED
/** An SSL context that wraps a boost::asio::ssl::context. */
class SslContextBase
{
public:
typedef boost::asio::ssl::context BoostContextType;
virtual ~SslContextBase () { }
/** Conversion to boost::asio::ssl::context
This lets you pass this object where the real thing is expected.
*/
operator BoostContextType& ()
{
return getBoostContext ();
}
virtual BoostContextType& getBoostContext () noexcept = 0;
};
#endif

View File

@@ -1,80 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_BOOSTINCLUDES_H_INCLUDED
#define BEAST_BOOSTINCLUDES_H_INCLUDED
// Make sure we take care of fixing boost::bind oddities first.
#if !defined(BEAST_CORE_H_INCLUDED)
#error beast_core.h must be included before including this file
#endif
// These should have already been set in your project, but
// if you forgot then we will be optimistic and choose the latest.
//
#if BEAST_WIN32
# ifndef _WIN32_WINNT
# pragma message ("Warning: _WIN32_WINNT was not set in your project")
# define _WIN32_WINNT 0x0600
# endif
# ifndef _VARIADIC_MAX
# define _VARIADIC_MAX 10
# endif
#endif
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <boost/type_traits.hpp>
//------------------------------------------------------------------------------
// Configure some options based on the version of boost
#include <boost/version.hpp>
#if (BOOST_VERSION / 100) >= 1054
# define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 1
# ifndef BEAST_ASIO_HAS_FUTURE_RETURNS
# define BEAST_ASIO_HAS_FUTURE_RETURNS 1
# endif
#else
# define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 0
# ifndef BEAST_ASIO_HAS_FUTURE_RETURNS
# define BEAST_ASIO_HAS_FUTURE_RETURNS 0
# endif
#endif
#if ! BEAST_ASIO_HAS_FUTURE_RETURNS
# define BOOST_ASIO_INITFN_RESULT_TYPE(expr,val) void
# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(expr,val) void
#else
# if defined(GENERATING_DOCUMENTATION)
# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \
void_or_deduced
# elif defined(_MSC_VER) && (_MSC_VER < 1500)
# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \
boost::asio::detail::async_result_type_helper<h, sig>::type
# else
# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \
boost::asio::async_result <boost::asio::handler_type<h, sig>::type>::type
# endif
#endif
#endif

View File

@@ -1,93 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
PeerTest::Result::Result ()
: m_ec (TestPeerBasics::make_error (TestPeerBasics::errc::skipped))
, m_message (m_ec.message ())
{
}
PeerTest::Result::Result (boost::system::error_code const& ec, String const& prefix)
: m_ec (ec)
, m_message ((prefix == String::empty) ? ec.message ()
: prefix + ": " + ec.message ())
{
}
bool PeerTest::Result::operator== (Result const& other) const noexcept
{
return m_ec == other.m_ec;
}
bool PeerTest::Result::operator!= (Result const& other) const noexcept
{
return m_ec != other.m_ec;
}
bool PeerTest::Result::failed () const noexcept
{
return TestPeerBasics::failure (m_ec);
}
bool PeerTest::Result::timedout () const noexcept
{
return m_ec == TestPeerBasics::make_error (TestPeerBasics::errc::timeout);
}
String PeerTest::Result::message () const noexcept
{
return m_message;
}
bool PeerTest::Result::report (UnitTest& test, bool reportPassingTests) const
{
bool const success = test.unexpected (failed (), message ());
if (reportPassingTests && success)
test.logMessage (String ("pass ") + message());
return success;
}
//------------------------------------------------------------------------------
PeerTest::Results::Results ()
: name ("unknown")
{
}
bool PeerTest::Results::operator== (Results const& other) const noexcept
{
return (client == other.client) && (server == other.server);
}
bool PeerTest::Results::operator!= (Results const& other) const noexcept
{
return (client != other.client) || (server != other.server);
}
bool PeerTest::Results::report (UnitTest& test, bool beginTestCase) const
{
if (beginTestCase)
test.beginTestCase (name);
bool success = true;
if (! client.report (test))
success = false;
if (! server.report (test))
success = false;
return success;
}

View File

@@ -1,218 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_PEERTEST_H_INCLUDED
#define RIPPLE_PEERTEST_H_INCLUDED
/** Performs a test of two peers defined by template parameters.
*/
class PeerTest
{
public:
enum
{
/** How long to wait before aborting a peer and reporting a timeout.
@note Aborting synchronous logics may cause undefined behavior.
*/
defaultTimeoutSeconds = 30
};
//--------------------------------------------------------------------------
/** Holds the test results for one peer.
*/
class Result
{
public:
/** Default constructor indicates the test was skipped.
*/
Result ();
/** Construct from an error code.
The prefix is prepended to the error message.
*/
explicit Result (boost::system::error_code const& ec, String const& prefix = "");
/** Returns true if the error codes match (message is ignored).
*/
bool operator== (Result const& other) const noexcept;
bool operator!= (Result const& other) const noexcept;
/** Returns true if the peer failed.
*/
bool failed () const noexcept;
/** Convenience for determining if the peer timed out.
*/
bool timedout () const noexcept;
/** Provides a descriptive message.
This is suitable to pass to UnitTest::fail.
*/
String message () const noexcept;
/** Report the result to a UnitTest object.
A return value of true indicates success.
*/
bool report (UnitTest& test, bool reportPassingTests = false) const;
private:
boost::system::error_code m_ec;
String m_message;
};
//--------------------------------------------------------------------------
/** Holds the results for both peers in a test.
*/
struct Results
{
String name; // A descriptive name for this test case.
Result client;
Result server;
Results ();
/** Determines if client and server results match. */
bool operator== (Results const& other) const noexcept;
bool operator!= (Results const& other) const noexcept;
/** Report the results to a UnitTest object.
A return value of true indicates success.
@param beginTestCase `true` to call test.beginTestCase for you
*/
bool report (UnitTest& test, bool beginTestCase = true) const;
};
//--------------------------------------------------------------------------
/** Test two peers and return the results.
*/
template <typename Details, typename ClientLogic, typename ServerLogic, typename ClientArg, typename ServerArg>
static Results run (ClientArg const& clientArg, ServerArg const& serverArg, int timeoutSeconds = defaultTimeoutSeconds)
{
Results results;
if (Process::isRunningUnderDebugger ())
timeoutSeconds = -1;
try
{
TestPeerType <ServerLogic, Details> server (serverArg);
results.name = server.name () + Details::getArgName (serverArg);
try
{
TestPeerType <ClientLogic, Details> client (clientArg);
results.name << " / " + client.name () + Details::getArgName (clientArg);
try
{
server.start (timeoutSeconds);
try
{
client.start (timeoutSeconds);
boost::system::error_code const ec = client.join ();
results.client = Result (ec, client.name ());
try
{
boost::system::error_code const ec = server.join ();
results.server = Result (ec, server.name ());
}
catch (...)
{
results.server = Result (TestPeerBasics::make_error (
TestPeerBasics::errc::exceptioned), server.name ());
}
}
catch (...)
{
results.client = Result (TestPeerBasics::make_error (
TestPeerBasics::errc::exceptioned), client.name ());
}
}
catch (...)
{
results.server = Result (TestPeerBasics::make_error (
TestPeerBasics::errc::exceptioned), server.name ());
}
}
catch (...)
{
results.client = Result (TestPeerBasics::make_error (
TestPeerBasics::errc::exceptioned), "client");
}
}
catch (...)
{
results.server = Result (TestPeerBasics::make_error (
TestPeerBasics::errc::exceptioned), "server");
}
return results;
}
template <typename Details, typename ClientLogic, typename ServerLogic, class Arg>
static Results run (Arg const& arg, int timeoutSeconds = defaultTimeoutSeconds)
{
return run <Details, ClientLogic, ServerLogic, Arg, Arg> (arg, arg, timeoutSeconds);
}
//--------------------------------------------------------------------------
/** Reports tests of Details for all known asynchronous logic combinations to a UnitTest.
*/
template <typename Details, class Arg>
static void report_async (UnitTest& test, Arg const& arg,
int timeoutSeconds = defaultTimeoutSeconds,
bool beginTestCase = true)
{
run <Details, TestPeerLogicAsyncClient, TestPeerLogicAsyncServer>
(arg, timeoutSeconds).report (test, beginTestCase);
}
/** Reports tests of Details against all known logic combinations to a UnitTest.
*/
template <typename Details, class Arg>
static void report (UnitTest& test, Arg const& arg,
int timeoutSeconds = defaultTimeoutSeconds,
bool beginTestCase = true)
{
run <Details, TestPeerLogicSyncClient, TestPeerLogicSyncServer>
(arg, timeoutSeconds).report (test, beginTestCase);
run <Details, TestPeerLogicAsyncClient, TestPeerLogicSyncServer>
(arg, timeoutSeconds).report (test, beginTestCase);
run <Details, TestPeerLogicSyncClient, TestPeerLogicAsyncServer>
(arg, timeoutSeconds).report (test, beginTestCase);
report_async <Details> (test, arg, timeoutSeconds, beginTestCase);
}
};
#endif

View File

@@ -1,53 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEER_H_INCLUDED
#define BEAST_TESTPEER_H_INCLUDED
/** An abstract peer for unit tests.
*/
class TestPeer : public TestPeerBasics
{
public:
enum
{
// This should be long enough to go about your business.
defaultTimeout = 10
};
virtual ~TestPeer () { }
/** Get the name of this peer. */
virtual String name () const = 0;
/** Start the peer.
If timeoutSeconds is 0 or less, the wait is infinite.
@param timeoutSeconds How long until the peer should be
considered timed out.
*/
virtual void start (int timeoutSeconds = defaultTimeout) = 0;
/** Wait for the peer to finish.
@return Any error code generated during the server operation.
*/
virtual boost::system::error_code join () = 0;
};
#endif

View File

@@ -1,135 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerBasics::Model::Model (model_t model)
: m_model (model)
{
}
String TestPeerBasics::Model::name () const noexcept
{
if (m_model == async)
return "async";
return "sync";
}
bool TestPeerBasics::Model::operator== (model_t model) const noexcept
{
return m_model == model;
}
boost::asio::ssl::stream_base::handshake_type
TestPeerBasics::to_handshake_type (PeerRole const& role)
{
if (role == PeerRole::client)
return boost::asio::ssl::stream_base::client;
return boost::asio::ssl::stream_base::server;
}
//------------------------------------------------------------------------------
boost::system::error_category const& TestPeerBasics::test_category () noexcept
{
struct test_category_type : boost::system::error_category
{
char const* name () const noexcept
{
return "TestPeer";
}
std::string message (int ev) const
{
switch (ev)
{
case errc::none: return "No error";
case errc::timeout: return "The timeout expired before the test could complete";
case errc::unexpected: return "An unexpected test result was encountered";
case errc::exceptioned: return "An unexpected exception was thrown";
case errc::skipped: return "The test was skipped because of previous errors";
default:
break;
};
return "An unknown error";
}
boost::system::error_condition default_error_condition (int ev) const noexcept
{
return boost::system::error_condition (ev, *this);
}
bool equivalent (int ev, boost::system::error_condition const& condition) const noexcept
{
return default_error_condition (ev) == condition;
}
bool equivalent (boost::system::error_code const& code, int ev) const noexcept
{
return *this == code.category() && code.value() == ev;
}
};
static test_category_type category;
return category;
}
boost::system::error_code TestPeerBasics::make_error (errc::errc_t ev) noexcept
{
return boost::system::error_code (ev, test_category ());
}
boost::system::error_code TestPeerBasics::make_error (errc::errc_t ev, boost::system::error_code& ec) noexcept
{
return ec = make_error (ev);
}
bool TestPeerBasics::success (boost::system::error_code const& ec, bool eofIsOkay) noexcept
{
if (eofIsOkay && ec == boost::asio::error::eof)
return true;
return ! ec;
}
bool TestPeerBasics::failure (boost::system::error_code const& ec, bool eofIsOkay) noexcept
{
return ! success (ec, eofIsOkay);
}
bool TestPeerBasics::expected (bool condition, boost::system::error_code& ec) noexcept
{
if (condition)
ec = boost::system::error_code ();
else
make_error (errc::unexpected, ec);
return condition;
}
bool TestPeerBasics::unexpected (bool condition, boost::system::error_code& ec) noexcept
{
return ! expected (condition, ec);
}
bool TestPeerBasics::aborted (boost::system::error_code const& ec) noexcept
{
return ec == boost::asio::error::operation_aborted;
}
//------------------------------------------------------------------------------

View File

@@ -1,100 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERBASICS_H_INCLUDED
#define BEAST_TESTPEERBASICS_H_INCLUDED
/** Common declarations for TestPeer.
@see TestPeer
*/
class TestPeerBasics
{
public:
/** Selects between synchronous or asynchronous networking i/o usage. */
struct Model
{
enum model_t
{
sync,
async
};
Model (model_t model);
String name () const noexcept;
bool operator== (model_t model) const noexcept;
private:
model_t m_model;
};
//--------------------------------------------------------------------------
/** Convert a PeerRole to boost::asio::ssl::stream_base_handshake_type */
static boost::asio::ssl::stream_base::handshake_type to_handshake_type (PeerRole const& role);
//--------------------------------------------------------------------------
// Custom error codes for distinguishing test conditions
struct errc
{
enum errc_t
{
none = 0,
timeout, // The peer join timeout expired
unexpected, // An expected condition was false
exceptioned, // An exception occurred
skipped // Test skipped due to previous errors
};
};
/** Returns the category that represents TestPeer errors.
*/
static boost::system::error_category const& test_category () noexcept;
/** Creates a test error_code from the give code value.
*/
static boost::system::error_code make_error (errc::errc_t ev) noexcept;
/** Sets the passed error_code to a test error and returns it.
*/
static boost::system::error_code make_error (errc::errc_t ev,
boost::system::error_code& ec) noexcept;
/** Returns true if the error code indicates success.
*/
static bool success (boost::system::error_code const& ec, bool eofIsOkay = false) noexcept;
/** Returns false if the error code indicates failure.
*/
static bool failure (boost::system::error_code const& ec, bool eofIsOkay = false) noexcept;
/** Set the error based on a failed condition and return the success.
*/
static bool expected (bool condition, boost::system::error_code& ec) noexcept;
/** Set the error based on a passed condition and return the success.
*/
static bool unexpected (bool condition, boost::system::error_code& ec) noexcept;
/** Returns true if the error condition indicates an aborted I/O. */
static bool aborted (boost::system::error_code const& ec) noexcept;
};
#endif

View File

@@ -1,45 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERDETAILS_H_INCLUDED
#define BEAST_TESTPEERDETAILS_H_INCLUDED
/** Base class of all detail objects.
*/
class TestPeerDetails
{
public:
virtual ~TestPeerDetails () { }
virtual String name () = 0;
virtual Socket& get_socket () = 0;
virtual Socket& get_acceptor () = 0;
boost::asio::io_service& get_io_service ()
{
return m_io_service;
}
private:
boost::asio::io_service m_io_service;
};
#endif

View File

@@ -1,108 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERDETAILSTCP_H_INCLUDED
#define BEAST_TESTPEERDETAILSTCP_H_INCLUDED
/** Some predefined Detail classes for TestPeer
*/
struct TcpDetails : public TestPeerDetails
{
protected:
typedef boost::asio::ip::tcp protocol_type;
typedef protocol_type::socket socket_type;
typedef protocol_type::acceptor acceptor_type;
typedef protocol_type::endpoint endpoint_type;
typedef protocol_type::resolver resolver_type;
public:
typedef protocol_type arg_type;
typedef socket_type native_socket_type;
typedef acceptor_type native_acceptor_type;
explicit TcpDetails (arg_type protocol)
: m_protocol (protocol)
, m_socket (get_io_service ())
, m_acceptor (get_io_service ())
, m_socket_wrapper (m_socket)
, m_acceptor_wrapper (m_acceptor)
{
}
static String getArgName (arg_type arg)
{
if (arg == protocol_type::v4 ())
return ".tcpv4";
else if (arg == protocol_type::v6 ())
return ".tcpv6";
return ".tcp?";
}
String name ()
{
return getArgName (m_protocol);
}
Socket& get_socket ()
{
return m_socket_wrapper;
}
Socket& get_acceptor ()
{
return m_acceptor_wrapper;
}
socket_type& get_native_socket ()
{
return m_socket;
}
acceptor_type& get_native_acceptor ()
{
return m_acceptor;
}
endpoint_type get_endpoint (PeerRole role)
{
if (m_protocol == protocol_type::v4 ())
{
if (role == PeerRole::server)
return endpoint_type (m_protocol, 1053);
else
return endpoint_type (boost::asio::ip::address_v4::loopback (), 1053);
}
else
{
if (role == PeerRole::server)
return endpoint_type (m_protocol, 1052);
else
return endpoint_type (boost::asio::ip::address_v6 ().from_string ("::1"), 1052);
}
}
protected:
protocol_type m_protocol;
socket_type m_socket;
acceptor_type m_acceptor;
SocketWrapper <socket_type&> m_socket_wrapper;
SocketWrapper <acceptor_type&> m_acceptor_wrapper;
};
#endif

View File

@@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogic::TestPeerLogic (Socket& socket)
: m_socket (&socket)
{
}
TestPeerLogic::error_code& TestPeerLogic::error () noexcept
{
return m_ec;
}
TestPeerLogic::error_code const& TestPeerLogic::error () const noexcept
{
return m_ec;
}
TestPeerLogic::error_code const& TestPeerLogic::error (error_code const& ec) noexcept
{
return m_ec = ec;
}
Socket& TestPeerLogic::socket () noexcept
{
return *m_socket;
}
void TestPeerLogic::on_connect ()
{
pure_virtual ();
}
void TestPeerLogic::on_connect_async (error_code const&)
{
pure_virtual ();
}
void TestPeerLogic::finished ()
{
pure_virtual ();
}
void TestPeerLogic::pure_virtual ()
{
fatal_error ("A TestPeerLogic function was called incorrectly");
}

View File

@@ -1,57 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGIC_H_INCLUDED
#define BEAST_TESTPEERLOGIC_H_INCLUDED
/** Interface for implementing the logic part of a peer test.
*/
class TestPeerLogic : public TestPeerBasics
{
public:
typedef boost::system::error_code error_code;
explicit TestPeerLogic (Socket& socket);
error_code& error () noexcept;
error_code const& error () const noexcept;
error_code const& error (error_code const& ec) noexcept; // assigns to m_ec
Socket& socket () noexcept;
virtual PeerRole get_role () const noexcept = 0;
virtual Model get_model () const noexcept = 0;
virtual void on_connect ();
virtual void on_connect_async (error_code const&);
// asynchronous logic classes
// must call this when they are done
virtual void finished ();
static void pure_virtual ();
private:
error_code m_ec;
Socket* m_socket;
};
#endif

View File

@@ -1,155 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogicAsyncClient::TestPeerLogicAsyncClient (Socket& socket)
: TestPeerLogic (socket)
{
}
PeerRole TestPeerLogicAsyncClient::get_role () const noexcept
{
return PeerRole::client;
}
TestPeerBasics::Model TestPeerLogicAsyncClient::get_model () const noexcept
{
return Model::async;
}
void TestPeerLogicAsyncClient::on_connect_async (error_code const& ec)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (socket ().requires_handshake ())
{
socket ().async_handshake (Socket::client,
boost::bind (&TestPeerLogicAsyncClient::on_handshake, this,
boost::asio::placeholders::error));
}
else
{
on_handshake (ec);
}
}
void TestPeerLogicAsyncClient::on_handshake (error_code const& ec)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
boost::asio::async_write (socket (), boost::asio::buffer ("hello", 5),
boost::bind (&TestPeerLogicAsyncClient::on_write, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
void TestPeerLogicAsyncClient::on_write (error_code const& ec, std::size_t bytes_transferred)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (unexpected (bytes_transferred == 5, error ()))
return finished ();
boost::asio::async_read_until (socket (), m_buf, std::string ("goodbye"),
boost::bind (&TestPeerLogicAsyncClient::on_read, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
void TestPeerLogicAsyncClient::on_read (error_code const& ec, std::size_t bytes_transferred)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (unexpected (bytes_transferred == 7, error ()))
return finished ();
// should check the data here?
m_buf.consume (bytes_transferred);
// Fire up a 1 byte read, to wait for the server to
// shut down its end of the connection.
boost::asio::async_read (socket (), m_buf.prepare (1),
boost::bind (&TestPeerLogicAsyncClient::on_read_final, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
void TestPeerLogicAsyncClient::on_read_final (error_code const& ec, std::size_t)
{
if (aborted (ec))
return finished ();
// An eof is the normal case. The server should have closed shop.
//
if (ec == boost::asio::error::eof)
{
if (socket ().requires_handshake ())
{
socket ().async_shutdown (boost::bind (&TestPeerLogicAsyncClient::on_shutdown, this,
boost::asio::placeholders::error));
}
else
{
// on_shutdown will call finished ()
error_code ec;
on_shutdown (socket ().shutdown (Socket::shutdown_both, ec));
}
}
else
{
// If we don't get eof, then there should be some other
// error in there. We don't expect the server to send more bytes!
//
// This statement will do the following:
//
// error (ec) save ec into our error state
// success () return true if ec represents success
// unexpected () changes error() to 'unexpected' result if
// success() returned true
//
unexpected (success (error (ec)), error ());
return finished ();
}
}
void TestPeerLogicAsyncClient::on_shutdown (error_code const& ec)
{
if (! aborted (ec))
{
if (success (error (ec), true))
{
if (socket ().requires_handshake ())
{
socket ().shutdown (Socket::shutdown_both, error ());
}
if (! error ())
{
if (success (socket ().close (error ())))
{
// doing nothing here is intended,
// as the calls to success() may set error()
}
}
}
}
finished ();
}

View File

@@ -1,39 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGICASYNCCLIENT_H_INCLUDED
#define BEAST_TESTPEERLOGICASYNCCLIENT_H_INCLUDED
class TestPeerLogicAsyncClient : public TestPeerLogic
{
public:
explicit TestPeerLogicAsyncClient (Socket& socket);
PeerRole get_role () const noexcept;
Model get_model () const noexcept;
void on_connect_async (error_code const& ec);
void on_handshake (error_code const& ec);
void on_write (error_code const& ec, std::size_t bytes_transferred);
void on_read (error_code const& ec, std::size_t bytes_transferred);
void on_read_final (error_code const& ec, std::size_t);
void on_shutdown (error_code const& ec);
private:
boost::asio::streambuf m_buf;
};
#endif

View File

@@ -1,117 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogicAsyncServer::TestPeerLogicAsyncServer (Socket& socket)
: TestPeerLogic (socket)
{
}
PeerRole TestPeerLogicAsyncServer::get_role () const noexcept
{
return PeerRole::server;
}
TestPeerBasics::Model TestPeerLogicAsyncServer::get_model () const noexcept
{
return Model::async;
}
void TestPeerLogicAsyncServer::on_connect_async (error_code const& ec)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (socket ().requires_handshake ())
{
socket ().async_handshake (Socket::server,
boost::bind (&TestPeerLogicAsyncServer::on_handshake, this,
boost::asio::placeholders::error));
}
else
{
on_handshake (ec);
}
}
void TestPeerLogicAsyncServer::on_handshake (error_code const& ec)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
boost::asio::async_read_until (socket (), m_buf, std::string ("hello"),
boost::bind (&TestPeerLogicAsyncServer::on_read, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
void TestPeerLogicAsyncServer::on_read (error_code const& ec, std::size_t bytes_transferred)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (unexpected (bytes_transferred == 5, error ()))
return finished ();
boost::asio::async_write (socket (), boost::asio::buffer ("goodbye", 7),
boost::bind (&TestPeerLogicAsyncServer::on_write, this,
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
void TestPeerLogicAsyncServer::on_write (error_code const& ec, std::size_t bytes_transferred)
{
if (aborted (ec) || failure (error (ec)))
return finished ();
if (unexpected (bytes_transferred == 7, error ()))
return finished ();
if (socket ().requires_handshake ())
{
socket ().async_shutdown (boost::bind (&TestPeerLogicAsyncServer::on_shutdown, this,
boost::asio::placeholders::error));
}
else
{
// on_shutdown will call finished ()
// we need another instance of ec so we can call on_shutdown()
error_code ec;
on_shutdown (socket ().shutdown (Socket::shutdown_both, ec));
}
}
void TestPeerLogicAsyncServer::on_shutdown (error_code const& ec)
{
if (! aborted (ec))
{
if (success (error (ec), true))
{
if (socket ().requires_handshake ())
{
socket ().shutdown (Socket::shutdown_both, error ());
}
if (success (socket ().close (error ())))
{
// doing nothing here is intended,
// as the calls to success() may set error()
}
}
}
finished ();
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGICASYNCSERVER_H_INCLUDED
#define BEAST_TESTPEERLOGICASYNCSERVER_H_INCLUDED
class TestPeerLogicAsyncServer : public TestPeerLogic
{
public:
explicit TestPeerLogicAsyncServer (Socket& socket);
PeerRole get_role () const noexcept;
Model get_model () const noexcept;
void on_connect_async (error_code const& ec);
void on_handshake (error_code const& ec);
void on_read (error_code const& ec, std::size_t bytes_transferred);
void on_write (error_code const& ec, std::size_t bytes_transferred);
void on_shutdown (error_code const& ec);
private:
boost::asio::streambuf m_buf;
};
#endif

View File

@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogicProxyClient::TestPeerLogicProxyClient (Socket& socket)
: TestPeerLogicSyncClient (socket)
{
}
void TestPeerLogicProxyClient::on_pre_handshake ()
{
ProxyHandshake h;
static std::string line (
"PROXY TCP4 255.255.255.255 255.255.255.255 65535 65535\r\n"
// 56 chars
);
std::size_t const amount = boost::asio::write (
socket (), boost::asio::buffer (line), error ());
}

View File

@@ -1,31 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGICPROXYCLIENT_H_INCLUDED
#define BEAST_TESTPEERLOGICPROXYCLIENT_H_INCLUDED
/** A synchronous client logic that sends a PROXY protocol pre-handshake. */
class TestPeerLogicProxyClient : public TestPeerLogicSyncClient
{
public:
explicit TestPeerLogicProxyClient (Socket& socket);
void on_pre_handshake ();
};
#endif

View File

@@ -1,108 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogicSyncClient::TestPeerLogicSyncClient (Socket& socket)
: TestPeerLogic (socket)
{
}
PeerRole TestPeerLogicSyncClient::get_role () const noexcept
{
return PeerRole::client;
}
TestPeerBasics::Model TestPeerLogicSyncClient::get_model () const noexcept
{
return Model::sync;
}
void TestPeerLogicSyncClient::on_connect ()
{
{
// pre-handshake hook is optional
on_pre_handshake ();
if (failure (error ()))
return ;
}
if (socket ().requires_handshake ())
{
if (failure (socket ().handshake (to_handshake_type (get_role ()), error ())))
return;
}
{
std::size_t const amount = boost::asio::write (
socket (), boost::asio::buffer ("hello", 5), error ());
if (failure (error ()))
return;
if (unexpected (amount == 5, error ()))
return;
}
{
char data [7];
size_t const amount = boost::asio::read (
socket (), boost::asio::buffer (data, 7), error ());
if (failure (error ()))
return;
if (unexpected (amount == 7, error ()))
return;
if (unexpected (memcmp (&data, "goodbye", 7) == 0, error ()))
return;
}
// Wait for 1 byte which should never come. Instead,
// the server should close its end and we will get eof
{
char data [1];
boost::asio::read (socket (), boost::asio::buffer (data, 1), error ());
if (error () == boost::asio::error::eof)
{
error () = error_code ();
}
else if (unexpected (failure (error ()), error ()))
{
return;
}
}
if (socket ().requires_handshake ())
{
if (failure (socket ().shutdown (error ()), true))
return;
}
if (failure (socket ().shutdown (Socket::shutdown_both, error ())))
return;
if (failure (socket ().close (error ())))
return;
}
void TestPeerLogicSyncClient::on_pre_handshake ()
{
}

View File

@@ -1,33 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGICSYNCCLIENT_H_INCLUDED
#define BEAST_TESTPEERLOGICSYNCCLIENT_H_INCLUDED
class TestPeerLogicSyncClient : public TestPeerLogic
{
public:
explicit TestPeerLogicSyncClient (Socket& socket);
PeerRole get_role () const noexcept;
Model get_model () const noexcept;
void on_connect ();
virtual void on_pre_handshake ();
};
#endif

View File

@@ -1,80 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
TestPeerLogicSyncServer::TestPeerLogicSyncServer (Socket& socket)
: TestPeerLogic (socket)
{
}
PeerRole TestPeerLogicSyncServer::get_role () const noexcept
{
return PeerRole::server;
}
TestPeerBasics::Model TestPeerLogicSyncServer::get_model () const noexcept
{
return Model::sync;
}
void TestPeerLogicSyncServer::on_connect ()
{
if (socket ().requires_handshake ())
{
if (failure (socket ().handshake (to_handshake_type (get_role ()), error ())))
return;
}
{
boost::asio::streambuf buf (5);
std::size_t const amount = boost::asio::read_until (
socket (), buf, "hello", error ());
if (failure (error ()))
return;
if (unexpected (amount == 5, error ()))
return;
if (unexpected (buf.size () == 5, error ()))
return;
}
{
std::size_t const amount = boost::asio::write (
socket (), boost::asio::buffer ("goodbye", 7), error ());
if (failure (error ()))
return;
if (unexpected (amount == 7, error ()))
return;
}
if (socket ().requires_handshake ())
{
if (failure (socket ().shutdown (error ()), true))
return;
}
if (failure (socket ().shutdown (Socket::shutdown_both, error ())))
return;
if (failure (socket ().close (error ())))
return;
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERLOGICSYNCSERVER_H_INCLUDED
#define BEAST_TESTPEERLOGICSYNCSERVER_H_INCLUDED
class TestPeerLogicSyncServer : public TestPeerLogic
{
public:
explicit TestPeerLogicSyncServer (Socket& socket);
PeerRole get_role () const noexcept;
Model get_model () const noexcept;
void on_connect ();
};
#endif

View File

@@ -1,389 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_TESTPEERTYPE_H_INCLUDED
#define BEAST_TESTPEERTYPE_H_INCLUDED
template <typename Logic, typename Details>
class TestPeerType
: public Details
, public Logic
, public TestPeer
, public Thread
{
protected:
// TestPeerDetails
using Details::get_socket;
using Details::get_acceptor;
using Details::get_io_service;
// Details
typedef typename Details::protocol_type protocol_type;
typedef typename Details::socket_type socket_type;
typedef typename Details::acceptor_type acceptor_type;
typedef typename Details::endpoint_type endpoint_type;
typedef typename Details::resolver_type resolver_type;
using Details::get_native_socket;
using Details::get_native_acceptor;
using Details::get_endpoint;
// TestPeerLogic
typedef typename Logic::error_code error_code;
using Logic::error;
using Logic::socket;
using Logic::get_role;
using Logic::get_model;
using Logic::on_connect;
using Logic::on_connect_async;
using Logic::pure_virtual;
typedef TestPeerType <Logic, Details> This;
public:
// Details
typedef typename Details::arg_type arg_type;
typedef typename Details::native_socket_type native_socket_type;
typedef typename Details::native_acceptor_type native_acceptor_type;
TestPeerType (arg_type const& arg)
: Details (arg)
, Logic (get_socket ())
, Thread (name ())
, m_timer (get_io_service ())
, m_timer_set (false)
, m_timed_out (false)
{
}
~TestPeerType ()
{
}
String name () const
{
return get_model ().name () + "_" + get_role ().name ();
}
bool is_async () const noexcept
{
return get_model () == Model::async;
}
void start (int timeoutSeconds)
{
if (is_async ())
{
if (timeoutSeconds > 0)
{
m_timer.expires_from_now (
boost::posix_time::seconds (timeoutSeconds));
m_timer.async_wait (boost::bind (&This::on_deadline,
this, boost::asio::placeholders::error));
m_timer_set = true;
}
else
{
// Don't set the timer, so infinite wait.
}
}
else
{
// Save the value for when join() is called later.
//
m_timeoutSeconds = timeoutSeconds;
}
startThread ();
// For server roles block until the thread is litening.
//
if (get_role () == PeerRole::server)
m_listening.wait ();
}
error_code join ()
{
if (is_async ())
{
// If the timer expired, then all our i/o should be
// aborted and the thread will exit. So we will wait
// for the thread for an infinite amount of time to
// prevent undefined behavior. If an asynchronous logic
// fails to end when the deadline timer expires, it
// means there's a bug in the logic code.
//
m_join.wait ();
// The wait was satisfied but now the thread is still on
// it's way out of the thread function, so block until
// we know its done.
//
stopThread ();
// If we timed out then always report the custom error
if (m_timed_out)
return error (make_error (errc::timeout));
}
else
{
if (m_timeoutSeconds > 0)
{
// Wait for the thread to finish
//
if (! m_join.wait (m_timeoutSeconds * 1000))
{
// Uh oh, we timed out! This is bad.
// The synchronous model requires that the thread
// be forcibly killed, which can result in undefined
// behavior. It's best not to perform tests with
// synchronous Logic objects that are supposed to time out.
// Force the thread to be killed, without waiting.
stopThread (0);
error () = make_error (errc::timeout);
}
}
else
{
// They requested an infinite wait.
//
m_join.wait ();
}
}
return error ();
}
//--------------------------------------------------------------------------
void run ()
{
if (is_async ())
{
if (get_role () == PeerRole::server)
{
run_async_server ();
}
else if (get_role () == PeerRole::client)
{
run_async_client ();
}
else
{
error () = make_error (errc::unexpected);
}
}
else if (get_model () == Model::sync)
{
if (get_role () == PeerRole::server)
{
run_sync_server ();
}
else if (get_role () == PeerRole::client)
{
run_sync_client ();
}
else
{
error () = make_error (errc::unexpected);
}
}
else
{
error () = make_error (errc::unexpected);
}
get_io_service ().run ();
}
//--------------------------------------------------------------------------
void run_sync_server ()
{
do_listen ();
if (failure (error ()))
return finished ();
if (failure (get_acceptor ().accept (get_socket (), error ())))
return finished ();
if (failure (get_acceptor ().close (error ())))
return finished ();
this->on_connect ();
finished ();
}
//--------------------------------------------------------------------------
void on_accept (error_code const& ec)
{
if (failure (ec))
return finished ();
// Close the acceptor down so we don't block the io_service forever
//
// VFALCO NOTE what difference between cancel and close?
#if 0
if (failure (get_acceptor ().close (error ())))
return finished ();
#endif
this->on_connect_async (ec);
}
void run_async_server ()
{
do_listen ();
if (failure (error ()))
return finished ();
get_acceptor ().async_accept (get_socket (), boost::bind (
&This::on_accept, this, boost::asio::placeholders::error));
}
//--------------------------------------------------------------------------
void run_sync_client ()
{
if (failure (get_native_socket ().connect (get_endpoint (get_role ()), error ())))
return finished ();
this->on_connect ();
finished ();
}
void run_async_client ()
{
get_native_socket ().async_connect (get_endpoint (get_role ()),
boost::bind (&Logic::on_connect_async, this, boost::asio::placeholders::error));
}
//--------------------------------------------------------------------------
void do_listen ()
{
if (failure (get_native_acceptor ().open (
get_endpoint (get_role ()).protocol (), error ())))
return;
// VFALCO TODO Figure out how to not hard code boost::asio::socket_base
if (failure (get_native_acceptor ().set_option (
boost::asio::socket_base::reuse_address (true), error ())))
return;
if (failure (get_native_acceptor ().bind (get_endpoint (get_role ()), error ())))
return;
// VFALCO TODO Figure out how to not hard code boost::asio::socket_base
if (failure (get_native_acceptor ().listen (
boost::asio::socket_base::max_connections, error ())))
return;
m_listening.signal ();
}
void on_deadline (error_code const& ec)
{
m_timer_set = false;
if (ec != boost::asio::error::operation_aborted)
{
// We expect that ec represents no error, since the
// timer expired and the operation wasn't aborted.
//
// If by some chance there is an error in ec we will
// report that as an unexpected test condition instead
// of a timeout.
//
if (expected (! ec, error ()))
m_timed_out = true;
}
else
{
// The timer was canceled because the Logic
// called finished(), so we do nothing here.
}
finished ();
}
void finished ()
{
// If the server errors out it will come through
// here so signal the listening event and unblock
// the main thread.
//
if (get_role () == PeerRole::server)
m_listening.signal ();
if (m_timer_set)
{
error_code ec;
std::size_t const amount = m_timer.cancel (ec);
// The Logic should not have any I/O pending when
// it calls finished, so amount should be zero.
//
unexpected (amount == 0, ec);
}
// The logic should close the socket at the end of
// its operations, unless it encounters an error.
// Therefore, we will clean everything up and squelch
// any errors, so that io_service::run() will return.
//
{
error_code ec;
this->get_socket ().close (ec);
}
// The acceptor will not have closed if the client
// never established the connection, so do it here.
{
error_code ec;
this->get_acceptor ().close (ec);
}
// Wake up the thread blocked on join()
m_join.signal ();
}
private:
WaitableEvent m_listening;
WaitableEvent m_join;
// for async peers
boost::asio::deadline_timer m_timer;
bool m_timer_set;
bool m_timed_out;
// for sync peers
int m_timeoutSeconds;
};
#endif

View File

@@ -1,51 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
/** UnitTest for the TestPeer family of objects.
*/
class TestPeerUnitTests : public UnitTest
{
public:
template <typename Details, typename Arg >
void testDetails (Arg const& arg = Arg ())
{
PeerTest::report <Details> (*this, arg, timeoutSeconds);
}
void runTest ()
{
typedef boost::asio::ip::tcp protocol;
testDetails <TcpDetails, TcpDetails::arg_type> (protocol::v4 ());
testDetails <TcpDetails, TcpDetails::arg_type> (protocol::v6 ());
}
//--------------------------------------------------------------------------
enum
{
timeoutSeconds = 10
};
TestPeerUnitTests () : UnitTest ("TestPeer", "beast", runManual)
{
}
};
static TestPeerUnitTests testPeerUnitTests;

View File

@@ -1,65 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
/** Add this to get the @ref beast_basics module.
@file beast_basics.cpp
@ingroup beast_basics
*/
#include "BeastConfig.h"
#include "beast_basics.h"
#if BEAST_MSVC && _DEBUG
#include <crtdbg.h>
#endif
#if BEAST_MSVC
#pragma warning (push)
#pragma warning (disable: 4100) // unreferenced formal parmaeter
#pragma warning (disable: 4355) // 'this' used in base member
#endif
namespace beast
{
#include "events/beast_DeadlineTimer.cpp"
#include "events/beast_OncePerSecond.cpp"
#include "threads/beast_InterruptibleThread.cpp"
#include "threads/beast_Semaphore.cpp"
#include "memory/beast_FifoFreeStoreWithTLS.cpp"
#include "memory/beast_FifoFreeStoreWithoutTLS.cpp"
#include "memory/beast_GlobalPagedFreeStore.cpp"
#include "memory/beast_PagedFreeStore.cpp"
#include "threads/beast_CallQueue.cpp"
#include "threads/beast_Listeners.cpp"
#include "threads/beast_ManualCallQueue.cpp"
#include "threads/beast_ParallelFor.cpp"
#include "threads/beast_ReadWriteMutex.cpp"
#include "threads/beast_ThreadGroup.cpp"
#include "threads/beast_ThreadWithCallQueue.cpp"
#include "threads/beast_Workers.cpp"
}
#if BEAST_MSVC
#pragma warning (pop)
#endif

View File

@@ -1,276 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
/** Include this to get the @ref beast_basics module.
@file beast_basics.h
@ingroup beast_basics
*/
#ifndef BEAST_BASICS_H_INCLUDED
#define BEAST_BASICS_H_INCLUDED
//------------------------------------------------------------------------------
/* If you fail to make sure that all your compile units are building Beast with
the same set of option flags, then there's a risk that different compile
units will treat the classes as having different memory layouts, leading to
very nasty memory corruption errors when they all get linked together.
That's why it's best to always include the BeastConfig.h file before any
beast headers.
*/
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
# ifdef _MSC_VER
# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?")
# else
# warning "Have you included your BeastConfig.h file before including the Beast headers?"
# endif
#endif
//------------------------------------------------------------------------------
/**
@mainpage Beast: A C++ library for server development.
### Version 1.0
Copyright 2008, 2013 by Vinnie Falco \<vinnie.falco@gmail.com\> ([e-mail][0])
Beast is a source code collection of individual modules containing
functionality for a variety of applications, with an emphasis on building
concurrent systems. Beast incorporates parts of [JUCE][3] (Jules' Utility
Class Extensions), available from [Raw Material Software][4]. Beast has no
external dependencies
Beast is hosted on Github at [https://github.com/vinniefalco/Beast][1]
The online documentation is at [http://vinniefalco.github.com/Beast][2]
## Platforms
All platforms supported by JUCE are also supported by Beast. Currently these
platforms include:
- **Windows**: Applications and VST/RTAS/NPAPI/ActiveX plugins can be built
using MS Visual Studio. The results are all fully compatible with Windows
XP, Vista or Windows 7.
- **Mac OS X**: Applications and VST/AudioUnit/RTAS/NPAPI plugins with Xcode.
- **GNU/Linux**: Applications and plugins can be built for any kernel 2.6 or
later.
- **FreeBSD**: Kernel version 8.4 or higher required.
- **iOS**: Native iPhone and iPad apps.
- **Android**: Supported.
## Prerequisites
This documentation assumes that the reader has a working knowledge of JUCE.
Some modules built on external libraries assume that the reader understands
the operation of those external libraries. Certain modules assume that the
reader understands additional domain-specific information. Modules with
additional prerequisites are marked in the documentation.
## External Modules
Some modules bring in functionality provided by external libraries. For
example, the @ref beast_bzip2 module provides the compression and decompression
algorithms in [bZip2][7]. Usage of these external library modules is optional.
They come with complete source code, as well as options for using either
system or user provided variants of the external libraries: it is not
necessary to download additional source code packages to use these modules.
External code incorporated into Beast is covered by separate licenses. See
the licensing information and notes in the corresponding source files for
copyright information and terms of use.
## Integration
Beast requires recent versions of JUCE. It won't work with versions 1.53 or
earlier. To use the library it is necessary to first download JUCE to a
location where your development environment can find it. Or, you can use your
existing installation of JUCE.
This library uses the same modularized organizational structure as JUCE. To
use a module, first add a path to the list of includes searched by your
development environment or project, which points to the Beast directory. Then,
add the single corresponding .c or .cpp file to your existing project which
already uses JUCE. For example, to use the @ref beast_core module, add the file
beast_core.cpp to your project. Some modules depend on other modules.
To use a module, include the appropriate header from within your source code.
For example, to access classes in the @ref beast_concurrent module, use this:
@code
#include "modules/beast_concurrent/beast_concurrent.h"
@endcode
Then add the corresponding file beast_concurrent.cpp to your build.
## AppConfig
Some Beast features can be controlled at compilation time through
preprocessor directives. The available choices of compilation options are
described in AppConfig.h, located in the AppConfigTemplate directory. Copy
the provided settings into your existing AppConfig.h (a file used by JUCE
convention).
## License
This library contains portions of other open source products covered by
separate licenses. Please see the corresponding source files for specific
terms.
Beast is provided under the terms of The ISC License:
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Some files contain portions of these external projects, licensed separately:
- [bZip2][7] is Copyright (C) 1996-2010 Julian R Seward. All rights
reserved. See the corresponding file LICENSE for licensing terms.
- [Soci][13] is Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton, and
various others noted in the corresponding source files. Soci is distributed
under the [Boost Software License, Version 1.0][14].
- [SQLite][15], placed in the public domain.
[0]: mailto:vinnie.falco@gmail.com "Vinnie Falco (Email)"
[1]: https://github.com/vinniefalco/Beast "Beast Project"
[2]: http://vinniefalco.github.com/Beast/ "Beast Documentation"
[3]: http://rawmaterialsoftware.com/juce.php "JUCE"
[4]: http://rawmaterialsoftware.com/ "Raw Material Software"
[5]: http://www.gnu.org/licenses/gpl-2.0.html "GNU General Public License, version 2"
[6]: http://rawmaterialsoftware.com/jucelicense.php "JUCE Licenses"
[7]: http://www.bzip.org/ "bZip2: Home"
[8]: http://freetype.org/ "The FreeType Project"
[9]: http://www.freetype.org/FTL.TXT "The FreeType Project License"
[10]: http://www.lua.org/ "The Programming Language Lua"
[11]: http://opensource.org/licenses/ISC "The ISC License"
[12]: https://github.com/vinniefalco/LuaBridge
[13]: http://soci.sourceforge.net/ "SOCI"
[14]: http://www.boost.org/LICENSE_1_0.txt "Boost Software License, Version 1.0"
[15]: http://sqlite.org/ "SQLite Home Page"
[16]: http://developer.kde.org/~wheeler/taglib.html "TagLib"
[17]: http://www.gnu.org/licenses/lgpl-2.1.html "Gnu Lesser General Public License, version 2.1"
[18]: http://www.mozilla.org/MPL/1.1/ "Mozilla Public License"
@copyright Copyright 2008-2013 by Vinnie Falco \<vinnie.falco@gmail.com\> ([e-mail][0])
@copyright Provided under the [ISC LIcense][11]
*/
//------------------------------------------------------------------------------
/** Implementation classes.
Thase classes are used internally.
@defgroup internal internal
@internal
*/
//------------------------------------------------------------------------------
/** External modules.
These modules bring in functionality from third party or system libraries.
@defgroup external external
*/
//------------------------------------------------------------------------------
/** Core classes.
This module provides core required functionality, and classes useful for
general development. All other modules require this module.
@todo Discuss the treatment of exceptions versus Error objects in the
library.
@todo Discuss the additions to BeastConfig.h
@defgroup beast_core beast_core
*/
/* Get this early so we can use it. */
#include "../beast_core/system/beast_TargetPlatform.h"
//------------------------------------------------------------------------------
#if BEAST_BOOST_IS_AVAILABLE
#include <boost/thread/tss.hpp>
#endif
#include "../beast_core/beast_core.h"
/** The Beast namespace.
This namespace contains all Beast symbols.
*/
namespace beast
{
// Order matters
#include "functor/beast_Function.h"
#include "events/beast_DeadlineTimer.h"
#include "events/beast_OncePerSecond.h"
#include "math/beast_Math.h"
#include "memory/beast_AllocatedBy.h"
#include "memory/beast_PagedFreeStore.h"
#include "memory/beast_GlobalPagedFreeStore.h"
#include "memory/beast_FifoFreeStoreWithTLS.h"
#include "memory/beast_FifoFreeStoreWithoutTLS.h"
#include "memory/beast_FifoFreeStore.h"
#include "memory/beast_GlobalFifoFreeStore.h"
#include "threads/beast_Semaphore.h"
#include "threads/beast_SerialFor.h"
#include "threads/beast_InterruptibleThread.h"
#include "threads/beast_ReadWriteMutex.h"
#include "threads/beast_ThreadGroup.h"
#include "threads/beast_CallQueue.h"
#include "threads/beast_SharedData.h"
#include "threads/beast_GlobalThreadGroup.h"
#include "threads/beast_Listeners.h"
#include "threads/beast_ManualCallQueue.h"
#include "threads/beast_ParallelFor.h"
#include "threads/beast_ThreadWithCallQueue.h"
#include "threads/beast_Workers.h"
}
#endif

Some files were not shown because too many files have changed in this diff Show More