Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Jun 19, 2020
1 parent 3206f8a commit c4787de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions openstreetmap-cgimap.1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Write pid to \fIPIDFILE\fR.
.BR \-\-logfile =\fILOGFILE\fR
File to write log messages to.
.TP
.BR \-\-configfile =\fICONFIGFILE\fR
File to read configuration values from.
.TP
.BR \-\-memcache =\fISPEC\fR
Memcache server specification.
.TP
Expand Down
1 change: 0 additions & 1 deletion src/api06/map_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ map_responder::map_responder(mime::type mt, bbox b, data_selection_ptr &x)
// are in or used by elements in the bbox
int num_nodes = sel->select_nodes_from_bbox(b, global_settings::get_map_max_nodes());

// TODO: make configurable parameter?
if (num_nodes > global_settings::get_map_max_nodes()) {
throw http::bad_request(
(format("You requested too many nodes (limit is %1%). "
Expand Down
1 change: 0 additions & 1 deletion src/api07/map_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ map_responder::map_responder(mime::type mt, bbox b, data_selection_ptr &x)
// are in or used by elements in the bbox
int num_nodes = sel->select_nodes_from_bbox(b, global_settings::get_map_max_nodes());

// TODO: make configurable parameter?
if (num_nodes > global_settings::get_map_max_nodes()) {
throw http::bad_request(
(format("You requested too many nodes (limit is %1%). "
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void get_options(int argc, char **argv, po::variables_map &options) {
("maxdebt", po::value<int>(), "maximum debt (in Mb) to allow each client before rate limiting")
("port", po::value<int>(), "FCGI port number (e.g. 8000) to listen on. This option is for backwards compatibility, please use --socket for new configurations.")
("socket", po::value<string>(), "FCGI port number (e.g. :8000) or UNIX socket to listen on")
("config", po::value<string>(), "Config file")
("configfile", po::value<string>(), "Config file")
;
// clang-format on

Expand All @@ -136,8 +136,8 @@ static void get_options(int argc, char **argv, po::variables_map &options) {
po::store(po::parse_command_line(argc, argv, desc), options);
po::store(po::parse_environment(desc, environment_option_name), options);

if (options.count("config")) {
auto config_fname = options["config"].as<std::string>();
if (options.count("configfile")) {
auto config_fname = options["configfile"].as<std::string>();
std::ifstream ifs(config_fname.c_str());
if(ifs.fail()) {
throw std::runtime_error("Error opening config file: " + config_fname);
Expand Down

0 comments on commit c4787de

Please # to comment.