Эх сурвалжийг харах

2020-01-10 / Kathy Yeh [Module_OcppBackend]1. slove cpu issue: add usleep in transaction queue loop & remove printf information

Kathy_Yeh 5 жил өмнө
parent
commit
57d2eb5b1b

+ 33 - 43
EVSE/Modularization/ocppfiles/JsonParser.c

@@ -4,17 +4,10 @@
 #include	<string.h>
 #include	<assert.h>
 #include	"hashmap.h"
-//#include	"HashTable.h"
-//#include	"json-c/arraylist.h"
-//#include	"json-c/json_tokener.h"
-
-//#include "json.h"
-//#include	"./lib/Headers/json-c/JsonParser.h"
-//#include "parse_flags.h"
-//#include	"./lib/Headers/json-c/linkhash.h"
 #include	"MessageHandler.h"
 
 
+
 #define MESSAGE_TYPE_CALL			2
 #define MESSAGE_TYPE_CALLRESULT		3
 #define MESSAGE_TYPE_CALLERROR		4
@@ -58,13 +51,13 @@ static FunPtr funs[] = { handleAuthorizeResponse, handleBootNotificationResponse
 					handleHeartbeatResponse, handleMeterValuesResponse, \
 					handleStartTransactionResponse, \
 					handleStatusNotificationResponse, \
-					handleStopTransactionnResponse }; // 將函式集中在陣列中。
+					handleStopTransactionnResponse }; //
 
 static FunCallPtr funcalls[] = { handleCancelReservationRequest, handleChangeAvailabilityRequest, handleChangeConfigurationRequest,handleClearCacheRequest, \
 					handleClearChargingProfileRequest, handleDataTransferRequest, handleGetCompositeScheduleRequest, handleGetConfigurationRequest, \
 					handleGetDiagnosticsRequest, handleGetLocalListVersionRequest, handleRemoteStartRequest, handleRemoteStopTransactionRequest, \
 					handleReserveNowTransactionRequest, handleResetRequest, handleSendLocalListRequest, handleSetChargingProfileRequest, \
-					handleTriggerMessageRequest, handleUnlockConnectorRequest, handleUpdateFirmwareRequest }; // 將函式集中在陣列中。
+					handleTriggerMessageRequest, handleUnlockConnectorRequest, handleUpdateFirmwareRequest }; //
 
 
 static FunCallErrorPtr funcallerror[] = {	handleError	};
@@ -106,14 +99,14 @@ void ReceivedMessage(void *in, size_t len)
 	//char *str = "[ ]";
 	if(strcmp((const char *)tempin,"[ ]") == 0)
 	{
-		printf("jobj is empty arrary. \n");
+		printf("Message is empty arrary. \n");
 	    return;
 	}
 
 	if(tempin[0] != '\0')//if(jobj != NULL)
 	{
 		MsgType = tempin[1] - '0';
-		printf("MsgType=%d\n",MsgType);
+		//printf("MsgType=%d\n",MsgType);
 		c = 0;
 
 		if((MsgType != 2) && (MsgType != 3) && (MsgType != 4) )
@@ -128,7 +121,7 @@ void ReceivedMessage(void *in, size_t len)
 			c++;
 		}
 		UniqueId[c] = '\0';
-		printf("UniqueId=%s\n",UniqueId);
+		//printf("UniqueId=%s\n",UniqueId);
 
 		if(UniqueId[0] == '\0')
 		{
@@ -143,7 +136,7 @@ void ReceivedMessage(void *in, size_t len)
 		switch (MsgType)
 		{
 			case MESSAGE_TYPE_CALL:
-				printf("MESSAGE_TYPE_CALL\n");
+				//DEBUG_INFO("MESSAGE_TYPE_CALL\n");
 
 				c = 0;
 				while (tempin[4+4+strlen(UniqueId)-1+c] != '\"')
@@ -154,7 +147,7 @@ void ReceivedMessage(void *in, size_t len)
 				}
 				Action[c] = '\0';
 
-				printf("Action=%s\n",Action);
+				//printf("Action=%s\n",Action);
 
 				c = 0;
 				int templen= 4+4+3+strlen(UniqueId)-1+strlen(Action)-1;
@@ -166,14 +159,14 @@ void ReceivedMessage(void *in, size_t len)
 				}
 				Payload[c] = '\0';
 
