From fdd4f29e155ad80b3f585aada43caa23e52cb73d Mon Sep 17 00:00:00 2001
From: meini <meini@meini-desktop.ARBEITSGRUPPE>
Date: Sun, 22 Mar 2009 16:03:35 +0100
Subject: segfault fix & blocked console for [..]

---
 src/remoteConfig.cc |  349 ++++++++++++++++++++++++++++-----------------------
 src/remoteConfig.h  |   12 +-
 src/testmodul.cc    |   11 +-
 src/testmodul.h     |    3 -
 4 files changed, 207 insertions(+), 168 deletions(-)

diff --git a/src/remoteConfig.cc b/src/remoteConfig.cc
index 323321e88de3e3662862a4cde6288dd04563c8bf..4d900544aefe92f8e40e11e0e502521177240d83 100644
--- a/src/remoteConfig.cc
+++ b/src/remoteConfig.cc
@@ -19,13 +19,28 @@ replymessages:
 	4 Bytes		|4 Bytes	|lengthOfMessage Bytes
 	statusflags	|lengthOfMessage|Message
 **/
+
+struct rcMsgReq
+{
+	uint32_t len1;
+	uint32_t len2;
+	uint32_t len3;
+	char message[2048];
+}__attribute__((packed));
+struct rcMsgRes
+{
+	uint32_t status;
+	uint32_t length;
+	char message[2048];
+}__attribute__((packed));
+
 RemoteConfig::RemoteConfig()
 {
 
 }
-int RemoteConfig::remoteConfigAnnounce(char* name,ConfigVariable* cv)
+int RemoteConfig::remoteConfigAnnounce(ConfigVariable* cv)
 {
-	remoteVariables[name]=cv;
+	remoteVariables[cv->getName()]=cv;
 	return 0;
 }
 
@@ -35,23 +50,22 @@ void RemoteConfig::requestCreator (void *data, WriteMarshalStream* msOut)
 
 	if(msOut==NULL)//no stream? useless to walk on!
 	{
-		if(remoteConfig)*remoteConfig->shellClient->sockout << "RemoteConfig::requestCreator msOut==NULL" << std::endl;
-		GEA.dbg() << "RemoteConfig::requestCreator msOut==NULL" << std::endl;
+		//if(remoteConfig)*remoteConfig->shellClient->sockout << "RemoteConfig::requestCreator msOut==NULL" << std::endl;
+		//GEA.dbg() << "RemoteConfig::requestCreator msOut==NULL" << std::endl;
 		return;
 	}
 	if(data==NULL)//no data? that is quite strange
 	{
-		if(remoteConfig)*remoteConfig->shellClient->sockout <<  "RemoteConfig::requestCreator data==NULL" << std::endl;
-		GEA.dbg() << "RemoteConfig::requestCreator data==NULL" << std::endl;
+		//if(remoteConfig)*remoteConfig->shellClient->sockout <<  "RemoteConfig::requestCreator data==NULL" << std::endl;
+		//GEA.dbg() << "RemoteConfig::requestCreator data==NULL" << std::endl;
 		int length=0;
 		*msOut << (uint32_t) length;
 		return;
 	}
-	unsigned int* pidata = (unsigned int*) data;
-	unsigned int len1=*pidata;
-	unsigned int len2=*(++pidata);
-	unsigned int len3=*(++pidata);
-	if(len1<1&&len2<1&&len3<1)//0? we just want a list of configmodules!
+
+	struct rcMsgReq* rcmo=(struct rcMsgReq*)data;
+
+	if(rcmo->len1<1&&rcmo->len2<1&&rcmo->len3<1)//0? we just want a list of configmodules!
 	{
 		int length=0;
 		*msOut << (uint32_t) length;
@@ -59,24 +73,59 @@ void RemoteConfig::requestCreator (void *data, WriteMarshalStream* msOut)
 	}
 	//TODO einzelne laengen abfangen
 	unsigned char uc=' ';
