Skip to content

Commit 6d2bc22

Browse files
committed
Document options for new HTTP/RPC server in --help
1 parent be33f3f commit 6d2bc22

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/httpserver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ bool StartHTTPServer(boost::thread_group& threadGroup)
355355
return false;
356356
}
357357

358-
evhttp_set_timeout(http, GetArg("-rpctimeout", 30));
358+
evhttp_set_timeout(http, GetArg("-rpctimeout", DEFAULT_HTTP_TIMEOUT));
359359
evhttp_set_max_body_size(http, MAX_SIZE);
360360
evhttp_set_gencb(http, http_request_cb, NULL);
361361

@@ -367,8 +367,8 @@ bool StartHTTPServer(boost::thread_group& threadGroup)
367367
}
368368

369369
LogPrint("http", "Starting HTTP server\n");
370-
int workQueueDepth = std::max((long)GetArg("-rpcworkqueue", 16), 1L);
371-
int rpcThreads = std::max((long)GetArg("-rpcthreads", 4), 1L);
370+
int workQueueDepth = std::max((long)GetArg("-rpcworkqueue", DEFAULT_HTTP_WORKQUEUE), 1L);
371+
int rpcThreads = std::max((long)GetArg("-rpcthreads", DEFAULT_HTTP_THREADS), 1L);
372372
LogPrintf("HTTP: creating work queue of depth %d and %d worker threads\n", workQueueDepth, rpcThreads);
373373
workQueue = new WorkQueue<HTTPClosure>(workQueueDepth);
374374

src/httpserver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include <boost/scoped_ptr.hpp>
1212
#include <boost/function.hpp>
1313

14+
static const int DEFAULT_HTTP_THREADS=4;
15+
static const int DEFAULT_HTTP_WORKQUEUE=16;
16+
static const int DEFAULT_HTTP_TIMEOUT=30;
17+
1418
struct evhttp_request;
1519
struct event_base;
1620
class CService;

src/init.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ std::string HelpMessage(HelpMessageMode mode)
388388
strUsage += HelpMessageOpt("-flushwallet", strprintf("Run a thread to flush wallet periodically (default: %u)", 1));
389389
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", 0));
390390
}
391-
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune"; // Don't translate these and qt below
391+
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http"; // Don't translate these and qt below
392392
if (mode == HMM_BITCOIN_QT)
393393
debugCategories += ", qt";
394394
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
@@ -438,7 +438,11 @@ std::string HelpMessage(HelpMessageMode mode)
438438
strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections"));
439439
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 8332, 18332));
440440
strUsage += HelpMessageOpt("-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"));
441-
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4));
441+
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS));
442+
if (showDebug) {
443+
strUsage += HelpMessageOpt("-rpcworkqueue=<n>", strprintf("Set the depth of the work queue to service RPC calls (default: %d)", DEFAULT_HTTP_WORKQUEUE));
444+
strUsage += HelpMessageOpt("-rpctimeout=<n>", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_TIMEOUT));
445+
}
442446

443447
if (mode == HMM_BITCOIN_QT)
444448
{

0 commit comments

Comments
 (0)