Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 74131 Details for
Bug 181534
agent controller not cleaning up /tmp/IBMRAC files on shutdown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
patch_181534.txt (text/plain), 9.60 KB, created by
Igor Alelekov
on 2007-07-19 06:50:49 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Igor Alelekov
Created:
2007-07-19 06:50:49 EDT
Size:
9.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c,v >retrieving revision 1.22 >diff -u -r1.22 AgentCTL.c >--- src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c 31 May 2007 00:50:52 -0000 1.22 >+++ src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c 19 Jul 2007 10:50:44 -0000 >@@ -26,6 +26,8 @@ > #include <stdio.h> > #ifdef _WIN32 > #include <io.h> >+#else >+#include "tptp/TPTPCommon.h" > #endif > > /** >@@ -111,7 +113,7 @@ > if ( connectionEntry == NULL ) > { > /* Unrecognized connection */ >- TPTP_LOG_ERROR_MSG1( stateData, "ACTL cannot find connection entry for ID %ld", connectionID ); >+ TPTP_LOG_ERROR_MSG1( stateData, "ACTL cannot find connection entry for ID %d", connectionID ); > return -1; > } > >@@ -122,7 +124,7 @@ > { > /* Missing agent data */ > ra_mutexExit( &actlData->processList->lock ); >- TPTP_LOG_ERROR_MSG1( stateData, "ACTL cannot find agent data for ID %ld", connectionID ); >+ TPTP_LOG_ERROR_MSG1( stateData, "ACTL cannot find agent data for ID %d", connectionID ); > return -1; > } > >@@ -306,6 +308,23 @@ > return baseTL_startTransportListener( tlo, serveRequests ); > } > >+int clearProcesses() { >+ process_list_t *plist; >+ process_list_node_t *pnode; >+ >+ plist = ra_getActiveProcessList(); >+ if (plist == NULL) return 0; >+ >+ pnode = plist->head; >+ while(pnode != NULL) { >+ ra_processDestroy(pnode->process); >+ >+ pnode = pnode->next; >+ } >+ >+ return 0; >+} >+ > /** > ********************************************************* > * >@@ -319,7 +338,18 @@ > > tptp_int32 stopTransportListener(tptp_object* tlo) > { >- return baseTL_stopTransportListener( tlo ); >+ tptp_int32 rc; >+ char pipeName[_MAX_PATH]; >+ >+ rc = baseTL_stopTransportListener(tlo); >+ >+ strcpy (pipeName, RAC_PIPE_NAMESPACE); >+ strcat (pipeName, RAC_MASTER_ADDRESS); >+ >+ destroyNamedPipe(pipeName); >+ clearProcesses(); >+ >+ return rc; > } > > >Index: src-native-new/src/transport/TPTPAgentCompTL/ACTLServer.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/ACTLServer.c,v >retrieving revision 1.16 >diff -u -r1.16 ACTLServer.c >--- src-native-new/src/transport/TPTPAgentCompTL/ACTLServer.c 14 Nov 2006 17:23:07 -0000 1.16 >+++ src-native-new/src/transport/TPTPAgentCompTL/ACTLServer.c 19 Jul 2007 10:50:43 -0000 >@@ -80,7 +80,7 @@ > > if(!process) > { >- TPTP_LOG_WARNING_MSG1( stateData, "Could not find process %d. The model may be missing information", command->info.agent_active.processId); >+ TPTP_LOG_WARNING_MSG1( stateData, "Could not find process %d. The model may be missing information", (int) command->info.agent_active.processId); > return FALSE; > } > >@@ -114,7 +114,7 @@ > while ( current != NULL ) > { > ra_command_t *command=current->command; >- TPTP_LOG_DEBUG_MSG1( stateData, "Processing command: tag=%d", command->tag); >+ TPTP_LOG_DEBUG_MSG1( stateData, "Processing command: tag=%d", (int) command->tag); > switch(command->tag) > { > case RA_CUSTOM_COMMAND: >@@ -130,7 +130,7 @@ > processExternalErrorMessage(stateData, command, agent); > break; > default: >- TPTP_LOG_WARNING_MSG1( stateData, "Received unexpected commmand from agent: tag=%d", command->tag); >+ TPTP_LOG_WARNING_MSG1( stateData, "Received unexpected commmand from agent: tag=%d", (int) command->tag); > break; > } > current=current->next; >@@ -151,7 +151,7 @@ > ra_addCommandToMessage(forwardMessage, command); > > /* 187443 end */ >- TPTP_LOG_DEBUG_MSG1( stateData, "Forwarding command to client: tag=%d", command->tag); >+ TPTP_LOG_DEBUG_MSG1( stateData, "Forwarding command to client: tag=%d", (int) command->tag); > > /* Convert this command into a format the client will recognize */ > if ( 0 != convertCommandToXML( stateData, agent->agentID, agent->client->clientID, command, &buffer ) ) >@@ -174,7 +174,7 @@ > } > else > { >- TPTP_LOG_WARNING_MSG1( stateData, "Agent with no attached client attempted to send custom command: tag=%d", command->tag); >+ TPTP_LOG_WARNING_MSG1( stateData, "Agent with no attached client attempted to send custom command: tag=%d", (int) command->tag); > } > } > >@@ -197,7 +197,7 @@ > #else > TPTP_LOG_MSG4( stateData, command->info.error_string.severity, "EXTERNAL: %s:%d MESSAGE_ID=%s MESSAGE= %s" > , command->info.error_string.agent.data >- , command->info.error_string.processId >+ , (int) command->info.error_string.processId > , command->info.error_string.messageId.data > , command->info.error_string.message.data); > #endif >@@ -278,7 +278,7 @@ > > message = ra_readMessageFromBuffer( pBuffer, (unsigned long)bytesRead ); > >- TPTP_LOG_DEBUG_MSG1( stateData, "Processing message of length %d bytes.", message->length ); >+ TPTP_LOG_DEBUG_MSG1( stateData, "Processing message of length %d bytes.", (int) message->length ); > > /* Most messages use an agent pointer, so we'll protect the list while we're processing */ > ra_mutexEnter( &actlData->processList->lock ); >@@ -345,7 +345,7 @@ > buffer = (unsigned char*)tptp_malloc( TPTP_DEFAULT_BUFFER_LENGTH+1 ); > if ( buffer == NULL ) > { >- return TPTP_SYS_NO_MEM; >+ return 0; > } > > /* initial status before the thread is running */ >@@ -425,7 +425,7 @@ > > cleanPipeUp(pPipe); > >- return ( rc ); >+ return 0; > } > > >Index: src-native-new/src/transport/TPTPAgentCompTL/RACAgentSupport.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/RACAgentSupport.c,v >retrieving revision 1.13 >diff -u -r1.13 RACAgentSupport.c >--- src-native-new/src/transport/TPTPAgentCompTL/RACAgentSupport.c 31 May 2007 00:50:52 -0000 1.13 >+++ src-native-new/src/transport/TPTPAgentCompTL/RACAgentSupport.c 19 Jul 2007 10:50:44 -0000 >@@ -14,6 +14,9 @@ > * > *******************************************************************************/ > >+#include <string.h> >+ >+#include "tptp/TPTPConfig.h" > #include "tptp/TPTPTypes.h" > #include "tptp/TPTPSupportTypes.h" > #include "tptp/TPTPSupportUtils.h" >@@ -426,20 +429,33 @@ > > static void deleteAgentList(agent_list_t *list) { > agent_list_node_t *current; >+ char pipeFullName[_MAX_PATH], *pipeName; > > if(!list) { > return; > } > current=list->head; > >+ strcpy(pipeFullName, RA_PIPE_NAMESPACE); >+ pipeName = pipeFullName + strlen(RA_PIPE_NAMESPACE); >+ > while(current != NULL) { > agent_list_node_t *temp=current; >+ >+ disconnectFromNamedPipe(current->agent->pipe); >+ >+ if (current->agent->agentUUID.data != NULL) { >+ strcpy(pipeName, current->agent->agentUUID.data); >+ destroyNamedPipe(pipeFullName); >+ } >+ > ra_destroyRASTRING(¤t->agent->agentName); > ra_destroyRASTRING(¤t->agent->agentUUID); > ra_destroyRASTRING(¤t->agent->agentType); >- >+ > tptp_free(current->agent); > current->agent=NULL; >+ > current=current->next; > tptp_free(temp); > } >Index: src-native-new/src/transport/transportSupport/TransportSupportNamedPipe_win.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupportNamedPipe_win.c,v >retrieving revision 1.20 >diff -u -r1.20 TransportSupportNamedPipe_win.c >--- src-native-new/src/transport/transportSupport/TransportSupportNamedPipe_win.c 2 Nov 2006 18:58:08 -0000 1.20 >+++ src-native-new/src/transport/transportSupport/TransportSupportNamedPipe_win.c 19 Jul 2007 10:50:44 -0000 >@@ -298,12 +298,6 @@ > return (HANDLE) -1; > } > >- if(!pPipeName || !pNameSpace) >- { >- TPTP_LOG_ERROR_MSG("Create pipe - Null name"); >- return (HANDLE) -1; >- } >- > /* Build the full pipe name */ > sprintf(pFullName, "%s%s", pNameSpace, pPipeName) ; > >Index: src-native-new/src/transport/namedPipeTL/NamedPipeListener.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/namedPipeTL/NamedPipeListener.c,v >retrieving revision 1.47 >diff -u -r1.47 NamedPipeListener.c >--- src-native-new/src/transport/namedPipeTL/NamedPipeListener.c 13 Apr 2007 16:12:00 -0000 1.47 >+++ src-native-new/src/transport/namedPipeTL/NamedPipeListener.c 19 Jul 2007 10:50:44 -0000 >@@ -391,8 +391,6 @@ > return ( 0 ) ; > } > >- >- > /** > ********************************************************* > * >@@ -1111,6 +1109,26 @@ > return ( isConnectedSuccessful == 0 ) ; > } > >+int closeConnections(server_block_t* pServerData) { >+ int i, tabSize; >+ tptp_uint32* list; >+ request_block_ptr_t pBlk; >+ >+ tabSize = tableSize(pServerData->connectionTable); >+ if (tabSize <= 0) return 0; >+ >+ list = (tptp_uint32*) malloc(tabSize*sizeof(tptp_uint32)); >+ tableKeysAsList(pServerData->connectionTable, list, tabSize); >+ >+ for (i=0; i<tabSize; i++) { >+ pBlk = (request_block_ptr_t) tableGet (pServerData->connectionTable, list[i]); >+ if (pBlk != NULL) destroyNamedPipe(pBlk->fullPipeName); >+ } >+ >+ free (list); >+ >+ return 0; >+} > > > /** >@@ -1130,6 +1148,9 @@ > > /* stop the running thread */ > pServerData->threadStatus = IDLE ; >+ >+ destroyNamedPipe(pServerData->fullPipeName); >+ closeConnections(pServerData); > > return ( 0 ) ; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 181534
: 74131