SCWriteSycamore no longer sends messages to client when inMacro

This commit is contained in:
hauser_n
2006-01-30 01:37:45 +00:00
parent 97105bd8b5
commit c99eef86aa

View File

@ -450,6 +450,37 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
return 0;
}
/* log it for any case */
if(pCon->pSock)
{
iRet = pCon->pSock->sockid;
}
else
{
iRet = 0;
}
sprintf(pBueffel,"Next line intended for socket: %d",iRet);
SICSLogWrite(pBueffel,eInternal);
SICSLogWrite(pBuffer,iOut);
/* write to commandlog if user or manager privilege */
if(SCGetRights(pCon) <= usUser)
{
sprintf(pBueffel,"To sock %d :",iRet);
WriteToCommandLog(pBueffel,pBuffer);
}
/* put it into the interpreter if present */
if(SCinMacro(pCon))
{
InterpWrite(pServ->pSics,pBuffer);
/* print it to client if error message */
/* FIXME should report errors via sycamore
if((iOut== eError) || (iOut == eWarning) )
iRet = SCDoSockWrite(pCon,GetCharArray(pMsgOut));*/
}
else /* not in interpreter, normal logic */
{
comCon = SCGetContext(pCon);
/* Return 0 without dying if no message data */
@ -515,39 +546,14 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
free(savedTclResult);
}
/* log it for any case */
if(pCon->pSock)
{
iRet = pCon->pSock->sockid;
}
else
{
iRet = 0;
}
sprintf(pBueffel,"Next line intended for socket: %d",iRet);
SICSLogWrite(pBueffel,eInternal);
SICSLogWrite(GetCharArray(pMsgOut),iOut);
/* write to commandlog if user or manager privilege */
if(SCGetRights(pCon) <= usUser)
{
sprintf(pBueffel,"To sock %d :",iRet);
WriteToCommandLog(pBueffel,GetCharArray(pMsgOut));
}
/* put it into the interpreter if present */
if(SCinMacro(pCon))
{
InterpWrite(pSics,pBuffer);
iRet = SCDoSockWrite(pCon,GetCharArray(pMsgOut));
}
else /* not in interpreter, normal logic */
{
/* is this really to be printed ? */
if(iOut < pCon->iOutput)
{
if (parseCmd != NULL)
DeleteDynString(parseCmd);
if (pMsg != NULL)
DeleteDynString(pMsg);
if (pMsgOut != NULL)
DeleteDynString(pMsgOut);
return 0;
}
@ -556,11 +562,13 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
iRet = SCDoSockWrite(pCon,GetCharArray(pMsgOut));
SCWriteToLogFiles(pCon,GetCharArray(pMsgOut));
}
if(pMsgOut != NULL){
DeleteDynString(pMsgOut);
if (pMsgOut != NULL){
DeleteDynString(pMsgOut);
}
DeleteDynString(parseCmd);
DeleteDynString(pMsg);
if (parseCmd != NULL)
DeleteDynString(parseCmd);
if (pMsg != NULL)
DeleteDynString(pMsg);
return 1;
}