Compare commits

...

224 Commits

Author SHA1 Message Date
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
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
7cf1ec3f89 Merge commit '9708a1260720d879d76a10f894925962f20611bc' as 'src/soci' 2015-03-18 19:36:00 -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
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
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
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
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
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
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
1365 changed files with 84933 additions and 82796 deletions

5
.gitignore vendored
View File

@@ -75,4 +75,7 @@ My Amplifier XE Results - RippleD
/out.txt
# Build Log
rippled-build.log
rippled-build.log
# Profiling data
gmon.out

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/

180
Builds/Test.py Executable file
View File

@@ -0,0 +1,180 @@
#!/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.
#
# 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')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,20 +7,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
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|Win32.ActiveCfg = debug|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.Debug|Win32.Build.0 = debug|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|Win32.ActiveCfg = release|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.Release|Win32.Build.0 = release|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.Release|x64.ActiveCfg = release|x64
{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}.Release|x64.Build.0 = release|x64
{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

View File

@@ -1,5 +1,5 @@
Name: rippled
Version: 0.27.2
Version: 0.28.0-rc1
Release: 1%{?dist}
Summary: Ripple peer-to-peer network daemon

View File

@@ -39,7 +39,7 @@ 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
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.
@@ -49,12 +49,12 @@ to everyone.
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
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 Euro to Japanese Yen](/images/pathfinding.png)
![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
@@ -84,6 +84,9 @@ This is the repository for Ripple's `rippled`, reference P2P server.
###Setup instructions:
* https://ripple.com/wiki/Rippled_setup_instructions
###Issues
* https://ripplelabs.atlassian.net/browse/RIPD
### Repository Contents
#### ./bin

View File

@@ -40,6 +40,26 @@ If the clang toolchain is detected, then the default target will use it, else
the gcc toolchain will be used. On Windows environments, the MSVC toolchain is
also detected.
The following environment variables modify the build environment:
CLANG_CC
CLANG_CXX
CLANG_LINK
If set, a clang toolchain will be used. These must all be set together.
GNU_CC
GNU_CXX
GNU_LINK
If set, a gcc toolchain will be used (unless a clang toolchain is
detected first). These must all be set together.
CXX
If set, used to detect a toolchain.
BOOST_ROOT
Path to the boost directory.
OPENSSL_ROOT
Path to the openssl directory.
'''
#
'''
@@ -93,6 +113,29 @@ def check_openssl():
(CHECK_LINE, CHECK_COMMAND))
def set_implicit_cache():
'''Use implicit_cache on some targets to improve build times.
By default, scons scans each file for include dependecies. The implicit
cache flag lets you cache these dependencies for later builds, and will
only rescan files that change.
Failure cases are:
1) If the include search paths are changed (i.e. CPPPATH), then a file
may not be rebuilt.
2) If a same-named file has been added to a directory that is earlier in
the search path than the directory in which the file was found.
Turn on if this build is for a specific debug target (i.e. clang.debug)
If one of the failure cases applies, you can force a rescan of dependencies
using the command line option `--implicit-deps-changed`
'''
if len(COMMAND_LINE_TARGETS) == 1:
s = COMMAND_LINE_TARGETS[0].split('.')
if len(s) > 1 and 'debug' in s:
SetOption('implicit_cache', 1)
def import_environ(env):
'''Imports environment settings into the construction environment'''
def set(keys):
@@ -212,6 +255,7 @@ def config_base(env):
env.Append(CPPDEFINES=[
'OPENSSL_NO_SSL2'
,'DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER'
,{'HAVE_USLEEP' : '1'}
])
try:
@@ -486,6 +530,7 @@ def config_env(toolchain, variant, env):
# Configure the base construction environment
root_dir = Dir('#').srcnode().get_abspath() # Path to this SConstruct file
build_dir = os.path.join('build')
base = Environment(
toolpath=[os.path.join ('src', 'beast', 'site_scons', 'site_tools')],
tools=['default', 'Protoc', 'VSProject'],
@@ -497,8 +542,12 @@ base.Append(CPPPATH=[
'src',
os.path.join('src', 'beast'),
os.path.join(build_dir, 'proto'),
os.path.join('src','soci','src'),
])
base.Decider('MD5-timestamp')
set_implicit_cache()
# Configure the toolchains, variants, default toolchain, and default target
variants = ['debug', 'release', 'profile']
all_toolchains = ['clang', 'gcc', 'msvc']
@@ -564,13 +613,140 @@ def list_sources(base, suffixes):
yield os.path.normpath(path)
return list(_iter(base))
def append_sources(result, *filenames, **kwds):
result.append([filenames, kwds])
def get_soci_sources(style):
result = []
cpp_path = [
'src/soci/src/core',
'src/sqlite', ]
append_sources(result,
'src/ripple/unity/soci.cpp',
CPPPATH=cpp_path)
if style == 'unity':
append_sources(result,
'src/ripple/unity/soci_ripple.cpp',
CPPPATH=cpp_path)
return result
def get_classic_sources():
result = []
append_sources(
result,
*list_sources('src/ripple/app', '.cpp'),
CPPPATH=[
'src/soci/src/core',
'src/sqlite']
)
append_sources(result, *list_sources('src/ripple/basics', '.cpp'))
append_sources(result, *list_sources('src/ripple/core', '.cpp'))
append_sources(result, *list_sources('src/ripple/crypto', '.cpp'))
append_sources(result, *list_sources('src/ripple/json', '.cpp'))
append_sources(result, *list_sources('src/ripple/legacy', '.cpp'))
append_sources(result, *list_sources('src/ripple/net', '.cpp'))
append_sources(result, *list_sources('src/ripple/overlay', '.cpp'))
append_sources(result, *list_sources('src/ripple/peerfinder', '.cpp'))
append_sources(result, *list_sources('src/ripple/protocol', '.cpp'))
append_sources(result, *list_sources('src/ripple/shamap', '.cpp'))
append_sources(
result,
*list_sources('src/ripple/nodestore', '.cpp'),
CPPPATH=[
'src/rocksdb2/include',
'src/snappy/snappy',
'src/snappy/config',
])
result += get_soci_sources('classic')
return result
def get_unity_sources():
result = []
append_sources(
result,
'src/ripple/unity/app.cpp',
'src/ripple/unity/app1.cpp',
'src/ripple/unity/app2.cpp',
'src/ripple/unity/app3.cpp',
'src/ripple/unity/app4.cpp',
'src/ripple/unity/app5.cpp',
'src/ripple/unity/app6.cpp',
'src/ripple/unity/app7.cpp',
'src/ripple/unity/app8.cpp',
'src/ripple/unity/app9.cpp',
'src/ripple/unity/core.cpp',
'src/ripple/unity/basics.cpp',
'src/ripple/unity/crypto.cpp',
'src/ripple/unity/net.cpp',
'src/ripple/unity/overlay.cpp',
'src/ripple/unity/peerfinder.cpp',
'src/ripple/unity/json.cpp',
'src/ripple/unity/protocol.cpp',
'src/ripple/unity/shamap.cpp',
'src/ripple/unity/legacy.cpp',
)
result += get_soci_sources('unity')
append_sources(
result,
'src/ripple/unity/nodestore.cpp',
CPPPATH=[
'src/rocksdb2/include',
'src/snappy/snappy',
'src/snappy/config',
])
return result
# Declare the targets
aliases = collections.defaultdict(list)
msvc_configs = []
def should_prepare_target(cl_target,
style, toolchain, variant):
if not cl_target:
# default target
return (style == default_tu_style and
toolchain == default_toolchain and
variant == default_variant)
if 'vcxproj' in cl_target:
return toolchain == 'msvc'
s = cl_target.split('.')
if style == 'unity' and 'nounity' in s:
return False
if len(s) == 1:
return ('all' in cl_target or
variant in cl_target or
toolchain in cl_target)
if len(s) == 2 or len(s) == 3:
return s[0] == toolchain and s[1] == variant
return True # A target we don't know about, better prepare to build it
def should_prepare_targets(style, toolchain, variant):
if not COMMAND_LINE_TARGETS:
return should_prepare_target(None, style, toolchain, variant)
for t in COMMAND_LINE_TARGETS:
if should_prepare_target(t, style, toolchain, variant):
return True
for tu_style in ['classic', 'unity']:
if tu_style == 'classic':
sources = get_classic_sources()
else:
sources = get_unity_sources()
for toolchain in all_toolchains:
for variant in variants:
if not should_prepare_targets(tu_style, toolchain, variant):
continue
if variant == 'profile' and toolchain == 'msvc':
continue
# Configure this variant's construction environment
@@ -591,66 +767,8 @@ for tu_style in ['classic', 'unity']:
object_builder = ObjectBuilder(env, variant_dirs)
if tu_style == 'classic':
object_builder.add_source_files(
*list_sources('src/ripple/app', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/basics', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/core', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/crypto', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/json', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/net', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/overlay', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/peerfinder', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/protocol', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/shamap', '.cpp'))
object_builder.add_source_files(
*list_sources('src/ripple/nodestore', '.cpp'),
CPPPATH=[
'src/leveldb/include',
'src/rocksdb2/include',
'src/snappy/snappy',
'src/snappy/config',
])
else:
object_builder.add_source_files(
'src/ripple/unity/app.cpp',
'src/ripple/unity/app1.cpp',
'src/ripple/unity/app2.cpp',
'src/ripple/unity/app3.cpp',
'src/ripple/unity/app4.cpp',
'src/ripple/unity/app5.cpp',
'src/ripple/unity/app6.cpp',
'src/ripple/unity/app7.cpp',
'src/ripple/unity/app8.cpp',
'src/ripple/unity/app9.cpp',
'src/ripple/unity/core.cpp',
'src/ripple/unity/basics.cpp',
'src/ripple/unity/crypto.cpp',
'src/ripple/unity/net.cpp',
'src/ripple/unity/overlay.cpp',
'src/ripple/unity/peerfinder.cpp',
'src/ripple/unity/json.cpp',
'src/ripple/unity/protocol.cpp',
'src/ripple/unity/shamap.cpp',
)
object_builder.add_source_files(
'src/ripple/unity/nodestore.cpp',
CPPPATH=[
'src/leveldb/include',
'src/rocksdb2/include',
'src/snappy/snappy',
'src/snappy/config',
])
for s, k in sources:
object_builder.add_source_files(*s, **k)
git_commit_tag = {}
if toolchain != 'msvc':
@@ -674,7 +792,7 @@ for tu_style in ['classic', 'unity']:
'src/ripple/unity/rpcx.cpp',
'src/ripple/unity/server.cpp',
'src/ripple/unity/validators.cpp',
'src/ripple/unity/websocket.cpp'
'src/ripple/unity/websocket02.cpp'
)
object_builder.add_source_files(
@@ -693,27 +811,6 @@ for tu_style in ['classic', 'unity']:
]
)
object_builder.add_source_files(
'src/ripple/unity/leveldb.cpp',
CPPPATH=[
'src/leveldb/',
'src/leveldb/include',
'src/snappy/snappy',
'src/snappy/config',
],
**no_uninitialized_warning
)
object_builder.add_source_files(
'src/ripple/unity/hyperleveldb.cpp',
CPPPATH=[
'src/hyperleveldb',
'src/snappy/snappy',
'src/snappy/config',
],
**no_uninitialized_warning
)
object_builder.add_source_files(
'src/ripple/unity/rocksdb.cpp',
CPPPATH=[
@@ -734,6 +831,11 @@ for tu_style in ['classic', 'unity']:
]
)
object_builder.add_source_files(
'src/ripple/unity/websocket04.cpp',
CPPPATH='src/websocketpp',
)
if toolchain == "clang" and Beast.system.osx:
object_builder.add_source_files('src/ripple/unity/beastobjc.mm')
@@ -756,6 +858,10 @@ for tu_style in ['classic', 'unity']:
if toolchain in toolchains:
aliases['all'].extend(target)
aliases[toolchain].extend(target)
elif toolchain == 'msvc':
config = env.VSProjectConfig(variant + ".classic", 'x64', target, env)
msvc_configs.append(config)
if toolchain in toolchains:
aliases[variant].extend(target)
env.Alias(variant_name, target)
@@ -798,3 +904,4 @@ def do_count(target, source, env):
print "Total unit test lines: %d" % lines
PhonyTargets(env, count = do_count)

View File

@@ -19,7 +19,7 @@ environment:
# At the end of each successful build we cache this directory. It must be less
# than 100MB total compressed.
cache:
- 'C:\\rippled_deps'
- "C:\\rippled_deps"
# This means we'll download a zip of the branch we want, rather than the full
# history.

52
circle.yml Normal file
View File

@@ -0,0 +1,52 @@
machine:
services:
- docker
dependencies:
pre:
- sudo apt-add-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main'
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:afrank/boost
- wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get purge -qq libboost1.48-dev
- sudo apt-get install -qq libboost1.57-all-dev
- sudo apt-get install -qq clang-3.4 gcc-4.8 scons protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 99 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.4 99 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.4
- gcc --version
- clang --version
test:
pre:
- scons clang.debug
override:
- | # create gdb script
echo "set env MALLOC_CHECK_=3" > script.gdb
echo "run" >> script.gdb
echo "backtrace full" >> script.gdb
# gdb --help
- cat script.gdb | gdb --ex 'set print thread-events off' --return-child-result --args build/clang.debug/rippled --unittest
- npm install
# Use build/(gcc|clang).debug/rippled
- |
echo "exports.default_server_config = {\"rippled_path\" : \"$HOME/rippled/build/clang.debug/rippled\"};" > test/config.js
# Run integration tests
- npm test
post:
- 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
- docker tag ripple/rippled:$CIRCLE_SHA1 ripple/rippled:$CIRCLE_BRANCH
- docker images
deployment:
docker:
branch: /.*/
commands:
- 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

View File

@@ -1,19 +1,12 @@
VFALCO NOTE - This file appears to be unmaintained.
A list of rippled version numbers, and the Github pull requests they contain.
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"
0.28.0-b12: Includes pulls 836, 887, 902, 903 and 904.
0.28.0-b13: Includes pulls 906, 912, 913, 914 and 915.
0.28.0-b14: Includes pulls 907, 910, 922 and 923.
0.28.0-b15: Includes pulls 832, 870, 879, 883, 911, 916, 919, 920, 924, 925 and 928. FAILED pulls 909 and 926.
0.28.0-b16: Includes pulls 909, 926, 929, 931, 932, 935 and 934.
0.28.0-b17: Includes pulls 927, 939, 940, 943, 944, 945 and 949.
0.28.0-b18: Includes pulls 930, 946, 947, 948, 951, 952, 953, 954, 955, 956, 959, 960 and 962.
0.29.0-b19: Includes pulls 967, 969 and 971.
0.29.0-b20: Includes pulls 935, 942, 957, 958, 963, 964, 965, 966, 968, 972, 973, 974 and 975.
0.29.0-b21: Includes pulls 970 and 976.

16
doc/Docker.md Normal file
View File

@@ -0,0 +1,16 @@
# Rippled Docker Image
Rippled has a continuous deployment pipeline that turns every git commit into a
docker image for quick testing and deployment.
To run the tip of the latest release via docker:
```$ docker run -P -v /srv/rippled/ ripple/rippled:latest```
To run the tip of active development:
```$ docker run -P -v /srv/rippled/ ripple/rippled:develop```
Where ```/srv/rippled``` points to a directory containing a rippled.cfg and
database files. By default, port 5005/tcp maps to the RPC port and 51235/udp to
the peer port.

View File

@@ -10,19 +10,17 @@
#
# 2. Peer Protocol
#
# 3. SMS Gateway
# 3. Ripple Protocol
#
# 4. Ripple Protocol
# 4. HTTPS Client
#
# 5. HTTPS Client
# 5. Database
#
# 6. Database
# 6. Diagnostics
#
# 7. Diagnostics
# 7. Voting
#
# 8. Voting
#
# 9. Example Settings
# 8. Example Settings
#
#-------------------------------------------------------------------------------
#
@@ -187,13 +185,21 @@
# using HTTP's Basic Authentication headers when making outbound HTTP/S
# requests.
#
# admin = no | allow
# admin = [ IP, IP, IP, ... ]
#
# Controls whether or not administrative commands are allowed. These
# commands may be issued over http, https, ws, or wss if configured
# on the port. If unspecified, the default is to not allow
# A comma-separated list of IP addresses.
#
# When set, grants administrative command access to the specified IP
# addresses. These commands may be issued over http, https, ws, or wss
# if configured on the port. If unspecified, the default is to not allow
# administrative commands.
#
# *SECURITY WARNING*
# 0.0.0.0 may be specified to allow access from any IP address. It must
# be the only address specified and cannot be combined with other IPs.
# Use of this address can compromise server security, please consider its
# use carefully.
#
# admin_user = <text>
# admin_password = <text>
#
@@ -233,15 +239,6 @@
#
#
#
# [rpc_admin_allow]
#
# Specify a list of IP addresses allowed to have admin access. One per line.
# If you want to test the output of non-admin commands add this section and
# just put an ip address not under your control.
# Defaults to 127.0.0.1.
#
#
#
# [rpc_startup]
#
# Specify a list of RPC commands to run at startup.
@@ -374,12 +371,6 @@
# When set, activates the autoconnect feature. This maintains outgoing
# connections using PeerFinder's "Outgoing Connection Strategy."
#
# http_handshake = 0 | 1
#
# When set, outgoing peer connections will handshaking using a HTTP
# request instead of the legacy TMHello protocol buffers message.
# Incoming peer connections have their handshakes detected automatically.
#
# become_superpeer = 'never' | 'always' | 'auto'
#
# Controls the selection of peer roles:
@@ -404,43 +395,7 @@
#
#-------------------------------------------------------------------------------
#
# 3. SMS Gateway
#
#---------------
#
# If you have a certain SMS messaging provider you can configure these
# settings to allow the rippled server instance to send an SMS text to the
# configured gateway in response to an admin-level RPC command "sms" with
# one parameter, 'text' containing the message to send. This allows backend
# applications to use the rippled instance to securely notify administrators
# of custom events or information via SMS gateway.
#
# When the 'sms' RPC command is issued, the configured SMS gateway will be
# contacted via HTTPS GET at the URL indicated by sms_url. The URI formed
# will be in this format:
#
# [sms_url]?from=[sms_from]&to=[sms_to]&api_key=[sms_key]&api_secret=[sms_secret]&text=['text']
#
# Where [...] are the corresponding values from the configuration file, and
# ['test'] is the value of the JSON field with name 'text'.
#
# [sms_url]
#
# The URL to contact via HTTPS when sending SMS messages
#
# [sms_from]
# [sms_to]
# [sms_key]
# [sms_secret]
#
# These are all strings passed directly in the URI as query parameters
# to the provider of the SMS gateway.
#
#
#
#-------------------------------------------------------------------------------
#
# 4. Ripple Protocol
# 3. Ripple Protocol
#
#-------------------
#
@@ -477,17 +432,12 @@
# need to serve clients can set this to "none". Servers that want complete
# history can set this to "full".
#
# This must be less than or equal to online_delete (if online_delete is used)
#
# The default is: 256
#
#
#
# [ledger_history_index]
#
# If set to greater than 0, the index number of the earliest ledger to
# acquire.
#
#
#
# [fetch_depth]
#
# The number of past ledgers to serve to other peers that request historical
@@ -578,7 +528,7 @@
# [path_search_old]
#
# For clients that use the legacy path finding interfaces, the search
# agressivness to use. The default is 7.
# aggressiveness to use. The default is 7.
#
#
#
@@ -591,14 +541,14 @@
#
#-------------------------------------------------------------------------------
#
# 5. HTTPS Client
# 4. HTTPS Client
#
#----------------
#
# The rippled server instance uses HTTPS GET requests in a variety of
# circumstances, including but not limited to the SMS Messaging Gateway
# feature and also for contacting trusted domains to fetch information
# such as mapping an email address to a Ripple Payment Network address.
# circumstances, including but not limited to contacting trusted domains to
# fetch information such as mapping an email address to a Ripple Payment
# Network address.
#
# [ssl_verify]
#
@@ -633,7 +583,7 @@
#
#-------------------------------------------------------------------------------
#
# 6. Database
# 5. Database
#
#------------
#
@@ -666,16 +616,13 @@
# ...
#
# Examples:
# type=HyperLevelDB
# path=db/hyperldb
# compression=0
# type=rocksdb
# path=db/rocksdb
#
# Choices for 'type' (not case-sensitive)
# RocksDB Use Facebook's RocksDB database (preferred)
# NuDB Use Ripple Labs' NuDB (Windows preferred)
# HyperLevelDB (Deprecated)
# SQLite (Deprecated)
# LevelDB (Deprecated)
# none (No backend)
#
# Required keys:
@@ -708,13 +655,14 @@
# There are 4 book-keeping SQLite database that the server creates and
# maintains. If you omit this configuration setting, it will default to
# creating a directory called "db" located in the same place as your
# rippled.cfg file.
# rippled.cfg file. Partial pathnames will be considered relative to
# the location of the rippled executable.
#
#
#
#-------------------------------------------------------------------------------
#
# 7. Diagnostics
# 6. Diagnostics
#
#---------------
#
@@ -735,10 +683,10 @@
#
# [insight]
#
# Configuration parameters for the Beast.Insight stats collection module.
# Configuration parameters for the Beast. Insight stats collection module.
#
# Insight is a module that collects information from the areas of rippled
# that have instrumentation. The configuration paramters control where the
# that have instrumentation. The configuration parameters control where the
# collection metrics are sent. The parameters are expressed as key = value
# pairs with no white space. The main parameter is the choice of server:
#
@@ -770,7 +718,7 @@
#
#-------------------------------------------------------------------------------
#
# 8. Voting
# 7. Voting
#
#----------
#
@@ -797,7 +745,7 @@
#
# account_reserve = <drops>
#
# The account reserve requirement specified in drops. The portion of an
# The account reserve requirement is specified in drops. The portion of an
# account's XRP balance that is at or below the reserve may only be
# spent on transaction fees, and not transferred out of the account.
#
@@ -821,11 +769,11 @@
#
#-------------------------------------------------------------------------------
#
# 9. Example Settings
# 8. Example Settings
#
#--------------------
#
# Administrators can use these values as a starting poing for configuring
# Administrators can use these values as a starting point for configuring
# their instance of rippled, but each value should be checked to make sure
# it meets the business requirements for the organization.
#
@@ -878,7 +826,7 @@ port_wss_admin
[port_rpc]
port = 5005
ip = 127.0.0.1
admin = allow
admin = 127.0.0.1
protocol = https
[port_peer]
@@ -889,7 +837,7 @@ protocol = peer
[port_wss_admin]
port = 6006
ip = 127.0.0.1
admin = allow
admin = 127.0.0.1
protocol = wss
#[port_ws_public]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -2,33 +2,29 @@
"name": "rippled",
"version": "0.0.1",
"description": "Rippled Server",
"private": true,
"directories": {
"test": "test"
},
"dependencies": {
"ripple-lib": "0.8.2",
"async": "~0.2.9",
"deep-equal": "0.0.0",
"extend": "~1.2.0",
"simple-jsonrpc": "~0.0.2",
"deep-equal": "0.0.0"
"request": "^2.47.0",
"ripple-lib": "0.10.0",
"simple-jsonrpc": "~0.0.2"
},
"devDependencies": {
"coffee-script": "~1.6.3",
"mocha": "~1.13.0"
"assert-diff": "^1.0.1",
"coffee-script": "^1.8.0",
"mocha": "^2.1.0"
},
"scripts": {
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
},
"repository": {
"type": "git",
"url": "git://github.com/ripple/rippled.git"
},
"readmeFilename": "README.md"
}

