This repository has been archived by the owner on Feb 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge previous unstable version: 3.14.12+13rc
- Loading branch information
Showing
34 changed files
with
621 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef __CONFIG_CONTAINER_H__ | ||
#define __CONFIG_CONTAINER_H__ | ||
|
||
#include "data/config.h" | ||
|
||
/** Class for storing config, added to decompose config storage | ||
* from Protocol, as WelcomeProtocol needs to host Config */ | ||
class ConfigContainer { | ||
public: | ||
ConfigContainer( Config& config ) | ||
: config(config) | ||
{} | ||
|
||
virtual ~ConfigContainer() | ||
{} | ||
|
||
Config& get_config() | ||
{ | ||
return config; | ||
} | ||
|
||
protected: | ||
Config & config; | ||
|
||
}; | ||
|
||
#endif /* end of include guard: __CONFIG_CONTAINER_H__ */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
#include "utils/signals.h" | ||
#include "locations/location.h" | ||
#include "utils/config.h" | ||
|
||
class Protocol; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef __SERVER_CMD_GET_SERVER_CONFIG_H__ | ||
#define __SERVER_CMD_GET_SERVER_CONFIG_H__ | ||
|
||
#include "locations/command.h" | ||
#include "locations/config_container.h" | ||
|
||
#include "utils/ptree.h" | ||
|
||
class GetServerConfigRcv : public Command { | ||
public: | ||
GetServerConfigRcv( Protocol& prot , LocationsList& locs ) | ||
: prot(prot) , locs(locs) | ||
{ | ||
(void)prot; | ||
set_next( std::bind(&GetServerConfigRcv::parse_command,this,std::placeholders::_1) ); | ||
} | ||
|
||
virtual ~GetServerConfigRcv() | ||
{ | ||
} | ||
|
||
void parse_command( const std::string& line ) | ||
{ | ||
namespace bp = boost::property_tree; | ||
|
||
bp::ptree opts; | ||
|
||
/** Send all options */ | ||
Config& config = dynamic_cast<ConfigContainer*>(&prot)->get_config(); | ||
|
||
for( auto io=config.begin() ; io!=config.end() ; ++io ) | ||
/** prevent '.' from being path separator */ | ||
opts.put( boost::property_tree::path(io->first,'\0') , io->second ); | ||
|
||
apply( ptree_to_json( opts ) ); | ||
return; | ||
} | ||
|
||
protected: | ||
Protocol& prot; | ||
LocationsList& locs; | ||
}; | ||
|
||
#endif /* end of include guard: __SERVER_CMD_GET_SERVER_CONFIG_H__ */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.