SCWriteSycamore no longer sends messages to client when inMacro
This commit is contained in:
72
protocol.c
72
protocol.c
@ -450,6 +450,37 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
|
|||||||
return 0;
|
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);
|
comCon = SCGetContext(pCon);
|
||||||
|
|
||||||
/* Return 0 without dying if no message data */
|
/* Return 0 without dying if no message data */
|
||||||
@ -515,39 +546,14 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
|
|||||||
free(savedTclResult);
|
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 ? */
|
/* is this really to be printed ? */
|
||||||
if(iOut < pCon->iOutput)
|
if(iOut < pCon->iOutput)
|
||||||
{
|
{
|
||||||
|
if (parseCmd != NULL)
|
||||||
DeleteDynString(parseCmd);
|
DeleteDynString(parseCmd);
|
||||||
|
if (pMsg != NULL)
|
||||||
DeleteDynString(pMsg);
|
DeleteDynString(pMsg);
|
||||||
|
if (pMsgOut != NULL)
|
||||||
DeleteDynString(pMsgOut);
|
DeleteDynString(pMsgOut);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -556,11 +562,13 @@ int SCWriteSycamore(SConnection *pCon, char *pBuffer, int iOut)
|
|||||||
iRet = SCDoSockWrite(pCon,GetCharArray(pMsgOut));
|
iRet = SCDoSockWrite(pCon,GetCharArray(pMsgOut));
|
||||||
SCWriteToLogFiles(pCon,GetCharArray(pMsgOut));
|
SCWriteToLogFiles(pCon,GetCharArray(pMsgOut));
|
||||||
}
|
}
|
||||||
if(pMsgOut != NULL){
|
if (pMsgOut != NULL){
|
||||||
DeleteDynString(pMsgOut);
|
DeleteDynString(pMsgOut);
|
||||||
}
|
}
|
||||||
DeleteDynString(parseCmd);
|
if (parseCmd != NULL)
|
||||||
DeleteDynString(pMsg);
|
DeleteDynString(parseCmd);
|
||||||
|
if (pMsg != NULL)
|
||||||
|
DeleteDynString(pMsg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user