View File

@@ -59,8 +59,6 @@
/** 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 0
@@ -182,13 +180,6 @@
#define RIPPLE_PROPOSE_AMENDMENTS 0
#endif
/** Config: RIPPLE_ENABLE_AUTOBRIDGING
This determines whether ripple implements offer autobridging via XRP.
*/
#ifndef RIPPLE_ENABLE_AUTOBRIDGING
#define RIPPLE_ENABLE_AUTOBRIDGING 0
#endif
/** Config: RIPPLE_SINGLE_IO_SERVICE_THREAD
When set, restricts the number of threads calling io_service::run to one.
This is useful when debugging.

View File

@@ -22,6 +22,8 @@
#endif
#include <beast/asio/impl/IPAddressConversion.cpp>
#include <beast/asio/impl/error.cpp>
#include <beast/asio/tests/bind_handler.test.cpp>
#include <beast/asio/tests/streambuf.test.cpp>
#include <beast/asio/tests/error_test.cpp>

View File

@@ -17,11 +17,11 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_SSL_H_INCLUDED
#define BEAST_ASIO_SSL_H_INCLUDED
#ifndef BEAST_ASIO_ERROR_H_INCLUDED
#define BEAST_ASIO_ERROR_H_INCLUDED
#include <boost/asio.hpp>
#include <boost/asio/ssl/error.hpp>
#include <boost/system/error_code.hpp>
namespace beast {
namespace asio {
@@ -32,8 +32,12 @@ bool
is_short_read (boost::system::error_code const& ec)
{
return (ec.category() == boost::asio::error::get_ssl_category())
&& (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ);
&& (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ);
}
/** Returns a human readable message if the error code is SSL related. */
std::string
asio_message(boost::system::error_code const& ec);
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
/*
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 <beast/asio/error.h>
#include <boost/lexical_cast.hpp>
namespace beast {
namespace asio {
// This buffer must be at least 120 bytes, most examples use 256.
// https://www.openssl.org/docs/crypto/ERR_error_string.html
static std::uint32_t const errorBufferSize (256);
std::string
asio_message (boost::system::error_code const& ec)
{
std::string error;
if (ec.category () == boost::asio::error::get_ssl_category ())
{
error = " ("
+ boost::lexical_cast<std::string> (ERR_GET_LIB (ec.value ()))
+ ","
+ boost::lexical_cast<std::string> (ERR_GET_FUNC (ec.value ()))
+ ","
+ boost::lexical_cast<std::string> (ERR_GET_REASON (ec.value ()))
+ ") ";
//
char buf[errorBufferSize];
::ERR_error_string_n (ec.value (), buf, errorBufferSize);
error += buf;
}
else
{
error = ec.message ();
}
return error;
}
}
}

View File

@@ -17,30 +17,28 @@
*/
//==============================================================================
#ifndef BEAST_SQLITE_H_INCLUDED
#define BEAST_SQLITE_H_INCLUDED
#include <beast/asio/error.h>
#include <beast/unit_test/suite.h>
#include <string>
/** A self-contained, serverless, zero configuration, transactional SQL engine.
namespace beast {
namespace asio {
This external module provides the SQLite embedded database library.
class error_test : public unit_test::suite
{
public:
void run ()
{
{
boost::system::error_code ec = boost::system::error_code (335544539,
boost::asio::error::get_ssl_category ());
std::string const s = beast::asio::asio_message (ec);
expect(s == " (20,0,219) error:140000DB:SSL routines:SSL routines:short read");
}
}
};
SQLite is public domain software, visit http://sqlite.org
*/
BEAST_DEFINE_TESTSUITE(error,asio,beast);
#include <beast/config/PlatformConfig.h>
#if BEAST_IOS || BEAST_MAC
# define BEAST_HAVE_NATIVE_SQLITE 1
#else
# define BEAST_HAVE_NATIVE_SQLITE 0
#endif
#ifndef BEAST_SQLITE_CPP_INCLUDED
# if BEAST_USE_NATIVE_SQLITE && BEAST_HAVE_NATIVE_SQLITE
#include <sqlite3.h>
# else
#include <beast/module/sqlite/sqlite/sqlite3.h> // Amalgamated
# endif
#endif
#endif
}
}

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CHRONO_UTIL_H_INCLUDED
#define BEAST_CHRONO_UTIL_H_INCLUDED
#ifndef BEAST_CHRONO_CHRONO_UTIL_H_INCLUDED
#define BEAST_CHRONO_CHRONO_UTIL_H_INCLUDED
// From Howard Hinnant
// http://home.roadrunner.com/~hinnant/duration_io/chrono_util.html

