- Fixed a bug which caused the SICServer to die when a socket was broken.

- Fixed many things in DIFRAC subsystem:
  * Recoded tcentr.f etc so that the course centering will work and will not
    go into an endless loop.
  * fixed boundary overwrites which occurred when yesno or alfnum where
    uset to get a single character and several were given.
  * Addeded documentation for DIFRAC
- Added tcl-files which  support the WWW status system
This commit is contained in:
cvs
2000-03-31 13:16:50 +00:00
parent d02a81400f
commit 714b8ae84d
35 changed files with 3069 additions and 203 deletions

View File

@ -367,6 +367,21 @@ extern pServer pServ;
return;
}
if(pVictim->inUse > 0)
{
SCnoSock(pVictim);
if(pVictim->pSock)
{
NETClosePort(pVictim->pSock);
free(pVictim->pSock);
pVictim->pSock = NULL;
}
WriteToCommandLog("SYS> ",
"ERROR: Erraneous deletion of used Connection stopped");
return;
}
/* remove the connection from the server log if it has captured
something
*/
@ -471,6 +486,7 @@ extern pServer pServ;
{
char *pStart = NULL, *pPtr;
int iCount, iState;
int iRet = 1;
pStart = pBuffer;
pPtr = pStart;
@ -484,8 +500,8 @@ extern pServer pServ;
if( (*pPtr == '\r') || (*pPtr == '\n') )
{
iState = LF;
NETWrite(pSock,pStart,iCount);
NETWrite(pSock,"\r\n",2);
iRet = NETWrite(pSock,pStart,iCount);
iRet = NETWrite(pSock,"\r\n",2);
iCount = 0;
}
else
@ -510,10 +526,10 @@ extern pServer pServ;
}
if(iCount > 0)
{
NETWrite(pSock,pStart,iCount);
NETWrite(pSock,"\r\n",2);
iRet = NETWrite(pSock,pStart,iCount);
iRet = NETWrite(pSock,"\r\n",2);
}
return 1;
return iRet;
}
/*-------------------------------------------------------------------------*/
int SCWrite(SConnection *self, char *pBuffer, int iOut)
@ -566,7 +582,7 @@ extern pServer pServ;
{
if(self->iTelnet)
{
TelnetWrite(self->pSock,buffer);
iRet = TelnetWrite(self->pSock,buffer);
}
else
{
@ -576,6 +592,11 @@ extern pServer pServ;
iRet = NETWrite(self->pSock,"\n",sizeof("\n"));
}
}
if(!iRet)
{
SCnoSock(self);
WriteToCommandLog("SYS> ","Connection broken on send");
}
}
else
{
@ -594,7 +615,7 @@ extern pServer pServ;
{
if(self->iTelnet)
{
TelnetWrite(self->pSock,buffer);
iRet = TelnetWrite(self->pSock,buffer);
}
else
{
@ -605,7 +626,10 @@ extern pServer pServ;
}
}
if(!iRet)
return 0;
{
SCnoSock(self);
WriteToCommandLog("SYS> ","Send broken to connection");
}
}
else
{
@ -863,6 +887,7 @@ extern pServer pServ;
int iRet, i;
char *pPtr = NULL;
char pFrom[50];
Status eOld;
if(!VerifyConnection(pCon))
@ -890,6 +915,8 @@ extern pServer pServ;
SetStatus(eOld);
CostaLock(pCon->pStack);
strncpy(pResult,pPtr,iLen);
sprintf(pFrom,"Prompted from sock %2.2d: ", pCon->pSock->sockid);
WriteToCommandLog(pFrom,pPtr);
return 1;
}
}
@ -1360,9 +1387,16 @@ extern pServer pServ;
return 0;
}
if(self->iEnd)
if(self->iEnd)
{
return 0;
if(self->inUse != 0)
{
return 1;
}
else
{
return 0;
}
}
@ -1379,9 +1413,16 @@ extern pServer pServ;
free(pPtr);
}
}
if(self->iEnd)
if(self->iEnd)
{
return 0;
if(self->inUse != 0)
{
return 1;
}
else
{
return 0;
}
}
return 1;