- Added a multiple histogram memory control module. This required a

tiny change in the countable interface which in turn required updating
  of header file includes in a lot of files.
- Some small fixes to TRICS writing as well.
This commit is contained in:
cvs
2001-06-08 15:18:35 +00:00
parent 2d16479717
commit 8f84d45dd6
48 changed files with 671 additions and 157 deletions

View File

@ -34,17 +34,13 @@
#include <tcl.h>
#include <time.h>
#include "lld.h"
#include "conman.h"
#include "sics.h"
#include "passwd.h"
#include "SCinter.h"
#include "Scommon.h"
#include "splitter.h"
#include "macro.h"
#include "servlog.h"
#include "status.h"
#include "interrupt.h"
#include "interface.h"
#include "event.h"
#include "ifile.h"
#include "token.h"
#include "uubuffer.h"
@ -826,7 +822,7 @@ extern pServer pServ;
#define ZIPBUF 8192
int SCWriteZipped(SConnection *self, char *pName, void *pData, int iDataLen)
{
char outBuf[65546], *pBuf = NULL, noutBuf[ZIPBUF];
char outBuf[65546], *pBuf = NULL, noutBuf[ZIPBUF], *pHeader = NULL;
int compressedLength, iRet, iRet2, iCount;
z_stream compStream;
@ -895,7 +891,12 @@ extern pServer pServ;
/* write header line */
memset(outBuf,0,65536);
sprintf(outBuf,"SICSBIN ZIP %s %d\r\n",pName,compressedLength);
SCWrite(self,outBuf,eValue);
pHeader = strdup(outBuf);
if(pHeader == NULL)
{
SCWrite(self,"ERROR: out of memory in SCWriteZipped",eError);
return 0;
}
/* now reset the deflater and do the same with writing data */
compStream.zalloc = (alloc_func)NULL;
@ -924,12 +925,13 @@ extern pServer pServ;
compStream.avail_in = iDataLen;
compStream.avail_out = iDataLen + iDataLen/10 + 50;
iRet = deflate(&compStream,Z_FINISH);
if(iRet != Z_STREAM_END && iRet != Z_OK)
if(iRet != Z_STREAM_END)
{
sprintf(outBuf,"ERROR: zlib error: %d",iRet);
SCWrite(self,outBuf,eError);
return 0;
}
iRet = NETWrite(self->pSock,pHeader,strlen(pHeader));
iRet = NETWrite(self->pSock,pBuf,compStream.total_out);
if(iRet != 1)
{
@ -938,6 +940,8 @@ extern pServer pServ;
return 0;
}
deflateEnd(&compStream);
free(pHeader);
free(pBuf);
/*