-				printf("Payload=%s\n",Payload);
+				//printf("Payload=%s\n",Payload);
 
 			   	CallHandler(UniqueId,Action,Payload);
 			   	break;
 
 			case MESSAGE_TYPE_CALLRESULT:
 
-			   	printf("MESSAGE_TYPE_CALLRESULT\n");
+				//DEBUG_INFO("MESSAGE_TYPE_CALLRESULT\n");
 
 			   	c = 0;
 			   	templen= 4+3+strlen(UniqueId)-1;
@@ -185,14 +178,14 @@ void ReceivedMessage(void *in, size_t len)
 			   	}
 			   	Payload[c] = '\0';
 
-			   	printf("Payload=%s\n",Payload);
+			   	//printf("Payload=%s\n",Payload);
 
 			   	if(hashmap_operation(1, UniqueId, key_value) == TRUE)//if(hashmap_operation(1,NULL/*hashMap*/, UniqueId, mapItem, key_value/*(void**)(&mapItem)*/) ==  MAP_OK/*hashmap_get(hashMap, UniqueId, (void**)(&mapItem)) == MAP_OK*/)
 			   	{
 			   		hashmap_operation(2, UniqueId, key_value);//hashmap_operation(2,NULL/*hashMap*/, UniqueId, mapItem, key_value/*(void**)(&mapItem)*/);//hashmap_remove(hashMap, UniqueId);
 			   		char * const testdup  = strdup(key_value/*mapItem->key_value*/);
 
-			   		printf("original string: %s (@%p)\n", testdup, testdup);
+			   		//printf("original string: %s (@%p)\n", testdup, testdup);
 
 			   		substr = strtok(testdup, del);
 			   		while (substr != NULL) {
@@ -205,20 +198,20 @@ void ReceivedMessage(void *in, size_t len)
 
 		            i=0;
 			   		sprintf(Action, "%s", *(arr+i++));
-			   		printf("Action=%s\n",Action);
+			   	//	printf("Action=%s\n",Action);
 
 			   		gun_index = atoi(*(arr+i++));
-			   		printf("gun_index=%d\n",gun_index);
+			   	//	printf("gun_index=%d\n",gun_index);
 
-			   		#ifdef Debug
-			   		DEBUG_INFO("<<<<<%s response\n", Action);
-			   		DEBUG_INFO("Payload: %s\n", Payload);
-			   		#endif
+			   	//	#ifdef Debug
+			   	//	DEBUG_INFO("<<<<<%s response\n", Action);
+			   	//	DEBUG_INFO("Payload: %s\n", Payload);
+			   	//	#endif
 			   		CallResultHandler(Action, Payload, gun_index);
 
-			   		#ifdef Debug
-			   		DEBUG_INFO("After pull hash length: %d\n", hashmap_length(hashMap));
-			   		#endif
+			   	//	#ifdef Debug
+			   	//	DEBUG_INFO("After pull hash length: %d\n", hashmap_length(hashMap));
+			   	//	#endif
 
 			   		free(testdup);
 			   	}
@@ -226,7 +219,7 @@ void ReceivedMessage(void *in, size_t len)
 			   	break;
 
 			   case MESSAGE_TYPE_CALLERROR:
-				   printf("MESSAGE_TYPE_CALLERROR\n");
+				   //DEBUG_INFO("MESSAGE_TYPE_CALLERROR\n");
 
 				   c = 0;
 				   while (tempin[4+4+strlen(UniqueId)-1+c] != '\"')
@@ -237,7 +230,7 @@ void ReceivedMessage(void *in, size_t len)
 				   }
 				   ErrorCode[c] = '\0';
 
-				   printf("ErrorCode=%s\n",ErrorCode);
+				  // DEBUG_INFO("ErrorCode=%s\n",ErrorCode);
 
 				   c = 0;
 				   while (tempin[4+4+4+strlen(UniqueId)-1+strlen(ErrorCode)-1+c] != '\"')
@@ -248,7 +241,7 @@ void ReceivedMessage(void *in, size_t len)
 				   }
 				   ErrorDescription[c] = '\0';
 