View File

@@ -88,6 +88,6 @@ public:
}
};
BEAST_DEFINE_TESTSUITE(abstract_clock,chrono,beast);
BEAST_DEFINE_TESTSUITE_MANUAL(abstract_clock,chrono,beast);
}

View File

@@ -20,6 +20,9 @@
// Ideas from boost
// Intel
#ifndef BEAST_CONFIG_SELECTCOMPILERCONFIG_H_INCLUDED
#define BEAST_CONFIG_SELECTCOMPILERCONFIG_H_INCLUDED
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
#define BEAST_COMPILER_CONFIG "config/compiler/Intel.h"
@@ -42,3 +45,4 @@
#error "Unsupported compiler."
#endif
#endif

View File

@@ -20,6 +20,9 @@
// Ideas from boost
// Android, which must be manually set by defining BEAST_ANDROID
#ifndef BEAST_CONFIG_SELECTPLATFORMCONFIG_H_INCLUDED
#define BEAST_CONFIG_SELECTPLATFORMCONFIG_H_INCLUDED
#if defined(BEAST_ANDROID)
#define BEAST_PLATFORM_CONFIG "config/platform/Android.h"
@@ -42,3 +45,4 @@
#else
#error "Unsupported platform."
#endif
#endif

View File

@@ -19,4 +19,8 @@
// Microsoft Visual C++ compiler configuration
#ifndef BEAST_CONFIG_COMPILER_VISUALC_H_INCLUDED
#define BEAST_CONFIG_COMPILER_VISUALC_H_INCLUDED
#include <beast/utility/noexcept.h>
#endif