-	char* pcdata = (char*)(((char*)data)+sizeof(len1)+sizeof(len2)+sizeof(len3));
-	
-	int length=len1+len2+len3+2;
+
+//		int length=0;
+//		*msOut << (uint32_t) length;
+
+
+	uint32_t length=rcmo->len1+rcmo->len2+rcmo->len3+2;
+	uint32_t l1=rcmo->len1;
+	uint32_t l2=rcmo->len2;
+
+
+//******************************
+/*
+	*msOut << (uint32_t) 18;//ok put the length in we'll need it
+	*msOut << (uint32_t) 9;
+	*msOut << (uint32_t) 7;
+char* buffer="testmodul testint ";
+std::pair<void *, unsigned int> v1(buffer,strlen(buffer));//and the messages!
+*msOut << v1;
+*/
+//******************************
+
 	*msOut << (uint32_t) length;//ok put the length in we'll need it
-	
-	std::pair<void *, unsigned int> v1(pcdata,len1);//and the messages!
+	*msOut << (uint32_t) l1;
+	*msOut << (uint32_t) l2;
+	length=rcmo->len1+rcmo->len2+rcmo->len3+2;
+	l1=rcmo->len1;
+	l2=rcmo->len2;
+	char* buffer=new char[length];
+	memcpy(buffer,rcmo->message,length);
+	std::pair<void *, unsigned int> v1(buffer,l1);//and the messages!
+//	std::pair<void *, unsigned int> v1(rcmo->message,l1);//and the messages!
+
 	*msOut << v1;
 	*msOut << uc;
-	std::pair<void *, unsigned int> v2(pcdata+len1,len2);//this one too
+	l1=rcmo->len1;
+	l2=rcmo->len2;
+
+	std::pair<void *, unsigned int> v2(buffer+l1,l2);//this one too
+//	std::pair<void *, unsigned int> v2(rcmo->message+l1,l2);//and the messages!
+
 	*msOut << v2;
 	*msOut << uc;
-	if(len3>0)//do we have a value?
+	l1=rcmo->len1;
+	l2=rcmo->len2;
+
+	if(rcmo->len3>0)//do we have a value?
 	{
-		std::pair<void *, unsigned int> v3(pcdata+len1+len2,len3);//well then push it in!
+		uint32_t l3=rcmo->len3;
+		std::pair<void *, unsigned int> v3(buffer+l1+l2,l3);//well then push it in!
+//		std::pair<void *, unsigned int> v3(rcmo->message+l1+l2,l3);//and the messages!
 		*msOut << v3;
 	}
-		
-
+	delete buffer;
 
 }
 
