diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-01-15 09:25:19 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-01-15 09:27:21 +0100 |
commit | 9ca6e047907fec88167e1a2b9bc9c40faa824600 (patch) | |
tree | 4f849f582ecd0e54887fcf4c0fea7780e5a43b33 /src | |
parent | e0cd2f55233d10476b75ac75df95a079735921ec (diff) | |
parent | 1dd8ee72afc26191da51d8d3a5590eab7c9368f6 (diff) |
Merge pull request #5655
1dd8ee7 improve tests for #5655 (Jonas Schnelli)
56c1093 fix tests for #5655 (Wladimir J. van der Laan)
16a5c18 Add a -rpckeepalive and disable RPC use of HTTP persistent connections. (Gregory Maxwell)
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 1 | ||||
-rw-r--r-- | src/rpcserver.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index d6f1e1cb9f..f851fcbbca 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -380,6 +380,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -rpcport=<port> " + strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 8332, 18332) + "\n"; strUsage += " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times") + "\n"; strUsage += " -rpcthreads=<n> " + strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4) + "\n"; + strUsage += " -rpckeepalive " + strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 0) + "\n"; strUsage += "\n" + _("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n"; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index a070ab5bbe..9ebacdbe2e 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -953,7 +953,7 @@ void ServiceConnection(AcceptedConnection *conn) ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto, MAX_SIZE); // HTTP Keep-Alive is false; close connection immediately - if (mapHeaders["connection"] == "close") + if ((mapHeaders["connection"] == "close") || (!GetBoolArg("-rpckeepalive", false))) fRun = false; // Process via JSON-RPC API |