View File

@@ -19,8 +19,12 @@
// Android platform configuration
#ifndef BEAST_CONFIG_PLATFORM_ANDROID_H_INCLUDED
#define BEAST_CONFIG_PLATFORM_ANDROID_H_INCLUDED
#ifdef BEAST_ANDROID
#undef BEAST_ANDROID
#endif
#define BEAST_ANDROID 1
#endif

View File

@@ -22,4 +22,3 @@
#endif
#include <beast/container/tests/aged_associative_container.test.cpp>
#include <beast/container/tests/buffer_view.test.cpp>

View File

@@ -27,8 +27,8 @@
*/
//==============================================================================
#ifndef BEAST_CYCLIC_ITERATOR_H_INCLUDED
#define BEAST_CYCLIC_ITERATOR_H_INCLUDED
#ifndef BEAST_CONTAINER_CYCLIC_ITERATOR_H_INCLUDED
#define BEAST_CONTAINER_CYCLIC_ITERATOR_H_INCLUDED
#include <iterator>
#include <boost/iterator/iterator_facade.hpp>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINER_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#ifndef BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#include <type_traits>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINER_AGED_CONTAINER_ITERATOR_H_INCLUDED
#define BEAST_CONTAINER_AGED_CONTAINER_ITERATOR_H_INCLUDED
#ifndef BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_CONTAINER_ITERATOR_H_INCLUDED
#include <iterator>
#include <type_traits>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINER_AGED_ORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_AGED_ORDERED_CONTAINER_H_INCLUDED
#ifndef BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
#include <beast/container/detail/aged_container_iterator.h>
#include <beast/container/detail/aged_associative_container.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINER_AGED_UNORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_AGED_UNORDERED_CONTAINER_H_INCLUDED
#ifndef BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
#include <beast/container/detail/aged_container_iterator.h>
#include <beast/container/detail/aged_associative_container.h>

View File

