2011-09-16 Dario Rodriguez <dario.rodriguez@artica.es>

* win32/pandora_agent_conf.cc: Fixed a problem generating broker conf
	files with wrong agent names.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4966 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2011-09-16 12:35:18 +00:00
parent 5face9a62d
commit c65547879e
2 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2011-09-16 Dario Rodriguez <dario.rodriguez@artica.es>
* win32/pandora_agent_conf.cc: Fixed a problem generating broker conf
files with wrong agent names.
2011-09-15 Vanessa Gil <vanessa.gil@artica.es>
* win32/pandora_windows_service.cc: Fixed problem sending xml file.

View File

@ -113,6 +113,8 @@ writeBrokerConf(string path_broker, string filename, string name_broker){
string buffer;
string comp;
unsigned int pos;
int i;
int ok;
/* Read and set the file */
while (!file_conf.eof ()) {
@ -121,8 +123,16 @@ writeBrokerConf(string path_broker, string filename, string name_broker){
pos = buffer.find("agent_name");
if (pos != string::npos){
comp = buffer.substr (0,12);
if (comp == "# agent_name"){
ok = 1;
for(i=0; i < pos; i++) {
if(buffer[i] != ' ' && buffer[i] != '\t' && buffer[i] != '#') {
ok = 0;
}
}
if (ok) {
buffer = "agent_name "+name_broker+"\n";
}
}