- Removed old stuff in conman

- Fixed a bug in processnode which hangs SICS when processnode is called from multiple
  clients on the same node
- Fixed a bug in multicountsersec which caused thrashing of the Tcl results which caused ugly
  error messages when calling the transfer script. Now a copy of the connection is made
  before calling the transfer script
This commit is contained in:
2014-07-15 16:43:09 +02:00
parent d6faaa593a
commit db6167bfa1
5 changed files with 45 additions and 38 deletions

View File

@ -1724,10 +1724,8 @@ int SCInvoke(SConnection * self, SicsInterp * pInter, char *pCommand)
return 0; return 0;
} }
strlcpy(pCopy->deviceID, pBueffel, SCDEVIDLEN); strlcpy(pCopy->deviceID, pBueffel, SCDEVIDLEN);
/* SCAdvanceContext(self,pBueffel); */
traceCommand(ConID(self),"in:%s", pCommand); traceCommand(ConID(self),"in:%s", pCommand);
iRet = InterpExecute(pInter, pCopy, pCommand); iRet = InterpExecute(pInter, pCopy, pCommand);
/* SCPopContext(self); */
SCDeleteConnection(pCopy); SCDeleteConnection(pCopy);
StatusFileTask(NULL); /* save changed parameters */ StatusFileTask(NULL); /* save changed parameters */

View File

@ -1,5 +1,5 @@
#line 202 "devexec.w" #line 204 "devexec.w"
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
@ -57,7 +57,7 @@
int StartCounter(pExeList self, SicsInterp *pSics, SConnection *pCon, int StartCounter(pExeList self, SicsInterp *pSics, SConnection *pCon,
int level, char *name); int level, char *name);
#line 249 "devexec.w" #line 251 "devexec.w"
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@ -77,8 +77,10 @@
int DevExecTask(void *pEL); int DevExecTask(void *pEL);
void DevExecSignal(void *pEL, int iSignal, void *pSigData); void DevExecSignal(void *pEL, int iSignal, void *pSigData);
int GetDevExecInstStatus(pExeList self);
#line 251 "devexec.w"
#line 253 "devexec.w"
/* /*
@ -98,7 +100,7 @@
*/ */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#line 142 "devexec.w" #line 144 "devexec.w"
int StopExe(pExeList self, char *name); int StopExe(pExeList self, char *name);
int StopExeWait(pExeList self); int StopExeWait(pExeList self);
@ -122,7 +124,7 @@
int ContinueExecution(pExeList self); int ContinueExecution(pExeList self);
#line 269 "devexec.w" #line 271 "devexec.w"
/*-------------------------- Commands ------------------------------------*/ /*-------------------------- Commands ------------------------------------*/
int DevexecAction(SConnection *pCon, SicsInterp *pSics, void *pData, int DevexecAction(SConnection *pCon, SicsInterp *pSics, void *pData,
@ -164,13 +166,13 @@
/*--------------------------- Locking ---------------------------------*/ /*--------------------------- Locking ---------------------------------*/
#line 190 "devexec.w" #line 192 "devexec.w"
void LockDeviceExecutor(pExeList self); void LockDeviceExecutor(pExeList self);
void UnlockDeviceExecutor(pExeList self); void UnlockDeviceExecutor(pExeList self);
#line 309 "devexec.w" #line 311 "devexec.w"
/* -------------------------- Executor management -------------------------*/ /* -------------------------- Executor management -------------------------*/

View File

@ -77,6 +77,7 @@ static int SimConfig(pHistDriver self, SConnection * pCon,
self->pPriv = NewSIMCounter("HistoSim", fFail); self->pPriv = NewSIMCounter("HistoSim", fFail);
} }
/* /*
configured test value configured test value
*/ */

View File

@ -246,21 +246,25 @@ static int MultiSecTransfer(void *pData, SConnection * pCon)
char pBueffel[132]; char pBueffel[132];
pCounter pCount = NULL; pCounter pCount = NULL;
pHdb transfer; pHdb transfer;
SConnection *myCon;
pCount = (pCounter) pData; pCount = (pCounter) pData;
transfer = GetHipadabaNode(pCount->objectNode,"transfer"); transfer = GetHipadabaNode(pCount->objectNode,"transfer");
if(transfer != NULL){ if(transfer != NULL){
MacroPush(pCon); myCon = SCCopyConnection(pCon);
MacroPush(myCon);
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text); tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
if (tclStatus != TCL_OK) { if (tclStatus != TCL_OK) {
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s", snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
Tcl_GetStringResult(InterpGetTcl(pServ->pSics))); Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
SCWrite(pCon, pBueffel, eError); SCWrite(pCon, pBueffel, eError);
MacroPop(); MacroPop();
SCDeleteConnection(myCon);
return HWFault; return HWFault;
} }
MacroPop(); MacroPop();
SCDeleteConnection(myCon);
} }
return retVal; return retVal;
} }

View File

@ -1552,6 +1552,7 @@ static int SctProcessCmd(pSICSOBJ ccmd, SConnection * con,
{ {
SctData *data = NULL; SctData *data = NULL;
SctController *c; SctController *c;
time_t startTime;
c = (SctController *) ccmd->pPrivate; c = (SctController *) ccmd->pPrivate;
@ -1581,9 +1582,10 @@ static int SctProcessCmd(pSICSOBJ ccmd, SConnection * con,
data->busy = 1; data->busy = 1;
data->inMacro = SCinMacro(con); data->inMacro = SCinMacro(con);
startTime = time(NULL);
DevQueue(c->devser, data, WritePRIO, DevQueue(c->devser, data, WritePRIO,
SctWriteHandler, SctMatch, NULL, SctDataInfo); SctWriteHandler, SctTransactMatch, NULL, SctDataInfo);
while (data->busy == 1) { while (data->busy == 1 && time(NULL) < startTime + 20) {
TaskYield(pServ->pTasker); TaskYield(pServ->pTasker);
} }
SctKillData(data); SctKillData(data);