mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-02-08 21:04:14 +00:00
parameter -htmldir
This commit is contained in:
parent
6957873a90
commit
bc0519068a
@ -982,7 +982,7 @@ void ServiceConnection(AcceptedConnection *conn)
|
||||
ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto);
|
||||
|
||||
if (strURI != "/" && strURI.find("..") == std::string::npos ) {
|
||||
filesystem::path pathFile = filesystem::path(GetDataDir()) / "html" / strURI;
|
||||
filesystem::path pathFile = filesystem::path(GetHTMLDir()) / strURI;
|
||||
std::string fname = pathFile.string();
|
||||
size_t qMarkIdx = fname.find('?');
|
||||
if( qMarkIdx != string::npos ) {
|
||||
|
@ -171,6 +171,7 @@ std::string HelpMessage()
|
||||
strUsage += " -pid=<file> " + _("Specify pid file (default: bitcoind.pid)") + "\n";
|
||||
strUsage += " -gen " + _("Generate coins (default: 0)") + "\n";
|
||||
strUsage += " -datadir=<dir> " + _("Specify data directory") + "\n";
|
||||
strUsage += " -htmldir=<dir> " + _("Specify HTML directory to serve (default: <data>/html)") + "\n";
|
||||
strUsage += " -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n";
|
||||
strUsage += " -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n";
|
||||
strUsage += " -proxy=<ip:port> " + _("Connect through socks proxy") + "\n";
|
||||
|
14
src/util.cpp
14
src/util.cpp
@ -1085,6 +1085,20 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
|
||||
return path;
|
||||
}
|
||||
|
||||
boost::filesystem::path GetHTMLDir()
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
fs::path path;
|
||||
|
||||
if (mapArgs.count("-htmldir")) {
|
||||
path = fs::system_complete(mapArgs["-htmldir"]);
|
||||
} else {
|
||||
path = GetDataDir() / "html";
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
boost::filesystem::path GetConfigFile()
|
||||
{
|
||||
boost::filesystem::path pathConfigFile(GetArg("-conf", "twister.conf"));
|
||||
|
@ -206,6 +206,7 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);
|
||||
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest);
|
||||
boost::filesystem::path GetDefaultDataDir();
|
||||
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
||||
boost::filesystem::path GetHTMLDir();
|
||||
boost::filesystem::path GetConfigFile();
|
||||
boost::filesystem::path GetPidFile();
|
||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user