2013-04-11 Ramon Novoa <rnovoa@artica.es>

* pandora_windows_service.cc,
	  pandora_windows_service.h,
	  udp_server/udp_server.cc: Added an option to force the sending of
	  data files.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7964 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2013-04-11 15:39:28 +00:00
parent 0efb6f843b
commit b6d9536abb
4 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2013-04-11 Ramon Novoa <rnovoa@artica.es>
* 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 <kosaka@rworks.jp>
* pandora_windows_service.cc: Fixed possible resource leaks;

View File

@ -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 ()) {

View File

@ -89,6 +89,7 @@ namespace Pandora {
Pandora_Windows_Service ();
public:
void pandora_run (int forced_run);
void pandora_run ();
void pandora_init ();

View File

@ -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;
}