Made campaignd to tell if connection is using gzipp
This commit is contained in:
parent
783c166b75
commit
004687e060
2 changed files with 15 additions and 2 deletions
|
@ -318,7 +318,7 @@ namespace {
|
|||
config data;
|
||||
while((sock = network::receive_data(data, 0, &gzipped)) != network::null_connection) {
|
||||
if(const config* req = data.child("request_campaign_list")) {
|
||||
LOG_CS << "sending campaign list to " << network::ip_address(sock) << "\n";
|
||||
LOG_CS << "sending campaign list to " << network::ip_address(sock) << (gzipped?" using gzip":"") << "\n";
|
||||
time_t epoch = time(NULL);
|
||||
config campaign_list;
|
||||
(campaign_list)["timestamp"] = lexical_cast<std::string>(epoch);
|
||||
|
@ -375,7 +375,7 @@ namespace {
|
|||
|
||||
network::send_data(response, sock, gzipped);
|
||||
} else if(const config* req = data.child("request_campaign")) {
|
||||
LOG_CS << "sending campaign '" << (*req)["name"] << "' to " << network::ip_address(sock) << "\n";
|
||||
LOG_CS << "sending campaign '" << (*req)["name"] << "' to " << network::ip_address(sock) << (gzipped?" using gzip":"") << "\n";
|
||||
config* const campaign = campaigns().find_child("campaign","name",(*req)["name"]);
|
||||
if(campaign == NULL) {
|
||||
|
||||
|
|
|
@ -82,6 +82,19 @@ struct connection_details {
|
|||
int remote_handle;
|
||||
|
||||
int connected_at;
|
||||
|
||||
bool operator>(const connection_details& o)
|
||||
{ return activity_key > o.get_key(); }
|
||||
|
||||
size_t get_key()
|
||||
{ return activity_key; }
|
||||
|
||||
void set_activity()
|
||||
{ }
|
||||
|
||||
private:
|
||||
size_t last_activity;
|
||||
size_t activity_key;
|
||||
};
|
||||
|
||||
typedef std::map<network::connection,connection_details> connection_map;
|
||||
|
|
Loading…
Add table
Reference in a new issue