@@ -107,134 +156,86 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 {
 	RemoteConfig *self = static_cast<RemoteConfig*>(data);
 	self->shellClient = &sc;
+	self->shellOut=sc.sockout;	
 	REP_MAP_OBJ(SppManager2 *,sppManager);
-    	int cmd;
     	if ( (argc >= 2) )
 	{
-		cmd = 1;
-		if(!strcmp(argv[1], "[..]")) // FUER ALLE KNOTEN
-		{
-			if(argc>=3)
-			{//TODO CODE REUSE!!!!!!!!
-/*
-				for(int i=0;i<argc;i++)
-					printf("%i %s\n",i,argv[i]);
-*/
-				int length=strlen(argv[2]);
-				int length1=strlen(argv[3]);
-				if(argc==4)
-				{
-					int i=0;
-					char* buffer = new char[3*sizeof(unsigned int)+length+length1];
-					char* pbuffer = buffer;
-					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[2],length);pbuffer+=length;
-					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
-
-					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
-				}
-				if(argc==5)
-				{
-					int length2=strlen(argv[4]);
-					char* buffer = new char[3*sizeof(unsigned int)+length+length1+length2];
-					char* pbuffer = buffer;
-					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length2,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[2],length);pbuffer+=length;
-					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
-					memcpy(pbuffer,argv[4],length2);pbuffer+=length2;
-					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
-				}
-
-				//sppManager->sendRequestAll( 9761, &v, create_req, t_start, get_response);
+		struct rcMsgReq rcmo;
+		if(argc>=3)//lets build the request
+		{	
+			int length = strlen(argv[2]);
+			rcmo.len1=(strcspn(argv[2],"."));
+			if(length>rcmo.len1)
+			{
+				//rcmo.len1=(length==rcmo.len1?0:rcmo.len1);
+				rcmo.len2=length-1-rcmo.len1;
 			}
 			else
 			{
-				char* buffer = new char[3*sizeof(unsigned int)];
-				char* pbuffer = buffer;
-				int i=0;
-				memcpy(buffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-				memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-				memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-				gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-				sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
+				rcmo.len1=0;
+				rcmo.len2=0;
+			}
+			if(argc==3)
+			{
+				rcmo.len3=0;
+				//rcmo.message = new char[rcmo.len1+rcmo.len2];
+				memcpy(rcmo.message,argv[2],rcmo.len1);
+				memcpy(rcmo.message+rcmo.len1,argv[2]+rcmo.len1+1,rcmo.len2);
+			}
+			else if(argc==4)
+			{
+				rcmo.len3=strlen(argv[4]);
+				//rcmo.message = new char[rcmo.len1+rcmo.len2+rcmo.len3];
+				memcpy(rcmo.message,argv[2],rcmo.len1);
+				memcpy(rcmo.message+rcmo.len1,argv[2]+rcmo.len1+1,rcmo.len2);
+				memcpy(rcmo.message+rcmo.len1+rcmo.len2,argv[3],rcmo.len3);
 			}
-			
 		}
-		else // einzeln parsen
+		else
 		{
-			char* buffer=NULL;
-			if(argc>=3)
-			{	
-				int length=strlen(argv[2]);
-				int length1=strlen(argv[3]);
-
-				if(argc==4)
-				{
-					int i=0;
-					buffer = new char[3*sizeof(unsigned int)+length+length1];
-					char* pbuffer = buffer;
-					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[2],length);pbuffer+=length;
-					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
-					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-					//sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, emoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
-
-				}
-				if(argc==5)
-				{
-					int length2=strlen(argv[4]);
-					buffer = new char[3*sizeof(unsigned int)+length+length1+length2];
-					char* pbuffer = buffer;
-					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&length2,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[2],length);pbuffer+=length;
-					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
-					memcpy(pbuffer,argv[4],length2);pbuffer+=length2;
-					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-					//sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, remoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
-				}
-
-				//sppManager->sendRequestAll( 9761, &v, create_req, t_start, get_response);
-			}
+			rcmo.len1=0;
+			rcmo.len2=0;
+			rcmo.len3=0;
+			//rcmo.message = NULL;
+		}
+//		if(!strcmp(nodelist, "[..]")) //broadcast
+		if(!strcmp(argv[1], "[..]")) //broadcast
+		{
+			if(self->shellClient->state==ShellClient::CS_Idle)
+				self->shellClient->block();
+			gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
+			sppManager->sendRequestAll( 9876, (void*) &rcmo, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
+			//if(rcmo.message)delete rcmo.message;
+		}
+		else // single nodes
+		{
+			//if(self->shellClient->state==ShellClient::CS_Idle)
+			//	self->shellClient->block();
 			char * pch;
 			int i=0;
-			pch = strtok (argv[1],",[]");
+			pch = strtok (argv[1],"[,]");
+//			pch = strtok (nodelist,"[,]");
+			gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
+			char c='9';
 			while (pch != NULL)//we might not need to split them up but to be on the safe side...
 			{
 				
-				i++;
-				gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
-				//sendRequest( const awds::NodeId& dest, uint32_t spp_id, void * data1, spp_request_creator  h1,void * data2, spp_response_handler h2);
-				if(!buffer)
-				{
-					buffer = new char[3*sizeof(unsigned int)];
-					char* pbuffer = buffer;
-					int zero=0;
-					memcpy(buffer,&zero,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&zero,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,&zero,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-				}
 				//TODO node id erzeugen
+				printf("<<%s>>>><<<<\n",pch);
 				awds::NodeId dest;
+			
 				REP_MAP_OBJ(awds::Routing *,awdsRouting);
 				if(awdsRouting)
 				{
 					awdsRouting->getNodeByName(dest,pch);
-					sppManager->sendRequest(dest,9876,buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler);
+					//self->requests[*t_start]=i++;
+					sppManager->sendRequest(dest,9876,(void*) &rcmo, RemoteConfig::requestCreator, &c, RemoteConfig::responseHandler);
 				}
-				pch = strtok (NULL, ",[]");
-			}//TODO nochmal überarbeiten Knotenliste wurde falsch geparsed!!
-
+				pch = strtok (NULL, "[,]");
+			}
+			//if(rcmo.message)delete rcmo.message;
 		}
+		//if(nodelist)delete nodelist;
     	}
 	else
 	{
@@ -246,48 +247,71 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 
 void RemoteConfig::finishedHandler (void *data)
 {
-//TODO zusammen mit dem einzelnen Knoten zum senden neu implementieren
-
+	REP_MAP_OBJ(RemoteConfig *,remoteConfig);
+	if(remoteConfig)
+	{
+		if(remoteConfig->shellClient->state==ShellClient::CS_Blocked)
+			remoteConfig->shellClient->unblock();
+	}
 }
 
 int RemoteConfig::responseHandler (void *data, ReadMarshalStream*  msIn, const awds::NodeId& src) 
 {
 	REP_MAP_OBJ(RemoteConfig *,remoteConfig);//get but we'll check it on USE!
-
+	if(!remoteConfig)
+	{
+		GEA.dbg() << "RemoteConfig::responseHandler RemoteConfig not found!"<< std::endl;
+		return -1;
+	}
 	if(msIn==NULL)//ouch we need this!
 	{
+		//TODO timeout?
 		//if(remoteConfig)*remoteConfig->shellClient->sockout << "Response from " << src <<" with NULL" << std::endl;
 		//GEA.dbg() << "Response from " << src <<" with NULL" << std::endl;
+		if(remoteConfig->shellClient->state==ShellClient::CS_Blocked)
+			remoteConfig->shellClient->unblock();
 		return -1;
 	}
+
 	uint32_t status;
-	*msIn >> status;
 	uint32_t length;
+	*msIn >> status;
 	*msIn >> length;
-	
 	if(status)//status>0? this is a problem!!
 	{
-		if(remoteConfig)*remoteConfig->shellClient->sockout << "Response from " << src <<" with length "<< length << ". Obviously there was an error!" << std::endl;
-		GEA.dbg() << "Response from " << src <<" with length "<< length << ". Obviously there was an error!" << std::endl;
-
+		*remoteConfig->shellOut << "Response from " << src <<"length: "<< length << ". Obviously there was an error!" << std::endl;
+		GEA.dbg() << "Response from " << src <<"length: "<< length << ". Obviously there was an error!" << std::endl;
 		return CONFIG_VARIABLE_FAILURE;
 	}
 	char* retval;
+
 	if(length>0)//ah we've got a message nice, print it!
 	{
 		retval = new char[length+1];
 		memset(retval,0,length+1);
 		std::pair<void *, unsigned> v(retval,length);
 		*msIn >> v;
-		if(remoteConfig)*remoteConfig->shellClient->sockout << "Response from " << src <<" with length "<< length <<" content in <> is: <" << retval <<">" << std::endl;
-		GEA.dbg() << "Response from " << src <<" with length "<< length <<" content in <> is: <" << retval <<">" << std::endl;
+		*remoteConfig->shellOut << "Response from " << src <<": " << retval << std::endl;
+		GEA.dbg() << "Response from " << src <<": " << retval << std::endl;
 		if(retval) delete retval;
 	}
+
 	else //no Message? well at least no error!
 	{
-		if(remoteConfig)*remoteConfig->shellClient->sockout << "Response from " << src <<" with length "<< length << ". Strange but there was no error!" << std::endl;
-		GEA.dbg() << "Response from " << src <<" with length "<< length << ". Strange but there was no error!" << std::endl;
+		*remoteConfig->shellOut << "Response from " << src <<"length: "<< length << ". Strange but there was no error!" << std::endl;
+		GEA.dbg() << "Response from " << src <<"length: "<< length << ". Strange but there was no error!" << std::endl;
 	}
+
+/*
+	std::map<gea::AbsTime,unsigned int>::iterator it=remoteConfig->requests.find(*((gea::AbsTime *)data));
+	if(it!=remoteConfig->requests.end())
+	{
+		printf("it->second:%i\n",(it->second));
+		it->second=(it->second)--;
+	}
+	if(it->second<=0&&(remoteConfig->shellClient->state==ShellClient::CS_Blocked))
+		remoteConfig->shellClient->unblock();
+*/
 	return CONFIG_VARIABLE_SUCCESS;
 }
 
@@ -296,6 +320,7 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 	REP_MAP_OBJ(RemoteConfig *,remoteConfig);
 	if(msIn==NULL||msOut==NULL)//we definitely need those!
 	{
+		//TODO timeout?
 		//if(remoteConfig)*remoteConfig->shellClient->sockout << "Request from " << src <<" with NULL " << std::endl;
 		//GEA.dbg() << "Request from " << src <<" with NULL " << std::endl;
 		return -1;
@@ -308,8 +333,14 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 		*msOut << lout;
 		return -1;
 	}
+
+
 	uint32_t length;
 	*msIn >> length;
+	uint32_t l1=0;
+	uint32_t l2=0;
+	*msIn >> l1;
+	*msIn >> l2;
 	if(length<1)//no params? well then show me what you've got
 	{
 		int len=0;
@@ -346,7 +377,6 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 	for(int i=0;i<3;i++)modulename[i]=NULL;
 	//TODO mehrere streams auslesen? allerdings muessten dann mehrere ints übertragen werden wegen der länge?
 	pch = strtok (&(names[0])," ");
-
 	while (pch != NULL&&i<3)//we might not need to split them up but to be on the safe side...
 	{
 		modulename[i] = new char[strlen(pch)+1];
@@ -363,7 +393,7 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 		char* fullname = new char[len1+len2+2];
 		memset(fullname,0,len1+len2+2);
 		memcpy(fullname,modulename[0],len1);
-		fullname[len1]=' ';
+		fullname[len1]='.';
 		memcpy(fullname+len1+1,modulename[1],len2);//build the mapsearchstring
 		if (remoteConfig)
 		{
@@ -375,34 +405,43 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 				if(!strcmp(it2->first,fullname))//at least this works but....
 				{
 					found=true;
-					if(modulename[2]!=NULL)//TODO put it together as we now try to get the new value to here to double check the new value
+					if(modulename[2]!=NULL)//TODO put it together as we now try to get the new value too, to double check the new value
 					{
-						(it2->second)->fromString(modulename[2]);//ok set the values
-						char* buffer = new char[1024];
-						memset(buffer,0,1024);
-						(it2->second)->toString(buffer); //ok get it to check!
-						int length=strlen(buffer);
+						//(it2->second)->fromString(modulename[2]);//ok set the values
+						(it2->second)->fromStdString(std::string(modulename[2]));//ok set the values
+						//char* buffer = new char[1024];
+						//memset(buffer,0,1024);
+						//(it2->second)->toString(buffer); //ok get it to check!
+						//int length=strlen(buffer);
+						std::string s= (it2->second)->toStdString();
+						int length=s.size();
+
 						uint32_t lout = length;
 						uint32_t status = 0;
 						*msOut << status;
 						*msOut << lout;
-						std::pair<void *, unsigned> vOut(buffer,length);
+						//std::pair<void *, unsigned> vOut(buffer,length);
+						std::pair<void *, unsigned> vOut(&(s[0]),length);
 						*msOut << vOut;
-						delete buffer;
+						//delete buffer;
 					}
 					else //just read the value
 					{
-						char* buffer = new char[1024];
-						memset(buffer,0,1024);
-						(it2->second)->toString(buffer); //ConfigVariable
-						int length=strlen(buffer);
+						//char* buffer = new char[1024];
+						//memset(buffer,0,1024);
+						//(it2->second)->toString(buffer); //ConfigVariable
+						//printf("<<%s>>\n",(it2->second)->toStdString().c_str());
+						std::string s= (it2->second)->toStdString();
+						//int length=strlen(buffer);
+						int length=s.size();
 						uint32_t lout = length;
 						uint32_t status = 0;
 						*msOut << status;
 						*msOut << lout;
-						std::pair<void *, unsigned> vOut(buffer,length);
+						//std::pair<void *, unsigned> vOut(buffer,length);
+						std::pair<void *, unsigned> vOut(&(s[0]),length);
 						*msOut << vOut;
-						delete buffer;
+						//delete buffer;
 					}
 				}
 			}
diff --git a/src/remoteConfig.h b/src/remoteConfig.h
index c00de6bd69e4c040dcd7d4f507c8db7a3edb73bf..1f45556ce7b8d64757766be2d9e7fc0bad2beb95 100644
--- a/src/remoteConfig.h
+++ b/src/remoteConfig.h
@@ -11,21 +11,23 @@ class RemoteConfig
 {
 
 private:
-
-
+	ostream *shellOut;
+	ShellClient* shellClient;
 
 protected:
 
 	std::map<char*, ConfigVariable* > remoteVariables;
-	std::map<unsigned int,unsigned int> requests;
-	ShellClient* shellClient;
+	std::map<gea::AbsTime,unsigned int> requests;
+	std::map<gea::AbsTime,std::string> response;
+
+	
 public:
 
 
 
 	RemoteConfig();
 	//int remoteConfigAnnounce(char* name,ConfigVariableType cvt,void* thisref,variableGetHandler vgh,variableSetHandler vsh,void* value=NULL);
-	int remoteConfigAnnounce(char* name,ConfigVariable* cv);
+	int remoteConfigAnnounce(ConfigVariable* cv);
 	int remoteConfigAddCommand();
 	static int remoteconfig_command_fn(ShellClient &sc, void *data, int argc, char **argv);
 	static int requestHandler (void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src);
diff --git a/src/testmodul.cc b/src/testmodul.cc
index d880c3ad89c6e67049d1dd7a9a8095bd8ab903d7..c23fc57fb5222b47ddd9f7760adc0a167e0ff798 100644
--- a/src/testmodul.cc
+++ b/src/testmodul.cc
@@ -23,11 +23,12 @@ RemoteConfigTestModule::RemoteConfigTestModule()
 	this->testbool=false;
 
 	//ConfigVariableInt(const char* name, const int value, variableGetHandler vgh,variableSetHandler vsh,void* classref):
-	remoteConfig->remoteConfigAnnounce((char*)"testmodul testint",new ConfigVariableInt("testmodul testint",10,getint,setint,this));
-	remoteConfig->remoteConfigAnnounce((char*)"testmodul testdouble",new ConfigVariableDouble("testmodul testdouble",10,getdouble,setdouble,this));
-	remoteConfig->remoteConfigAnnounce((char*)"testmodul testfloat",new ConfigVariableFloat("testmodul testfloat",10,getfloat,setfloat,this));
-	remoteConfig->remoteConfigAnnounce((char*)"testmodul testbool",new ConfigVariableBool("testmodul testbool",true,getbool,setbool,this));
-	remoteConfig->remoteConfigAnnounce((char*)"testmodul testchar",new ConfigVariableString("testmodul testchar","test",getchar,setchar,this));
+
+	remoteConfig->remoteConfigAnnounce(new ConfigVariableInt("testmodul.testint",getint,setint,this));
+	remoteConfig->remoteConfigAnnounce(new ConfigVariableDouble("testmodul.testdouble",getdouble,setdouble,this));
+	remoteConfig->remoteConfigAnnounce(new ConfigVariableFloat("testmodul.testfloat",getfloat,setfloat,this));
+	remoteConfig->remoteConfigAnnounce(new ConfigVariableBool("testmodul.testbool",getbool,setbool,this));
+	remoteConfig->remoteConfigAnnounce(new ConfigVariableString("testmodul.testchar",getchar,setchar,this));
 
 }
 
diff --git a/src/testmodul.h b/src/testmodul.h
index 9d89dbe530697ca362aa7ee9200efafaabf72e73..657f2730fa1a1f05a981aa5c38fd6a28e3ac73c1 100644
--- a/src/testmodul.h
+++ b/src/testmodul.h
@@ -29,10 +29,7 @@ public:
 
 	static int setint( void* thisref,const void* value)
 	{
-		printf("so hierrrrr?\n");fflush(stdout);
-		printf("1<%i> <%i>\n",((RemoteConfigTestModule*)thisref)->testint,*((int*)value));
 		((RemoteConfigTestModule*)thisref)->testint=*((int*)value);
-		printf("2<%i> <%i>\n",((RemoteConfigTestModule*)thisref)->testint,*((int*)value));
 		return CONFIG_VARIABLE_SUCCESS;
 	}
 	static int getint (void* thisref,void* value)
-- 
1.6.2.1


