aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* rpc: Split option -rpctimeout into -rpcservertimeout and -rpcclienttimeoutWladimir J. van der Laan2015-09-214-4/+7
| | | | | | | | | | | | | | The two timeouts for the server and client, are essentially different: - In the case of the server it should be a lower value to avoid clients clogging up connection slots - In the case of the client it should be a high value to accomedate slow responses from the server, for example for slow queries or when the lock is contended Split the options into `-rpcservertimeout` and `-rpcclienttimeout` with respective defaults of 30 and 900.
* http: Disable libevent debug logging, if not explicitly enabledWladimir J. van der Laan2015-09-212-1/+20
| | | | | Add a option "-debug=libevent" to enable libevent debugging for troubleshooting. Libevent logging is redirected to our own log.
* init: Ignore SIGPIPEWladimir J. van der Laan2015-09-181-3/+1
| | | | | | | | Ignore SIGPIPE on all non-win32 OSes, otherwise an unexpectedly disconnecting RPC client will terminate the application. This problem was introduced with the libhttp-based RPC server. Fixes #6660.
* Merge pull request #6579Wladimir J. van der Laan2015-09-084-1/+26
|\ | | | | | | afb0cca Add NODE_BLOOM service bit and bump protocol version (Matt Corallo)
| * Add NODE_BLOOM service bit and bump protocol versionMatt Corallo2015-09-054-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lets nodes advertise that they offer bloom filter support explicitly. The protocol version bump allows SPV nodes to assume that NODE_BLOOM is set if NODE_NETWORK is set for pre-70011 nodes. Also adds an option to turn bloom filter support off for nodes which advertise a version number >= 70011. Nodes attempting to use bloom filters on such protocol versions are banned, and a later upgade should drop nodes of an older version which attempt to use bloom filters. Much code stolen from Peter Todd. Implements BIP 111
* | Merge pull request #6594Wladimir J. van der Laan2015-09-084-11/+21
|\ \ | | | | | | | | | 5ffaaba Disallow duplicate windows. (Casey Rodarmor)
| * | Disallow duplicate windows.Casey Rodarmor2015-09-044-11/+21
| |/
* | Merge pull request #6640Wladimir J. van der Laan2015-09-081-2/+2
|\ \ | | | | | | | | | eb3002b [TRIVIAL] Fix typo: exactmath -> exactmatch (paveljanik)
| * | [TRIVIAL] Fix typo: exactmath -> exactmatchpaveljanik2015-09-041-2/+2
| |/ | | | | ... but not yet in trivial tree
* | Merge pull request #6644Wladimir J. van der Laan2015-09-081-1/+1
|\ \ | | | | | | | | | 7a7e68d Prune the -prune help to reflect that the wallet is no longer disabled. (Gregory Maxwell)
| * | Prune the -prune help to reflect that the wallet is no longer disabled.Gregory Maxwell2015-09-071-1/+1
| |/ | | | | | | The wallet hasn't been disabled since 3201035f22fe451c808b0bb157d33a58f0d99c07.
* / Simplify logic of REST request suffix parsing.Daniel Kraft2015-09-071-25/+32
|/ | | | | | | | | | This patch changes the way the suffix (giving the requested data format) is parsed for REST requests. Before, the string was split at '.' characters and it was assumed that the second part was the suffix. Now, we look for the last dot and use that to determine the suffix. This allows for strings that contain dots (not used now, though), and seems, in general, to be clearer and more intuitive.
* net: correctly initialize nMinPingUsecTimeWladimir J. van der Laan2015-09-041-0/+1
| | | | | | `nMinPingUsecTime` was left uninitialized in CNode. The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that. Thanks @MarcoFalke for noticing.
* Merge pull request #6633Wladimir J. van der Laan2015-09-043-0/+4
|\ | | | | | | a6eb4ba Report minimum ping time in getpeerinfo (Matt Corallo)
| * Report minimum ping time in getpeerinfoMatt Corallo2015-09-033-0/+4
| |
* | Merge pull request #5677Wladimir J. van der Laan2015-09-0423-1081/+1374
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d528025 Revert "rpc-tests: re-enable rpc-tests for Windows" (Wladimir J. van der Laan) 1e700c9 doc: update deps in build-unix.md after libevent (Wladimir J. van der Laan) 26c9b83 Move windows socket init to utility function (Wladimir J. van der Laan) 4be0b08 libevent: Windows reuseaddr workaround in depends (Cory Fields) 3a174cd Fix race condition between starting HTTP server thread and setting EventBase() (Wladimir J. van der Laan) 6d2bc22 Document options for new HTTP/RPC server in --help (Wladimir J. van der Laan) be33f3f Implement RPCTimerHandler for Qt RPC console (Wladimir J. van der Laan) 57d85d9 doc: mention SSL support dropped for RPC in release notes (Wladimir J. van der Laan) 40b556d evhttpd implementation (Wladimir J. van der Laan) ee2a42b tests: GET requests cannot have request body, use POST in rest.py (Wladimir J. van der Laan) 6e996d3 tests: fix qt payment test (Cory Fields) 3140ef9 build: build-system changes for libevent (Wladimir J. van der Laan) a9af234 libevent: add depends (Cory Fields) 6a21dd5 Remove rpc_boostasiotocnetaddr test (Wladimir J. van der Laan) 8f9301c qa: Remove -rpckeepalive tests from httpbasics (Wladimir J. van der Laan) 51fcfc0 doc: remove documentation for rpcssl (Wladimir J. van der Laan)
| * | Move windows socket init to utility functionWladimir J. van der Laan2015-09-034-9/+21
| | |
| * | Fix race condition between starting HTTP server thread and setting EventBase()Wladimir J. van der Laan2015-09-033-10/+25
| | | | | | | | | | | | | | | | | | | | | Split StartHTTPServer into InitHTTPServer and StartHTTPServer to give clients a window to register their handlers without race conditions. Thanks @ajweiss for figuring this out.
| * | Document options for new HTTP/RPC server in --helpWladimir J. van der Laan2015-09-033-5/+13
| | |
| * | Implement RPCTimerHandler for Qt RPC consoleWladimir J. van der Laan2015-09-037-50/+67
| | | | | | | | | | | | | | | | | | | | | Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase` works with GUI and `-server=0`. Also simplify HTTPEvent-related code by using boost::function directly.
| * | evhttpd implementationWladimir J. van der Laan2015-09-0315-1049/+1299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - *Replace usage of boost::asio with [libevent2](http://libevent.org/)*. boost::asio is not part of C++11, so unlike other boost there is no forwards-compatibility reason to stick with it. Together with #4738 (convert json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with regard to compile-time slowness. - *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling is handled by libevent, a work queue (with configurable depth and parallelism) is used to handle application requests. - *Wrap HTTP request in C++ class*; this makes the application code mostly HTTP-server-neutral - *Refactor RPC to move all http-specific code to a separate file*. Theoreticaly this can allow building without HTTP server but with another RPC backend, e.g. Qt's debug console (currently not implemented) or future RPC mechanisms people may want to use. - *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL paths they want to handle. By using a proven, high-performance asynchronous networking library (also used by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided. What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests pass. The aim for now is everything but SSL support. Configuration options: - `-rpcthreads`: repurposed as "number of work handler threads". Still defaults to 4. - `-rpcworkqueue`: maximum depth of work queue. When this is reached, new requests will return a 500 Internal Error. - `-rpctimeout`: inactivity time, in seconds, after which to disconnect a client. - `-debug=http`: low-level http activity logging
| * | tests: fix qt payment testCory Fields2015-09-021-0/+4
| | | | | | | | | | | | | | | Now that boost no longer automatically initializes openssl, we have to do it ourselves.
| * | build: build-system changes for libeventWladimir J. van der Laan2015-09-023-6/+8
| | |
| * | Remove rpc_boostasiotocnetaddr testWladimir J. van der Laan2015-09-021-15/+0
| | | | | | | | | | | | Dropping all use of boost::asio.
* | | Merge pull request #6631Wladimir J. van der Laan2015-09-041-1/+1
|\ \ \ | | | | | | | | | | | | e83df07 Update RPC generate help for numblocks to include required (Ian T)
| * | | Update RPC generate help for numblocks to include requiredIan T2015-09-031-1/+1
| | |/ | |/| | | | The `generate` RPC has no default `numblocks` and a numeric value is required.
* | | Merge pull request #6630Wladimir J. van der Laan2015-09-035-2/+100
|\ \ \ | |/ / |/| | | | | 86270c8 Replace boost::reverse_lock with our own. (Casey Rodarmor)
| * | Replace boost::reverse_lock with our own.Casey Rodarmor2015-09-035-2/+100
| | |
* | | Merge pull request #6374Wladimir J. van der Laan2015-09-034-99/+220
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 027de94 Use network group instead of CNetAddr in final pass to select node to disconnect (Patrick Strateman) 000c18a Fix comment (Patrick Strateman) fed3094 Acquire cs_vNodes before changing refrence counts (Patrick Strateman) 69ee1aa CNodeRef copy constructor and assignment operator (Patrick Strateman) dc81dd0 Return false early if vEvictionCandidates is empty (Patrick Strateman) 17f3533 Better support for nodes with non-standard nMaxConnections (Patrick Strateman) 1317cd1 RAII wrapper for CNode* (Patrick Strateman) df23937 Add comments to AttemptToEvictConnection (Patrick Strateman) a8f6e45 Remove redundant whiteconnections option (Patrick Strateman) b105ba3 Prefer to disconnect peers in favor of whitelisted peers (Patrick Strateman) 2c70153 AttemptToEvictConnection (Patrick Strateman) 4bac601 Record nMinPingUsecTime (Patrick Strateman) ae037b7 Refactor: Move failure conditions to the top of AcceptConnection (Patrick Strateman) 1ef4817 Refactor: Bail early in AcceptConnection (Patrick Strateman) 541a1dd Refactor: AcceptConnection (Patrick Strateman)
| * | Use network group instead of CNetAddr in final pass to select node to disconnectPatrick Strateman2015-08-301-10/+10
| | |
| * | Fix commentPatrick Strateman2015-08-251-1/+1
| | |
| * | Acquire cs_vNodes before changing refrence countsPatrick Strateman2015-08-251-2/+12
| | |
| * | CNodeRef copy constructor and assignment operatorPatrick Strateman2015-08-251-0/+16
| | |
| * | Return false early if vEvictionCandidates is emptyPatrick Strateman2015-08-221-3/+8
| | |
| * | Better support for nodes with non-standard nMaxConnectionsPatrick Strateman2015-08-221-1/+1
| | |
| * | RAII wrapper for CNode*Patrick Strateman2015-08-221-7/+18
| | |
| * | Add comments to AttemptToEvictConnectionPatrick Strateman2015-08-221-0/+7
| | |
| * | Remove redundant whiteconnections optionPatrick Strateman2015-08-223-41/+0
| | |
| * | Prefer to disconnect peers in favor of whitelisted peersPatrick Strateman2015-08-221-3/+6
| | |
| * | AttemptToEvictConnectionPatrick Strateman2015-08-221-10/+106
| | |
| * | Record nMinPingUsecTimePatrick Strateman2015-08-222-0/+3
| | |
| * | Refactor: Move failure conditions to the top of AcceptConnectionPatrick Strateman2015-08-221-6/+6
| | |
| * | Refactor: Bail early in AcceptConnectionPatrick Strateman2015-08-221-14/+21
| | |
| * | Refactor: AcceptConnectionPatrick Strateman2015-08-221-58/+62
| | |
* | | Merge pull request #6583Wladimir J. van der Laan2015-08-311-1/+5
|\ \ \ | | | | | | | | | | | | 9f3e48e add support for miniupnpc api version 14 (Pavel Vasin)
| * | | add support for miniupnpc api version 14Pavel Vasin2015-08-231-1/+5
| |/ / | | | | | | | | | The value of new arg ttl is set to 2 as it's recommended default.
* | | Make sure LogPrint strings are line-terminatedJ Ross Nicoll2015-08-291-1/+1
| | |
* | | Merge pull request #6530Wladimir J. van der Laan2015-08-261-4/+8
|\ \ \ | | | | | | | | | | | | c33c11e Improve addrman Select() performance when buckets are nearly empty (Pieter Wuille)
| * | | Improve addrman Select() performance when buckets are nearly emptyPieter Wuille2015-08-261-4/+8
| | |/ | |/|
* / | net: Set SO_REUSEADDR for Windows tooCory Fields2015-08-251-1/+3
|/ / | | | | | | | | | | When running the rpc tests in Wine, nodes often fail to listen on localhost due to a stale socket from a previous run. This aligns the behavior with other platforms.