fixes DI invocation parameters over stats server

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@283 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 20 years ago
parent 2d07b7b821
commit b7666d99ee

@ -291,7 +291,10 @@ int StatsUDPServer::execute(char* msg_buf, string& reply,
}
try {
AmArgArray args;
// args need to be stored in string vector,
// because stl copyconstructor does not copy
// underlying c_str
vector<string> s_args;
while (p<cmd_str.length()) {
p2 = cmd_str.find(' ', p);
if (p2 == string::npos) {
@ -300,12 +303,18 @@ int StatsUDPServer::execute(char* msg_buf, string& reply,
else
break;
}
args.push(cmd_str.substr(p, p2-p).c_str());
// DBG("mod '%s' added arg '%s'\n",
// fact_name.c_str(),
// cmd_str.substr(p, p2-p).c_str());
s_args.push_back(string(cmd_str.substr(p, p2-p)));
p=p2+1;
}
AmArgArray args;
for (vector<string>::iterator it = s_args.begin();
it != s_args.end(); it++) {
args.push(it->c_str());
// DBG("mod '%s' added arg a '%s'\n",
// fact_name.c_str(),
// it->c_str());
}
AmDynInvokeFactory* di_f = AmPlugIn::instance()->getFactory4Di(fact_name);
if(!di_f){
reply = "could not get '" + fact_name + "' factory\n";

Loading…
Cancel
Save