-				   printf("ErrorDescription=%s\n",ErrorDescription);
+				  // DEBUG_INFO("ErrorDescription=%s\n",ErrorDescription);
 
 
 				   c = 0;
@@ -261,7 +254,7 @@ void ReceivedMessage(void *in, size_t len)
 				   }
 				   Payload[c] = '\0';
 
-				   printf("Payload=%s\n",Payload);
+				  // DEBUG_INFO("Payload=%s\n",Payload);
 
 
 
@@ -298,7 +291,7 @@ void ReceivedMessage(void *in, size_t len)
 	}
 	else
 	{
-		printf("jobj is null. cant parse messgae. \n");
+		printf("Message is null. cant parse messgae. \n");
 	}
 
 }
@@ -308,7 +301,7 @@ int CallHandler(char *uuid, char *str1,char *payload)
 	static int CallHandlerNumber = 0;
     static int CallHandlerIndex = 0;
     int (*callfptr)(char *uuid,char *payload);
-    printf("enter CallHandler\n");
+    //DEBUG_INFO("enter CallHandler\n");
 	CallHandlerNumber = sizeof(requestNames)/sizeof(requestNames[0]);
 	for(int i= 0; i < CallHandlerNumber ; i ++ )
 	{
@@ -325,12 +318,12 @@ int CallHandler(char *uuid, char *str1,char *payload)
 
 	if(callfptr == NULL)
 	{
-		printf("callfptr is null\n");
+		//printf("callfptr is null\n");
 	}
 
 	if ( callfptr )
 	{
-		printf("exec CallHandler ... \n");
+		//printf("exec CallHandler ... \n");
 		callfptr(uuid, payload);
 		callfptr = NULL;
 		return PASS;
@@ -346,7 +339,7 @@ void CallResultHandler(char *str1, char *payload, int gun_index)
 	static int CallResultHandlerNumber = 0;
 	static int CallResultHandlerIndex = 0;
 	void (*callResultfptr)(char *payload, int gun_index );
-	printf("enter CallResultHandler\n");
+	//printf("enter CallResultHandler\n");
 	CallResultHandlerNumber = sizeof(responseNames)/sizeof(responseNames[0]);
 	for(int i= 0; i < CallResultHandlerNumber ; i ++ )
 	{
@@ -357,20 +350,17 @@ void CallResultHandler(char *str1, char *payload, int gun_index)
 		}
 
 	}
-	printf("CallResultHandlerIndex=%d\n",CallResultHandlerIndex);
 
 	callResultfptr = NULL;
 	callResultfptr = funs[CallResultHandlerIndex];
 
-
 	if(callResultfptr == NULL)
 	{
-		printf("callResultfptr is null\n");
+		//printf("callResultfptr is null\n");
 	}
 
 	if ( callResultfptr )
 	{
-		printf("exec CallResultHandler\n");
 		callResultfptr(payload, gun_index);
 	}
 
@@ -384,7 +374,7 @@ void CallErrorHandler(char *id, char *errorCode, char *errorDescription,char *pa
 	callErrorfptr = NULL;
 	callErrorfptr = funcallerror[0];
 
-	printf("CallErrorHandler \n");
+	//printf("CallErrorHandler \n");
 
 	if(callErrorfptr == NULL)
 	{
@@ -393,7 +383,7 @@ void CallErrorHandler(char *id, char *errorCode, char *errorDescription,char *pa
 
 	if ( callErrorfptr )
 	{
-		printf("callErrorfptr is not null\n");
+		//printf("callErrorfptr is not null\n");
 
 		callErrorfptr(id, errorCode, errorDescription, payload);
 	}

+ 12 - 13
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -46,7 +46,6 @@
 
 
 
-
 #define PASS				1
 #define FAIL				-1
 
@@ -2110,7 +2109,7 @@ int sendHeartbeatRequest(int gun_index)
 	if(hashmap_operation(0, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, guid, mapItem, tempdata/*(void**)(&mapItem)*/) ==  MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
 	{
 		result = PASS;
-		DEBUG_ERROR("Heartbeat mapItem pass\n");
+		//DEBUG_ERROR("Heartbeat mapItem pass\n");
 	}
 
 	//#ifdef SystemLogMessage
@@ -4414,7 +4413,7 @@ int handleClearCacheRequest(char *uuid, char *payload)
     // Check for directory existence
     if (S_ISDIR(stats.st_mode) == 1)
     {
-    	DEBUG_ERROR("\n OCPP directory exist \n");
+    	//DEBUG_ERROR("\n OCPP directory exist \n");
     }
     else
     {
@@ -4999,7 +4998,7 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
 
   			int c;
   			c = fgetc(fptr1);
-  			DEBUG_INFO("c:%d\n",c);
+  			//DEBUG_INFO("c:%d\n",c);
   			rewind(fptr1);
 
   			if(c == EOF)
@@ -5212,7 +5211,7 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
 
   	  		c = 0;
   	  	  	c = fgetc(fptr1);
-  	  	  	DEBUG_INFO("c:%d\n",c);
+  	  	  	//DEBUG_INFO("c:%d\n",c);
   	  	  	rewind(fptr1);
 
   	  	  	if(c == EOF)
@@ -5479,7 +5478,7 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
 
   				int c;
   				c = fgetc(fptr1);
-  				DEBUG_INFO("c:%d\n",c);
+  				//DEBUG_INFO("c:%d\n",c);
   				rewind(fptr1);
 
   				if(c == EOF)
@@ -5727,7 +5726,7 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
 
   	  			c = 0;
   	  			c = fgetc(fptr1);
-  	  			DEBUG_INFO("c:%d\n",c);
+  	  			//DEBUG_INFO("c:%d\n",c);
   	  			rewind(fptr1);
 
   	  			if(c == EOF)
@@ -6019,7 +6018,7 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
   				fptr1 = fopen(fname, "r");
   				c = 0;
   				c = fgetc(fptr1);
-  				DEBUG_INFO("c:%d\n",c);
+  				//DEBUG_INFO("c:%d\n",c);
   				rewind(fptr1);
 
   				if(c == EOF)
@@ -9866,7 +9865,7 @@ void handleAuthorizeResponse(char *payload, int gun_index)
 		//DEBUG_INFO("feof(infile) =%d\n",feof(infile));
 		int c;
 		c = fgetc(infile);
-		DEBUG_INFO("c:%d\n",c);
+		//DEBUG_INFO("c:%d\n",c);
 		rewind(infile);
 
 		if(c == EOF)
@@ -9920,10 +9919,10 @@ void handleAuthorizeResponse(char *payload, int gun_index)
 			char buf[160]={0};
 
 
-			DEBUG_INFO("Orignal File is not NULL\n");
+			//DEBUG_INFO("Orignal File is not NULL\n");
 			while (fgets(buf, sizeof(buf), infile) != NULL)
 			{
-				DEBUG_INFO("Orignal File is not NULL-1\n");
+				//DEBUG_INFO("Orignal File is not NULL-1\n");
 			    buf[strlen(buf) - 1] = '\0'; // eat the newline fgets() stores
 
 
@@ -10499,7 +10498,7 @@ int initialConfigurationTable(void)
 	//AuthorizationCacheEnabled
 	ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemAccessibility = 1;
 	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemName, "AuthorizationCacheEnabled");
-	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemData, "TRUE" /*"FALSE"*/ );
+	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemData, "FALSE" );
 
 
 	//AuthorizeRemoteTxRequests
@@ -12874,7 +12873,7 @@ void LWS_Send(char * str)
 	lws_callback_on_writable(wsi_client);
 	lws_service(context, 10000);//timeout_ms
 	//usleep(10000); // 等�??��?微�?
-	DEBUG_INFO("Send message end\n");
+	//DEBUG_INFO("Send message end\n");
 }
 
 

+ 10 - 23
EVSE/Modularization/ocppfiles/Module_OcppBackend.c

@@ -732,7 +732,7 @@ DEBUG_INFO("addq\n");
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	DEBUG_INFO("\n OCPP directory exist \n");
+	//DEBUG_INFO("\n OCPP directory exist \n");
 }
 else
 {
@@ -745,7 +745,7 @@ memset(&rmFileCmd, 0, sizeof rmFileCmd);
 
 if((access("../Storage/OCPP/TransactionRelatedQueue",F_OK))!=-1)
 {
-	DEBUG_INFO("TransactionRelatedQueue exist.\n");
+	//DEBUG_INFO("TransactionRelatedQueue exist.\n");
 }
 else
 {
@@ -823,7 +823,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	DEBUG_INFO("\n OCPP directory exist \n");
+	//DEBUG_INFO("\n OCPP directory exist \n");
 }
 else
 {
@@ -836,7 +836,7 @@ memset(&rmFileCmd, 0, sizeof rmFileCmd);
 
 if((access("../Storage/OCPP/TransactionRelatedQueue",F_OK))!=-1)
 {
-	DEBUG_INFO("TransactionRelatedQueue exist.\n");
+	//DEBUG_INFO("TransactionRelatedQueue exist.\n");
 }
 else
 {
@@ -957,7 +957,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	DEBUG_INFO("\n OCPP directory exist \n");
+	//DEBUG_INFO("\n OCPP directory exist \n");
 }
 else
 {
@@ -970,7 +970,7 @@ memset(&rmFileCmd, 0, sizeof rmFileCmd);
 
 if((access("../Storage/OCPP/TransactionRelatedQueue",F_OK))!=-1)
 {
-	DEBUG_INFO("TransactionRelatedQueue exist.\n");
+	//DEBUG_INFO("TransactionRelatedQueue exist.\n");
 }
 else
 {
@@ -1029,7 +1029,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	DEBUG_INFO("\n OCPP directory exist \n");
+	//DEBUG_INFO("\n OCPP directory exist \n");
 }
 else
 {
@@ -1200,21 +1200,8 @@ void* processTransactionQueue(void* data) {
 				TransactionQueueInterval = 0;//10;
 				sleep(TransactionQueueInterval);
 			}
-
-#if 0
-			if(TransactionQueueNum != 0)
-			{
-				TransactionQueueInterval = 1;
-			}
-			else
-#endif
-			{
-			//	TransactionQueueInterval = 10;
-			}
-			//TransactionQueueInterval =  TransactionMessageAttemptsGet();
-			//sleep(TransactionQueueInterval);  // sleep for 30 seconds
 		}
-
+		usleep(5000);
 	}
   pthread_exit(NULL); //
   return 0;
@@ -1294,7 +1281,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	DEBUG_INFO("\n OCPP directory exist \n");
+	//DEBUG_INFO("\n OCPP directory exist \n");
 }
 else
 {
@@ -1340,7 +1327,7 @@ int main(void)
 	// Check for directory existence
 	if (S_ISDIR(stats.st_mode) == 1)
 	{
-		DEBUG_INFO("\n OCPP directory exist \n");
+		//DEBUG_INFO("\n OCPP directory exist \n");
 	}
 	else
 	{

+ 23 - 21
EVSE/Modularization/ocppfiles/hashmap.c

@@ -1,7 +1,7 @@
 /*
  * hashmap.c
  *
- *  Created on: 2019�~4��27��
+ *  Created on: 2019 ~4  27  
  *      Author: foluswen
  */
 #include <sys/types.h>
@@ -13,6 +13,7 @@
 #include <pthread.h>
 #include <unistd.h>     /*Unix 標準函數定義*/
 
+
 typedef enum boolean { FALSE, TRUE } BOOL;
 static pthread_mutex_t m;
 
@@ -617,7 +618,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	printf("\n directory exist \n");
+	//printf("\n directory exist \n");
 }
 else
 {
@@ -630,7 +631,7 @@ memset(&rmFileCmd, 0, sizeof rmFileCmd);
 
 if((access("../Storage/OCPP/MessageSent",F_OK))!=-1)
 {
-	printf("MessageSent exist.\n");
+	//printf("MessageSent exist.\n");
 }
 else
 {
@@ -663,7 +664,8 @@ int MessageSent_get(char *uuid, char *data)
 	int result = FALSE; // 1: TRUE  0:FALSE
 	char str[1200]={0};
 	char sstr[50]={ 0 }, datastr[30]={0};//sstr[200]={ 0 };
-	int pos = 0, l = 0, c = 0;
+	//int pos = 0, l = 0, c = 0;
+	int c = 0;
 	char *loc;
 	char rmFileCmd[100]={0};
 	struct stat stats;
@@ -672,7 +674,7 @@ int MessageSent_get(char *uuid, char *data)
 	// Check for directory existence
 	if (S_ISDIR(stats.st_mode) == 1)
 	{
-		printf("\n directory exist \n");
+		//printf("\n directory exist \n");
 	}
 	else
 	{
@@ -685,7 +687,7 @@ int MessageSent_get(char *uuid, char *data)
 
 	if((access("../Storage/OCPP/MessageSent",F_OK))!=-1)
 	{
-		printf("MessageSent exist.\n");
+		//printf("MessageSent exist.\n");
 	}
 	else
 	{
@@ -712,7 +714,7 @@ int MessageSent_get(char *uuid, char *data)
 	}
 
 	c = fgetc(fp);
-	printf("c:%d\n",c);
+	//printf("c:%d\n",c);
 	rewind(fp);
 
 	if(c == EOF)
@@ -727,12 +729,12 @@ int MessageSent_get(char *uuid, char *data)
 		result = FALSE;
 		while (fgets (str, 1200, fp)!=NULL)
 		{
-			printf("Orignal File get strings \n");
+			//printf("Orignal File get strings \n");
 			str[strlen(str) - 1] = '\0'; // eat the newline fgets() stores
 
 			/* writing content to stdout */
 			//puts(str);
-			printf("str[0]=%c\n",str[0]);
+			//printf("str[0]=%c\n",str[0]);
 
 			/*********************uuid***************/
 			int d = 0;
@@ -743,8 +745,8 @@ int MessageSent_get(char *uuid, char *data)
 			}
 			sstr[d] = '\0';
 
-			printf("sstr=%s\n",sstr);
-			printf("uuid=%s\n",uuid);
+			//printf("sstr=%s\n",sstr);
+			//printf("uuid=%s\n",uuid);
 
 			if(strcmp(sstr, uuid) == 0)
 			{
@@ -792,7 +794,7 @@ stat("../Storage/OCPP", &stats);
 // Check for directory existence
 if (S_ISDIR(stats.st_mode) == 1)
 {
-	printf("\n directory exist \n");
+	//printf("\n directory exist \n");
 }
 else
 {
@@ -805,7 +807,7 @@ memset(&rmFileCmd, 0, sizeof rmFileCmd);
 
 if((access("../Storage/OCPP/MessageSent",F_OK))!=-1)
 {
-	printf("MessageSent exist.\n");
+	//printf("MessageSent exist.\n");
 }
 else
 {
@@ -835,7 +837,7 @@ outfile = fopen (tempfile, "w");
 //DEBUG_INFO("feof(infile) =%d\n",feof(infile));
 int c;
 c = fgetc(infile);
-printf("file c:%d\n",c);
+//printf("file c:%d\n",c);
 rewind(infile);
 
 if(c == EOF)
@@ -853,18 +855,18 @@ else
 	char buf[1200]={0};
 
 	//int i = 0;
-	printf("Orignal File is not NULL\n");
+	//printf("Orignal File is not NULL\n");
 	while (fgets(buf, sizeof(buf), infile) != NULL)
 	{
-		printf("Orignal File get strings \n");
+		//printf("Orignal File get strings \n");
 		buf[strlen(buf) - 1] = '\0'; // eat the newline fgets() stores
 
-		printf("buf=%s\n",buf);
-		printf("tempstring=%s\n",tempstring);
+		//printf("buf=%s\n",buf);
+		//printf("tempstring=%s\n",tempstring);
 		//if(i != 0)
 		if(strcmp(tempstring, buf)== 0)
 		{
-			printf("Remove OK ! \n");
+			//printf("Remove OK ! \n");
 		}
 		else
 		{
@@ -884,7 +886,7 @@ else
 
 	if(resultRename == 0)
 	{
-		printf("File renamed successfully");
+		//printf("File renamed successfully");
 	}
 	else
 	{
@@ -933,7 +935,7 @@ int hashmap_operation(int type, char *uuid, char *data)
 	else if(type == 2)
 		result = MessageSent_remove(uuid, data);
 	pthread_mutex_unlock(&m);
-	printf("\nhashmap_operation 1 \n");
+	//printf("\nhashmap_operation 1 \n");
 	return result;
 }