mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 00:39:02 +00:00
wesnothd: Only reset the commands FIFO stream when reloading if needed
May or may not fix the issue noted in commit 62eb55a5a712b3e2157cf7fc0bb12873c4f0a574 regarding the SIGHUP handler, which is in charge of scheduling load_config() to run. Rather unfortunately, I'm unable to reproduce the issue on my own machine, so I'll have to take this to production and test it live.
This commit is contained in:
parent
46815ee008
commit
6629fdf64e
@ -333,6 +333,7 @@ server::server(int port, const std::string& config_file, size_t min_threads,
|
||||
not_logged_in_(),
|
||||
rooms_(players_),
|
||||
input_(),
|
||||
input_path_(),
|
||||
config_file_(config_file),
|
||||
cfg_(read_config()),
|
||||
accepted_versions_(),
|
||||
@ -499,8 +500,11 @@ void server::load_config() {
|
||||
# endif
|
||||
#endif
|
||||
const std::string fifo_path = (cfg_["fifo_path"].empty() ? std::string(FIFODIR) + "/socket" : std::string(cfg_["fifo_path"]));
|
||||
input_.reset();
|
||||
input_.reset(new input_stream(fifo_path));
|
||||
// Reset (replace) the input stream only if the FIFO path changed.
|
||||
if(fifo_path != input_path_) {
|
||||
input_.reset(new input_stream(fifo_path));
|
||||
}
|
||||
input_path_ = fifo_path;
|
||||
|
||||
save_replays_ = cfg_["save_replays"].to_bool();
|
||||
replay_save_path_ = cfg_["replay_save_path"].str();
|
||||
|
@ -106,6 +106,7 @@ private:
|
||||
|
||||
/** server socket/fifo. */
|
||||
boost::scoped_ptr<input_stream> input_;
|
||||
std::string input_path_;
|
||||
|
||||
const std::string config_file_;
|
||||
config cfg_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user