Format some files for good code style (#196)

This commit is contained in:
An Tao 2019-07-16 20:00:20 +08:00 committed by GitHub
parent 007fee1043
commit 33577b9666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 12 deletions

View File

@ -21,7 +21,8 @@ void help::handleCommand(std::vector<std::string> &parameters)
{ {
if (parameters.size() == 0) if (parameters.size() == 0)
{ {
std::cout << "usage: drogon_ctl [-v | --version] [-h | --help] <command> [<args>]" std::cout << "usage: drogon_ctl [-v | --version] [-h | --help] "
"<command> [<args>]"
<< std::endl; << std::endl;
std::cout << "commands list:" << std::endl; std::cout << "commands list:" << std::endl;
for (auto &className : drogon::DrClassMap::getAllClassName()) for (auto &className : drogon::DrClassMap::getAllClassName())

View File

@ -70,6 +70,5 @@ class press : public DrObject<press>, public CommandHandler
std::unique_ptr<trantor::EventLoopThreadPool> _loopPool; std::unique_ptr<trantor::EventLoopThreadPool> _loopPool;
std::vector<HttpClientPtr> _clients; std::vector<HttpClientPtr> _clients;
Statistics _stat; Statistics _stat;
}; };
} // namespace drogon_ctl } // namespace drogon_ctl

View File

@ -64,7 +64,8 @@ char *CacheFile::data()
fflush(_file); fflush(_file);
auto fd = fileno(_file); auto fd = fileno(_file);
_dataLength = length(); _dataLength = length();
_data = static_cast<char *>(mmap(nullptr, _dataLength, PROT_READ, MAP_SHARED, fd, 0)); _data = static_cast<char *>(
mmap(nullptr, _dataLength, PROT_READ, MAP_SHARED, fd, 0));
if (_data == MAP_FAILED) if (_data == MAP_FAILED)
{ {
_data = nullptr; _data = nullptr;

View File

@ -202,7 +202,7 @@ void HttpAppFrameworkImpl::setSSLFiles(const std::string &certPath,
void HttpAppFrameworkImpl::run() void HttpAppFrameworkImpl::run()
{ {
// //
LOG_INFO << "Start to run..."; LOG_TRACE << "Start to run...";
trantor::AsyncFileLogger asyncFileLogger; trantor::AsyncFileLogger asyncFileLogger;
// Create dirs for cache files // Create dirs for cache files
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)

View File

@ -64,7 +64,8 @@ class ListenerManager : public trantor::NonCopyable
}; };
std::vector<ListenerInfo> _listeners; std::vector<ListenerInfo> _listeners;
std::vector<std::shared_ptr<HttpServer>> _servers; std::vector<std::shared_ptr<HttpServer>> _servers;
std::vector<std::shared_ptr<trantor::EventLoopThread>> _listeningloopThreads; std::vector<std::shared_ptr<trantor::EventLoopThread>>
_listeningloopThreads;
std::string _sslCertPath; std::string _sslCertPath;
std::string _sslKeyPath; std::string _sslKeyPath;
std::shared_ptr<trantor::EventLoopThreadPool> _ioLoopThreadPoolPtr; std::shared_ptr<trantor::EventLoopThreadPool> _ioLoopThreadPoolPtr;