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:
parent
5face9a62d
commit
c65547879e
|
@ -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>
|
2011-09-15 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
* win32/pandora_windows_service.cc: Fixed problem sending xml file.
|
* win32/pandora_windows_service.cc: Fixed problem sending xml file.
|
||||||
|
|
|
@ -113,6 +113,8 @@ writeBrokerConf(string path_broker, string filename, string name_broker){
|
||||||
string buffer;
|
string buffer;
|
||||||
string comp;
|
string comp;
|
||||||
unsigned int pos;
|
unsigned int pos;
|
||||||
|
int i;
|
||||||
|
int ok;
|
||||||
|
|
||||||
/* Read and set the file */
|
/* Read and set the file */
|
||||||
while (!file_conf.eof ()) {
|
while (!file_conf.eof ()) {
|
||||||
|
@ -121,8 +123,16 @@ writeBrokerConf(string path_broker, string filename, string name_broker){
|
||||||
|
|
||||||
pos = buffer.find("agent_name");
|
pos = buffer.find("agent_name");
|
||||||
if (pos != string::npos){
|
if (pos != string::npos){
|
||||||
comp = buffer.substr (0,12);
|
ok = 1;
|
||||||
if (comp == "# agent_name"){
|
|
||||||
|
for(i=0; i < pos; i++) {
|
||||||
|
|
||||||
|
if(buffer[i] != ' ' && buffer[i] != '\t' && buffer[i] != '#') {
|
||||||
|
ok = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
buffer = "agent_name "+name_broker+"\n";
|
buffer = "agent_name "+name_broker+"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue