diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 88336459ef..3acadeec1e 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,10 @@ +2013-04-11 Ramon Novoa + + * pandora_windows_service.cc, + pandora_windows_service.h, + udp_server/udp_server.cc: Added an option to force the sending of + data files. + 2013-04-11 Hirofumi Kosaka * pandora_windows_service.cc: Fixed possible resource leaks; diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index a0a2efc121..28bf884176 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -1740,6 +1740,11 @@ Pandora_Windows_Service::pandora_run_broker (string config) { void Pandora_Windows_Service::pandora_run () { + pandora_run (0); +} + +void +Pandora_Windows_Service::pandora_run (int forced_run) { Pandora_Agent_Conf *conf = NULL; string server_addr, conf_file, *all_conf; int startup_delay = 0; @@ -1821,7 +1826,7 @@ Pandora_Windows_Service::pandora_run () { /* Evaluate intensive conditions */ intensive_match = module->evaluateIntensiveConditions (); - if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { + if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { module->setNoOutput (); this->modules->goNext (); continue; @@ -1842,7 +1847,7 @@ Pandora_Windows_Service::pandora_run () { } } - if (data_flag == 1 || this->timestamp + this->interval_sec <= this->run_time) { + if (forced_run == 1 || data_flag == 1 || this->timestamp + this->interval_sec <= this->run_time) { // Send the XML if (!server_addr.empty ()) { diff --git a/pandora_agents/win32/pandora_windows_service.h b/pandora_agents/win32/pandora_windows_service.h index 539544276b..1226cacd69 100644 --- a/pandora_agents/win32/pandora_windows_service.h +++ b/pandora_agents/win32/pandora_windows_service.h @@ -89,6 +89,7 @@ namespace Pandora { Pandora_Windows_Service (); public: + void pandora_run (int forced_run); void pandora_run (); void pandora_init (); diff --git a/pandora_agents/win32/udp_server/udp_server.cc b/pandora_agents/win32/udp_server/udp_server.cc index f59153a6c6..09db298c95 100644 --- a/pandora_agents/win32/udp_server/udp_server.cc +++ b/pandora_agents/win32/udp_server/udp_server.cc @@ -215,7 +215,7 @@ int Pandora::process_command (Pandora_Windows_Service *service, char *command) { /* Re-run */ if (strcmp (operation, "REFRESH") == 0) { - service->pandora_run (); + service->pandora_run (1); return 0; }