@@ -387,10 +387,10 @@ public:
template <class Cont>
static
std::list <typename Cont::value_type>
std::vector <typename Cont::value_type>
make_list (Cont const& c)
{
return std::list <typename Cont::value_type> (
return std::vector <typename Cont::value_type> (
c.begin(), c.end());
}

View File

@@ -1,320 +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 <beast/unit_test/suite.h>
#include <beast/container/buffer_view.h>
#include <beast/cxx14/algorithm.h> // <algorithm>
namespace beast {
class buffer_view_test : public unit_test::suite
{
public:
// Returns `true` if the iterator distance matches the size
template <class FwdIt, class Size>
static bool eq_dist (FwdIt first, FwdIt last, Size size)
{
auto const dist (std::distance (first, last));
static_assert (std::is_signed <decltype (dist)>::value,
"dist must be signed");
if (dist < 0)
return false;
return static_cast <Size> (dist) == size;
}
// Check the contents of a buffer_view against the container
template <class C, class T>
void check (C const& c, buffer_view <T> v)
{
expect (! v.empty() || c.empty());
expect (v.size() == c.size());
expect (v.max_size() == v.size());
expect (v.capacity() == v.size());
expect (eq_dist (v.begin(), v.end(), v.size()));
expect (eq_dist (v.cbegin(), v.cend(), v.size()));
expect (eq_dist (v.rbegin(), v.rend(), v.size()));
expect (eq_dist (v.crbegin(), v.crend(), v.size()));
expect (std::equal (
c.cbegin(), c.cend(), v.cbegin(), v.cend()));
expect (std::equal (
c.crbegin(), c.crend(), v.crbegin(), v.crend()));
if (v.size() == c.size())
{
if (! v.empty())
{
expect (v.front() == c.front());
expect (v.back() == c.back());
}
for (std::size_t i (0); i < v.size(); ++i)
expect (v[i] == c[i]);
}
}
//--------------------------------------------------------------------------
// Call at() with an invalid index
template <class V>
void checkBadIndex (V& v,
std::enable_if_t <
std::is_const <typename V::value_type>::value>* = 0)
{
try
{
v.at(0);
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
}
// Call at() with an invalid index
template <class V>
void checkBadIndex (V& v,
std::enable_if_t <
! std::is_const <typename V::value_type>::value>* = 0)
{
try
{
v.at(0);
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
try
{
v.at(0) = 1;
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
}
// Checks invariants for an empty buffer_view
template <class V>
void checkEmpty (V& v)
{
expect (v.empty());
expect (v.size() == 0);
expect (v.max_size() == v.size());
expect (v.capacity() == v.size());
expect (v.begin() == v.end());
expect (v.cbegin() == v.cend());
expect (v.begin() == v.cend());
expect (v.rbegin() == v.rend());
expect (v.crbegin() == v.rend());
checkBadIndex (v);
}
// Test empty containers
void testEmpty()
{
testcase ("empty");
buffer_view <char> v1;
checkEmpty (v1);
buffer_view <char> v2;
swap (v1, v2);
checkEmpty (v1);
checkEmpty (v2);
buffer_view <char const> v3 (v2);
checkEmpty (v3);
}
//--------------------------------------------------------------------------
// Construct const views from a container
template <class C>
void testConstructConst (C const& c)
{
typedef buffer_view <std::add_const_t <
typename C::value_type>> V;
{
// construct from container
V v (c);
check (c, v);
// construct from buffer_view
V v2 (v);
check (c, v2);
}
if (! c.empty())
{
{
// construct from const pointer range
V v (&c.front(), &c.back()+1);
check (c, v);
// construct from pointer and size
V v2 (&c.front(), c.size());
check (v, v2);
}
{
// construct from non const pointer range
C cp (c);
V v (&cp.front(), &cp.back()+1);
check (cp, v);
// construct from pointer and size
V v2 (&cp.front(), cp.size());
check (v, v2);
// construct from data and size
V v3 (v2.data(), v2.size());
check (c, v3);
}
}
}
// Construct view from a container
template <class C>
void testConstruct (C const& c)
{
static_assert (! std::is_const <typename C::value_type>::value,
"Container value_type cannot be const");
testConstructConst (c);
typedef buffer_view <typename C::value_type> V;
C cp (c);
V v (cp);
check (cp, v);
std::reverse (v.begin(), v.end());
check (cp, v);
expect (std::equal (v.rbegin(), v.rend(),
c.begin(), c.end()));
}
void testConstruct()
{
testcase ("std::vector <char>");
testConstruct (
std::vector <char> ({'h', 'e', 'l', 'l', 'o'}));
testcase ("std::string <char>");
testConstruct (
std::basic_string <char> ("hello"));
}
//--------------------------------------------------------------------------
void testCoerce()
{
testcase ("coerce");
std::string const s ("hello");
const_buffer_view <unsigned char> v (s);
pass();
}
//--------------------------------------------------------------------------
void testAssign()
{
testcase ("testAssign");
std::vector <int> v1({1, 2, 3});
buffer_view<int> r1(v1);
std::vector <int> v2({4, 5, 6, 7});
buffer_view<int> r2(v2);
r1 = r2;
expect (std::equal (r1.begin(), r1.end(), v2.begin(), v2.end()));
}
//--------------------------------------------------------------------------
static_assert (std::is_constructible <buffer_view <int>,
std::vector <int>&>::value, "");
static_assert (!std::is_constructible <buffer_view <int>,
std::vector <int> const&>::value, "");
static_assert (std::is_constructible <buffer_view <int const>,
std::vector <int>&>::value, "");
static_assert (std::is_constructible <buffer_view <int const>,
std::vector <int> const&>::value, "");
static_assert (std::is_nothrow_default_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_destructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_copy_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_copy_assignable <
buffer_view<int>>::value, "");
static_assert (std::is_nothrow_move_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_move_assignable <
buffer_view <int>>::value, "");
void run()
{
testEmpty();
testConstruct();
testCoerce();
testAssign();
}
};
BEAST_DEFINE_TESTSUITE(buffer_view,container,beast);
}

View File

@@ -32,8 +32,8 @@
* $Id: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $
*/
#ifndef __SHA2_H__
#define __SHA2_H__
#ifndef BEAST_CRYPTO_SHA2_SHA2_H_INCLUDED
#define BEAST_CRYPTO_SHA2_SHA2_H_INCLUDED
//#ifdef __cplusplus
//extern "C" {

View File

@@ -26,8 +26,8 @@
// slower than MD5.
//
#ifndef BEAST_SPOOKYV2_H_INCLUDED
#define BEAST_SPOOKYV2_H_INCLUDED
#ifndef BEAST_HASH_SPOOKYV2_H_INCLUDED
#define BEAST_HASH_SPOOKYV2_H_INCLUDED
#include <stddef.h>

View File

@@ -57,8 +57,8 @@ It depends on successfully passing SMHasher test set.
10 is a perfect score.
*/
#ifndef BEAST_CONTAINER_XXHASH_H_INCLUDED
#define BEAST_CONTAINER_XXHASH_H_INCLUDED
#ifndef BEAST_HASH_XXHASH_H_INCLUDED
#define BEAST_HASH_XXHASH_H_INCLUDED
/*****************************
Includes

View File

@@ -18,8 +18,8 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINER_TESTS_HASH_METRICS_H_INCLUDED
#define BEAST_CONTAINER_TESTS_HASH_METRICS_H_INCLUDED
#ifndef BEAST_HASH_HASH_METRICS_H_INCLUDED
#define BEAST_HASH_HASH_METRICS_H_INCLUDED
#include <algorithm>
#include <cmath>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_HTTP_HEADER_TRAITS_H_INCLUDED
#define BEAST_HTTP_HEADER_TRAITS_H_INCLUDED
#ifndef BEAST_HTTP_DETAIL_HEADER_TRAITS_H_INCLUDED
#define BEAST_HTTP_DETAIL_HEADER_TRAITS_H_INCLUDED
#include <beast/utility/ci_char_traits.h>

View File

@@ -18,8 +18,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef http_parser_h
#define http_parser_h
#ifndef BEAST_HTTP_HTTP_PARSER_HTTP_PARSER_H_INCLUDED
#define BEAST_HTTP_HTTP_PARSER_HTTP_PARSER_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
@@ -134,7 +135,7 @@ enum flags
/* Map for errno-related constants
*
*
* The provided argument should be a macro that takes 2 arguments.
*/
#define HTTP_ERRNO_MAP(XX) \

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_ASYNCOBJECT_H_INCLUDED
#define BEAST_ASIO_ASYNCOBJECT_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_ASYNCOBJECT_H_INCLUDED
#define BEAST_MODULE_ASIO_ASYNCOBJECT_H_INCLUDED
#include <atomic>
#include <cassert>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_SYSTEM_BOOSTINCLUDES_H_INCLUDED
#define BEAST_ASIO_SYSTEM_BOOSTINCLUDES_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_BOOSTINCLUDES_H_INCLUDED
#define BEAST_MODULE_ASIO_BOOSTINCLUDES_H_INCLUDED
// Make sure we take care of fixing boost::bind oddities first.
#if !defined(BEAST_CORE_H_INCLUDED)

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPFIELD_H_INCLUDED
#define BEAST_ASIO_HTTPFIELD_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPFIELD_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPFIELD_H_INCLUDED
#include <beast/strings/String.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPHEADERS_H_INCLUDED
#define BEAST_ASIO_HTTPHEADERS_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPHEADERS_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPHEADERS_H_INCLUDED
#include <beast/module/asio/HTTPField.h>
#include <beast/module/core/text/StringPairArray.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPMESSAGE_H_INCLUDED
#define BEAST_ASIO_HTTPMESSAGE_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPMESSAGE_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPMESSAGE_H_INCLUDED
#include <beast/module/asio/HTTPHeaders.h>
#include <beast/module/asio/HTTPVersion.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPPARSER_H_INCLUDED
#define BEAST_ASIO_HTTPPARSER_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPPARSER_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPPARSER_H_INCLUDED
#include <beast/module/asio/HTTPRequest.h>
#include <beast/module/asio/HTTPResponse.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_HTTPPARSERIMPL_H_INCLUDED
#define BEAST_HTTPPARSERIMPL_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPPARSERIMPL_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPPARSERIMPL_H_INCLUDED
#include <beast/http/impl/joyent_parser.h>
#include <boost/asio/buffer.hpp>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPREQUEST_H_INCLUDED
#define BEAST_ASIO_HTTPREQUEST_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPREQUEST_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPREQUEST_H_INCLUDED
#include <beast/module/asio/HTTPMessage.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_HTTP_REQUESTPARSER_H_INCLUDED
#define BEAST_HTTP_REQUESTPARSER_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPREQUESTPARSER_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPREQUESTPARSER_H_INCLUDED
#include <beast/module/asio/HTTPParser.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPRESPONSE_H_INCLUDED
#define BEAST_ASIO_HTTPRESPONSE_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPRESPONSE_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPRESPONSE_H_INCLUDED
#include <beast/module/asio/HTTPMessage.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_HTTP_RESPONSEPARSER_H_INCLUDED
#define BEAST_HTTP_RESPONSEPARSER_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPRESPONSEPARSER_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPRESPONSEPARSER_H_INCLUDED
#include <beast/module/asio/HTTPParser.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_HTTPVERSION_H_INCLUDED
#define BEAST_ASIO_HTTPVERSION_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_HTTPVERSION_H_INCLUDED
#define BEAST_MODULE_ASIO_HTTPVERSION_H_INCLUDED
namespace beast {

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_SYSTEM_OPENSSLINCLUDES_H_INCLUDED
#define BEAST_ASIO_SYSTEM_OPENSSLINCLUDES_H_INCLUDED
#ifndef BEAST_MODULE_ASIO_OPENSSLINCLUDES_H_INCLUDED
#define BEAST_MODULE_ASIO_OPENSSLINCLUDES_H_INCLUDED
#define OPENSSL_THREAD_DEFINES
#include <openssl/opensslconf.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_ARRAY_H_INCLUDED
#define BEAST_ARRAY_H_INCLUDED
#ifndef BEAST_MODULE_CORE_CONTAINERS_ARRAY_H_INCLUDED
#define BEAST_MODULE_CORE_CONTAINERS_ARRAY_H_INCLUDED
#include <beast/module/core/containers/ArrayAllocationBase.h>
#include <beast/module/core/containers/ElementComparator.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_ARRAYALLOCATIONBASE_H_INCLUDED
#define BEAST_ARRAYALLOCATIONBASE_H_INCLUDED
#ifndef BEAST_MODULE_CORE_CONTAINERS_ARRAYALLOCATIONBASE_H_INCLUDED
#define BEAST_MODULE_CORE_CONTAINERS_ARRAYALLOCATIONBASE_H_INCLUDED
#include <beast/HeapBlock.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_ELEMENTCOMPARATOR_H_INCLUDED
#define BEAST_ELEMENTCOMPARATOR_H_INCLUDED
#ifndef BEAST_MODULE_CORE_CONTAINERS_ELEMENTCOMPARATOR_H_INCLUDED
#define BEAST_MODULE_CORE_CONTAINERS_ELEMENTCOMPARATOR_H_INCLUDED
#include <algorithm>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_H_INCLUDED
#define BEAST_CORE_H_INCLUDED
#ifndef BEAST_MODULE_CORE_CORE_H_INCLUDED
#define BEAST_MODULE_CORE_CORE_H_INCLUDED
// TargetPlatform.h should not use anything from BeastConfig.h
#include <beast/Config.h>
@@ -52,9 +52,7 @@
#include <beast/utility/Debug.h>
#include <beast/utility/Error.h>
#include <beast/utility/Journal.h>
#include <beast/utility/LeakChecked.h>
#include <beast/utility/PropertyStream.h>
#include <beast/utility/StaticObject.h>
#include <beast/module/core/system/StandardIncludes.h>
@@ -144,7 +142,6 @@ class FileOutputStream;
#include <beast/module/core/streams/FileInputSource.h>
#include <beast/module/core/streams/OutputStream.h>
#include <beast/module/core/files/FileOutputStream.h>
#include <beast/module/core/memory/SharedSingleton.h>
#include <beast/module/core/streams/MemoryOutputStream.h>
#include <beast/module/core/system/SystemStats.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_FATALERROR_H_INCLUDED
#define BEAST_CORE_FATALERROR_H_INCLUDED
#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_FATALERROR_H_INCLUDED
#define BEAST_MODULE_CORE_DIAGNOSTIC_FATALERROR_H_INCLUDED
#include <beast/strings/String.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
#define BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
#define BEAST_MODULE_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
namespace beast
{

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_SEMANTICVERSION_H_INCLUDED
#define BEAST_SEMANTICVERSION_H_INCLUDED
#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
#define BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
#include <vector>
#include <string>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_UNITTESTUTILITIES_H_INCLUDED
#define BEAST_UNITTESTUTILITIES_H_INCLUDED
#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_UNITTESTUTILITIES_H_INCLUDED
#define BEAST_MODULE_CORE_DIAGNOSTIC_UNITTESTUTILITIES_H_INCLUDED
#include <beast/module/core/files/File.h>
#include <beast/module/core/maths/Random.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_DIRECTORYITERATOR_H_INCLUDED
#define BEAST_DIRECTORYITERATOR_H_INCLUDED
#ifndef BEAST_MODULE_CORE_FILES_DIRECTORYITERATOR_H_INCLUDED
#define BEAST_MODULE_CORE_FILES_DIRECTORYITERATOR_H_INCLUDED
#include <memory>
@@ -41,7 +41,7 @@ namespace beast {
It can also guess how far it's got using a wildly inaccurate algorithm.
*/
class DirectoryIterator : LeakChecked <DirectoryIterator>
class DirectoryIterator
{
public:
//==============================================================================
@@ -119,7 +119,7 @@ public:
private:
//==============================================================================
class NativeIterator : LeakChecked <NativeIterator>
class NativeIterator
{
public:
NativeIterator (const File& directory, const String& wildCard);

View File

@@ -22,29 +22,16 @@
//==============================================================================
#include <beast/unit_test/suite.h>
#include <beast/utility/static_initializer.h>
#include <algorithm>
#include <memory>
namespace beast {
// We need to make a shared singleton or else there are
// issues with the leak detector and order of detruction.
//
class NonexistentHolder
File const& File::nonexistent()
{
public:
static NonexistentHolder* getInstance()
{
return SharedSingleton <NonexistentHolder>::getInstance();
}
File file;
};
File const& File::nonexistent ()
{
return NonexistentHolder::getInstance ()->file;
static beast::static_initializer<File> instance;
return *instance;
}
//------------------------------------------------------------------------------

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_FILE_H_INCLUDED
#define BEAST_FILE_H_INCLUDED
#ifndef BEAST_MODULE_CORE_FILES_FILE_H_INCLUDED
#define BEAST_MODULE_CORE_FILES_FILE_H_INCLUDED
#include <beast/module/core/containers/Array.h>
#include <beast/module/core/memory/MemoryBlock.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_FILEINPUTSTREAM_H_INCLUDED
#define BEAST_FILEINPUTSTREAM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_FILES_FILEINPUTSTREAM_H_INCLUDED
#define BEAST_MODULE_CORE_FILES_FILEINPUTSTREAM_H_INCLUDED
namespace beast
{
@@ -35,7 +35,6 @@ namespace beast
*/
class FileInputStream
: public InputStream
, LeakChecked <FileInputStream>
{
public:
//==============================================================================

View File

@@ -24,8 +24,8 @@
namespace beast
{
#ifndef BEAST_FILEOUTPUTSTREAM_H_INCLUDED
#define BEAST_FILEOUTPUTSTREAM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_FILES_FILEOUTPUTSTREAM_H_INCLUDED
#define BEAST_MODULE_CORE_FILES_FILEOUTPUTSTREAM_H_INCLUDED
//==============================================================================
/**
@@ -35,7 +35,6 @@ namespace beast
*/
class FileOutputStream
: public OutputStream
, LeakChecked <FileOutputStream>
{
public:
//==============================================================================

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_LOGGER_H_INCLUDED
#define BEAST_LOGGER_H_INCLUDED
#ifndef BEAST_MODULE_CORE_LOGGING_LOGGER_H_INCLUDED
#define BEAST_MODULE_CORE_LOGGING_LOGGER_H_INCLUDED
#include <beast/strings/String.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_RANDOM_H_INCLUDED
#define BEAST_RANDOM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_MATHS_RANDOM_H_INCLUDED
#define BEAST_MODULE_CORE_MATHS_RANDOM_H_INCLUDED
#include <cstddef>
#include <cstdint>

View File

@@ -21,11 +21,10 @@
*/
//==============================================================================
#ifndef BEAST_MEMORYBLOCK_H_INCLUDED
#define BEAST_MEMORYBLOCK_H_INCLUDED
#ifndef BEAST_MODULE_CORE_MEMORY_MEMORYBLOCK_H_INCLUDED
#define BEAST_MODULE_CORE_MEMORY_MEMORYBLOCK_H_INCLUDED
#include <beast/HeapBlock.h>
#include <beast/utility/LeakChecked.h>
#include <beast/strings/String.h>
namespace beast {
@@ -35,7 +34,7 @@ namespace beast {
A class to hold a resizable block of raw data.
*/
class MemoryBlock : LeakChecked <MemoryBlock>
class MemoryBlock
{
public:
//==============================================================================

View File

@@ -1,205 +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_SHAREDSINGLETON_H_INCLUDED
#define BEAST_SHAREDSINGLETON_H_INCLUDED
#include <beast/threads/SpinLock.h>
#include <beast/smart_ptr/SharedPtr.h>
#include <beast/module/core/time/AtExitHook.h>
#include <atomic>
namespace beast
{
/** Thread-safe singleton which comes into existence on first use. Use this
instead of creating objects with static storage duration. These singletons
are automatically reference counted, so if you hold a pointer to it in every
object that depends on it, the order of destruction of objects is assured
to be correct.
Object Requirements:
DefaultConstructible
TriviallyDestructible (when lifetime == neverDestroyed)
Destructible
@class SharedSingleton
@ingroup beast_core
*/
/** @{ */
class SingletonLifetime
{
public:
// It would be nice if we didn't have to qualify the enumeration but
// Argument Dependent Lookup is inapplicable here because:
//
// "Base classes dependent on a template parameter aren't part of lookup."
// - ville
//
/** Construction options for SharedSingleton
@ingroup beast_core
*/
enum Lifetime
{
/** Created on first use, destroyed when the last reference is removed.
*/
createOnDemand,
/** The singleton is created on first use and persists until program exit.
*/
persistAfterCreation,
/** The singleton is created when needed and never destroyed.
This is useful for applications which do not have a clean exit.
*/
neverDestroyed
};
};
//------------------------------------------------------------------------------
/** Wraps object to produce a reference counted singleton. */
template <class Object>
class SharedSingleton
: public Object
, private SharedObject
{
public:
typedef SharedPtr <SharedSingleton <Object> > Ptr;
static Ptr get (SingletonLifetime::Lifetime lifetime
= SingletonLifetime::persistAfterCreation)
{
StaticData& staticData (getStaticData ());
SharedSingleton* instance = staticData.instance;
if (instance == nullptr)
{
std::lock_guard <LockType> lock (staticData.mutex);
instance = staticData.instance;
if (instance == nullptr)
{
bassert (lifetime == SingletonLifetime::createOnDemand || ! staticData.destructorCalled);
staticData.instance = &staticData.object;
new (staticData.instance) SharedSingleton (lifetime);
std::atomic_thread_fence (std::memory_order_seq_cst);
instance = staticData.instance;
}
}
return instance;
}
// DEPRECATED LEGACY FUNCTION NAME
static Ptr getInstance (SingletonLifetime::Lifetime lifetime
= SingletonLifetime::persistAfterCreation)
{
return get (lifetime);
}
private:
explicit SharedSingleton (SingletonLifetime::Lifetime lifetime)
: m_lifetime (lifetime)
, m_exitHook (this)
{
if (m_lifetime == SingletonLifetime::persistAfterCreation ||
m_lifetime == SingletonLifetime::neverDestroyed)
this->incReferenceCount ();
}
~SharedSingleton ()
{
}
void onExit ()
{
if (m_lifetime == SingletonLifetime::persistAfterCreation)
this->decReferenceCount ();
}
void destroy () const
{
bool callDestructor;
// Handle the condition where one thread is releasing the last
// reference just as another thread is trying to acquire it.
//
{
StaticData& staticData (getStaticData ());
std::lock_guard <LockType> lock (staticData.mutex);
if (this->getReferenceCount() != 0)
{
callDestructor = false;
}
else
{
callDestructor = true;
staticData.instance = nullptr;
staticData.destructorCalled = true;
}
}
if (callDestructor)
{
bassert (m_lifetime != SingletonLifetime::neverDestroyed);
this->~SharedSingleton();
}
}
typedef SpinLock LockType;
// This structure gets zero-filled at static initialization time.
// No constructors are called.
//
class StaticData
{
public:
LockType mutex;
SharedSingleton* instance;
SharedSingleton object;
bool destructorCalled;
StaticData() = delete;
StaticData(StaticData const&) = delete;
StaticData& operator= (StaticData const&) = delete;
~StaticData() = delete;
};
static StaticData& getStaticData ()
{
static std::uint8_t storage [sizeof (StaticData)];
return *(reinterpret_cast <StaticData*> (&storage [0]));
}
friend class SharedPtr <SharedSingleton>;
friend class AtExitMemberHook <SharedSingleton>;
SingletonLifetime::Lifetime m_lifetime;
AtExitMemberHook <SharedSingleton> m_exitHook;
};
//------------------------------------------------------------------------------
} // beast
#endif

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_RESULT_H_INCLUDED
#define BEAST_RESULT_H_INCLUDED
#ifndef BEAST_MODULE_CORE_MISC_RESULT_H_INCLUDED
#define BEAST_MODULE_CORE_MISC_RESULT_H_INCLUDED
namespace beast
{

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_BASICNATIVEHEADERS_H_INCLUDED
#define BEAST_BASICNATIVEHEADERS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_NATIVE_BASICNATIVEHEADERS_H_INCLUDED
#define BEAST_MODULE_CORE_NATIVE_BASICNATIVEHEADERS_H_INCLUDED
#include <beast/Config.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_OSX_OBJCHELPERS_H_INCLUDED
#define BEAST_OSX_OBJCHELPERS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_NATIVE_OSX_OBJCHELPERS_H_INCLUDED
#define BEAST_MODULE_CORE_NATIVE_OSX_OBJCHELPERS_H_INCLUDED
namespace beast
{

View File

@@ -45,6 +45,9 @@ void CriticalSection::exit() const noexcept { pthread_mutex_unlock (&mutex);
void Process::terminate()
{
#ifndef BEAST_MODULE_CORE_NATIVE_POSIX_SHAREDCODE_H_INCLUDED
#define BEAST_MODULE_CORE_NATIVE_POSIX_SHAREDCODE_H_INCLUDED
#if BEAST_ANDROID || BEAST_BSD
// http://www.unix.com/man-page/FreeBSD/2/_exit/
::_exit (EXIT_FAILURE);
@@ -459,3 +462,4 @@ std::int64_t File::getVolumeTotalSize() const
}
} // beast
#endif

View File

@@ -399,7 +399,6 @@ bool File::setAsCurrentWorkingDirectory() const
//==============================================================================
class DirectoryIterator::NativeIterator::Pimpl
: LeakChecked <DirectoryIterator::NativeIterator::Pimpl>
{
public:
Pimpl (const File& directory, const String& wildCard)

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_FILEINPUTSOURCE_H_INCLUDED
#define BEAST_FILEINPUTSOURCE_H_INCLUDED
#ifndef BEAST_MODULE_CORE_STREAMS_FILEINPUTSOURCE_H_INCLUDED
#define BEAST_MODULE_CORE_STREAMS_FILEINPUTSOURCE_H_INCLUDED
namespace beast
{
@@ -35,7 +35,6 @@ namespace beast
*/
class FileInputSource
: public InputSource
, LeakChecked <FileInputSource>
{
public:
//==============================================================================

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_INPUTSOURCE_H_INCLUDED
#define BEAST_INPUTSOURCE_H_INCLUDED
#ifndef BEAST_MODULE_CORE_STREAMS_INPUTSOURCE_H_INCLUDED
#define BEAST_MODULE_CORE_STREAMS_INPUTSOURCE_H_INCLUDED
namespace beast
{
@@ -36,7 +36,7 @@ namespace beast
@see FileInputSource
*/
class InputSource : LeakChecked <InputSource>
class InputSource
{
public:
//==============================================================================

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_INPUTSTREAM_H_INCLUDED
#define BEAST_INPUTSTREAM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_STREAMS_INPUTSTREAM_H_INCLUDED
#define BEAST_MODULE_CORE_STREAMS_INPUTSTREAM_H_INCLUDED
namespace beast
{
@@ -38,7 +38,6 @@ class MemoryBlock;
@see OutputStream, FileInputStream
*/
class InputStream
: LeakChecked <InputStream>
{
public:
/** Destructor. */

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_MEMORYOUTPUTSTREAM_H_INCLUDED
#define BEAST_MEMORYOUTPUTSTREAM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_STREAMS_MEMORYOUTPUTSTREAM_H_INCLUDED
#define BEAST_MODULE_CORE_STREAMS_MEMORYOUTPUTSTREAM_H_INCLUDED
namespace beast
{
@@ -43,8 +43,7 @@ namespace beast
*/
class MemoryOutputStream
: public OutputStream
, LeakChecked <MemoryOutputStream>
{
{
public:
//==============================================================================
/** Creates an empty memory stream, ready to be written into.

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_OUTPUTSTREAM_H_INCLUDED
#define BEAST_OUTPUTSTREAM_H_INCLUDED
#ifndef BEAST_MODULE_CORE_STREAMS_OUTPUTSTREAM_H_INCLUDED
#define BEAST_MODULE_CORE_STREAMS_OUTPUTSTREAM_H_INCLUDED
namespace beast
{

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_STANDARDINCLUDES_H_INCLUDED
#define BEAST_STANDARDINCLUDES_H_INCLUDED
#ifndef BEAST_MODULE_CORE_SYSTEM_STANDARDINCLUDES_H_INCLUDED
#define BEAST_MODULE_CORE_SYSTEM_STANDARDINCLUDES_H_INCLUDED
// Include some common OS headers..
#if BEAST_MSVC

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_SYSTEMSTATS_H_INCLUDED
#define BEAST_SYSTEMSTATS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_SYSTEM_SYSTEMSTATS_H_INCLUDED
#define BEAST_MODULE_CORE_SYSTEM_SYSTEMSTATS_H_INCLUDED
namespace beast
{

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_LEXICALCAST_H_INCLUDED
#define BEAST_LEXICALCAST_H_INCLUDED
#ifndef BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED
#define BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED
#include <beast/Config.h>
#include <algorithm>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_STRINGARRAY_H_INCLUDED
#define BEAST_STRINGARRAY_H_INCLUDED
#ifndef BEAST_MODULE_CORE_TEXT_STRINGARRAY_H_INCLUDED
#define BEAST_MODULE_CORE_TEXT_STRINGARRAY_H_INCLUDED
#include <beast/strings/String.h>
#include <beast/module/core/containers/Array.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_STRINGPAIRARRAY_H_INCLUDED
#define BEAST_STRINGPAIRARRAY_H_INCLUDED
#ifndef BEAST_MODULE_CORE_TEXT_STRINGPAIRARRAY_H_INCLUDED
#define BEAST_MODULE_CORE_TEXT_STRINGPAIRARRAY_H_INCLUDED
#include <beast/module/core/text/StringArray.h>

View File

@@ -17,12 +17,13 @@
*/
//==============================================================================
#include <beast/utility/static_initializer.h>
namespace beast
{
class DeadlineTimer::Manager
: public LeakChecked <Manager>
, protected Thread
: protected Thread
{
private:
typedef CriticalSection LockType;
@@ -42,6 +43,14 @@ public:
bassert (m_items.empty ());
}
static
Manager&
instance()
{
static beast::static_initializer<Manager> m;
return *m;
}
// Okay to call on an active timer.
// However, an extra notification may still happen due to concurrency.
//
@@ -210,19 +219,18 @@ private:
DeadlineTimer::DeadlineTimer (Listener* listener)
: m_listener (listener)
, m_manager (SharedSingleton <Manager>::getInstance ())
, m_isActive (false)
{
}
DeadlineTimer::~DeadlineTimer ()
{
m_manager->deactivate (*this);
Manager::instance().deactivate (*this);
}
void DeadlineTimer::cancel ()
{
m_manager->deactivate (*this);
Manager::instance().deactivate (*this);
}
void DeadlineTimer::setExpiration (double secondsUntilDeadline)
@@ -232,7 +240,7 @@ void DeadlineTimer::setExpiration (double secondsUntilDeadline)
RelativeTime const when (
RelativeTime::fromStartup() + secondsUntilDeadline);
m_manager->activate (*this, 0, when);
Manager::instance().activate (*this, 0, when);
}
void DeadlineTimer::setRecurringExpiration (double secondsUntilDeadline)
@@ -242,7 +250,7 @@ void DeadlineTimer::setRecurringExpiration (double secondsUntilDeadline)
RelativeTime const when (
RelativeTime::fromStartup() + secondsUntilDeadline);
m_manager->activate (*this, secondsUntilDeadline, when);
Manager::instance().activate (*this, secondsUntilDeadline, when);
}
} // beast

View File

@@ -17,10 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_DEADLINETIMER_H_INCLUDED
#define BEAST_DEADLINETIMER_H_INCLUDED
#include <beast/module/core/memory/SharedSingleton.h>
#ifndef BEAST_MODULE_CORE_THREAD_DEADLINETIMER_H_INCLUDED
#define BEAST_MODULE_CORE_THREAD_DEADLINETIMER_H_INCLUDED
namespace beast {
@@ -108,7 +106,6 @@ private:
class Manager;
Listener* const m_listener;
SharedPtr <SharedSingleton <Manager> > m_manager;
bool m_isActive;
RelativeTime m_notificationTime;
double m_secondsRecurring; // non zero if recurring

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_THREAD_MUTEXTRAITS_H_INCLUDED
#define BEAST_CORE_THREAD_MUTEXTRAITS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREAD_MUTEXTRAITS_H_INCLUDED
#define BEAST_MODULE_CORE_THREAD_MUTEXTRAITS_H_INCLUDED
namespace beast
{

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_WORKERS_H_INCLUDED
#define BEAST_WORKERS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREAD_WORKERS_H_INCLUDED
#define BEAST_MODULE_CORE_THREAD_WORKERS_H_INCLUDED
#include <beast/threads/Thread.h>
#include <beast/threads/semaphore.h>

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_THREAD_DETAIL_SCOPEDLOCK_H_INCLUDED
#define BEAST_CORE_THREAD_DETAIL_SCOPEDLOCK_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREAD_DETAIL_SCOPEDLOCK_H_INCLUDED
#define BEAST_MODULE_CORE_THREAD_DETAIL_SCOPEDLOCK_H_INCLUDED
#include <beast/module/beast_core/thread/MutexTraits.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_CRITICALSECTION_H_INCLUDED
#define BEAST_CRITICALSECTION_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREADS_CRITICALSECTION_H_INCLUDED
#define BEAST_MODULE_CORE_THREADS_CRITICALSECTION_H_INCLUDED
#include <beast/module/core/threads/ScopedLock.h>
#include <cstdint>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_PROCESS_H_INCLUDED
#define BEAST_PROCESS_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREADS_PROCESS_H_INCLUDED
#define BEAST_MODULE_CORE_THREADS_PROCESS_H_INCLUDED
namespace beast {

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_SCOPEDLOCK_H_INCLUDED
#define BEAST_SCOPEDLOCK_H_INCLUDED
#ifndef BEAST_MODULE_CORE_THREADS_SCOPEDLOCK_H_INCLUDED
#define BEAST_MODULE_CORE_THREADS_SCOPEDLOCK_H_INCLUDED
namespace beast
{

View File

@@ -17,8 +17,9 @@
*/
//==============================================================================
namespace beast
{
#include <beast/utility/static_initializer.h>
namespace beast {
// Manages the list of hooks, and calls
// whoever is in the list at exit time.
@@ -33,7 +34,9 @@ public:
static inline Manager& get ()
{
return StaticObject <Manager>::get();
static beast::static_initializer<
Manager> instance;
return *instance;
}
void insert (Item& item)
@@ -73,10 +76,6 @@ private:
AtExitHook* const hook (item.hook ());
hook->onExit ();
}
// Now do the leak checking
//
LeakCheckedBase::checkForLeaks ();
}
struct StaticDestructor

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#ifndef BEAST_CORE_ATEXITHOOK_H_INCLUDED
#define BEAST_CORE_ATEXITHOOK_H_INCLUDED
#ifndef BEAST_MODULE_CORE_TIME_ATEXITHOOK_H_INCLUDED
#define BEAST_MODULE_CORE_TIME_ATEXITHOOK_H_INCLUDED
#include <beast/intrusive/List.h>

View File

@@ -21,8 +21,8 @@
*/
//==============================================================================
#ifndef BEAST_TIME_H_INCLUDED
#define BEAST_TIME_H_INCLUDED
#ifndef BEAST_MODULE_CORE_TIME_TIME_H_INCLUDED
#define BEAST_MODULE_CORE_TIME_TIME_H_INCLUDED
#include <beast/chrono/RelativeTime.h>

View File

@@ -1,115 +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.
Portions based on SOCI - The C++ Database Access Library:
SOCI: http://soci.sourceforge.net/
This file incorporates work covered by the following copyright
and permission notice:
Copyright (C) 2004 Maciej Sobczak, Stephen Hutton, Mateusz Loskot,
Pawel Aleksander Fedorynski, David Courtney, Rafal Bobrowski,
Julian Taylor, Henning Basold, Ilia Barahovski, Denis Arnaud,
Daniel Lidstr<74>m, Matthieu Kermagoret, Artyom Beilis, Cory Bennett,
Chris Weed, Michael Davidsaver, Jakub Stachowski, Alex Ott, Rainer Bauer,
Martin Muenstermann, Philip Pemberton, Eli Green, Frederic Chateau,
Artyom Tonkikh, Roger Orr, Robert Massaioli, Sergey Nikulov,
Shridhar Daithankar, S<>ren Meyer-Eppler, Mario Valesco.
Boost Software License - Version 1.0, August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
//==============================================================================
#ifndef BEAST_SQDB_BACKEND_H_INCLUDED
#define BEAST_SQDB_BACKEND_H_INCLUDED
#include <cstdint>
namespace beast {
namespace sqdb {
namespace detail {
//signed char
//wchar_t
// supported standard types for intos and uses
enum exchange_type
{
x_null, // only for input variables
x_bool,
x_char, x_uchar,
x_short, x_ushort,
x_int, x_uint,
x_long, x_ulong,
x_longlong, x_ulonglong,
x_float, x_double, x_longdouble,
x_cstring, // null terminated char*, only valid for use_type
x_cwstring, // null terminated wchar*, only valid for use_type
x_stdstring,
x_stdwstring,
x_beastString,
x_stdtm,
x_blob
};
} // detail
// the enum type for indicator variables
enum indicator
{
i_ok,
i_null,
i_truncated
};
// sqlite row id
//typedef sqlite3_int64 rowid;
typedef std::int64_t rowid;
} // sqdb
} // beast
#endif

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