mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-14 09:24:54 +02:00
2012-02-07 Ramon Novoa <rnovoa@artica.es>
* win32/pandora_windows_service.cc: Added a timeout to the tentacle client execution. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5507 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c43cafdf67
commit
928f8c4bf9
@ -1,3 +1,8 @@
|
|||||||
|
2012-02-07 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* win32/pandora_windows_service.cc: Added a timeout to the tentacle
|
||||||
|
client execution.
|
||||||
|
|
||||||
2011-12-13 Ramon Novoa <rnovoa@artica.es>
|
2011-12-13 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* win32/installer/pandora.mpi,
|
* win32/installer/pandora.mpi,
|
||||||
|
@ -447,6 +447,7 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
|
|||||||
string tentacle_cmd, working_dir;
|
string tentacle_cmd, working_dir;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
|
int tentacle_timeout = 0;
|
||||||
|
|
||||||
var = conf->getValue ("temporal");
|
var = conf->getValue ("temporal");
|
||||||
if (var[var.length () - 1] != '\\') {
|
if (var[var.length () - 1] != '\\') {
|
||||||
@ -487,9 +488,20 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
|
|||||||
CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) {
|
CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Timeout */
|
||||||
|
tentacle_timeout = atoi (conf->getValue ("tentacle_timeout").c_str ());
|
||||||
|
if (tentacle_timeout <= 0) {
|
||||||
|
tentacle_timeout = INFINITE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the return code of the tentacle client*/
|
if (WaitForSingleObject(pi.hProcess, tentacle_timeout) == WAIT_TIMEOUT) {
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
TerminateProcess(pi.hThread, STILL_ACTIVE);
|
||||||
|
CloseHandle (pi.hProcess);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the return code of the tentacle client*/
|
||||||
GetExitCodeProcess (pi.hProcess, &rc);
|
GetExitCodeProcess (pi.hProcess, &rc);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
CloseHandle (pi.hProcess);
|
CloseHandle (pi.hProcess);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user