Test
This commit is contained in:
@@ -1457,7 +1457,8 @@ long komodo_indfile_update(FILE *indfp,uint32_t *prevpos100p,long lastfpos,long
|
|||||||
tmp = ((uint32_t)(lastfpos - *prevpos100p) << 8) | (func & 0xff);
|
tmp = ((uint32_t)(lastfpos - *prevpos100p) << 8) | (func & 0xff);
|
||||||
if ( ftell(indfp)/sizeof(uint32_t) != *indcounterp )
|
if ( ftell(indfp)/sizeof(uint32_t) != *indcounterp )
|
||||||
printf("indfp fpos %ld -> ind.%ld vs counter.%u\n",ftell(indfp),ftell(indfp)/sizeof(uint32_t),*indcounterp);
|
printf("indfp fpos %ld -> ind.%ld vs counter.%u\n",ftell(indfp),ftell(indfp)/sizeof(uint32_t),*indcounterp);
|
||||||
fwrite(&tmp,1,sizeof(tmp),indfp), (*indcounterp)++;
|
fprintf(stderr,"ftell.%ld indcounter.%u lastfpos.%ld newfpos.%ld func.%02x\n",ftell(indfp),*indcounterp,lastfpos,newfpos,func);
|
||||||
|
fwrite(&tmp,1,sizeof(tmp),indfp), (*indcounterp)++;
|
||||||
if ( (*indcounterp % 100) == 0 )
|
if ( (*indcounterp % 100) == 0 )
|
||||||
{
|
{
|
||||||
*prevpos100p = (uint32_t)newfpos;
|
*prevpos100p = (uint32_t)newfpos;
|
||||||
@@ -1506,7 +1507,11 @@ int32_t komodo_faststateinit(struct komodo_state *sp,char *fname,char *symbol,ch
|
|||||||
if ( ftell(indfp) == indcounter * sizeof(uint32_t) )
|
if ( ftell(indfp) == indcounter * sizeof(uint32_t) )
|
||||||
{
|
{
|
||||||
while ( (func= komodo_parsestatefiledata(sp,filedata,&fpos,datalen,symbol,dest)) >= 0 )
|
while ( (func= komodo_parsestatefiledata(sp,filedata,&fpos,datalen,symbol,dest)) >= 0 )
|
||||||
|
{
|
||||||
lastfpos = komodo_indfile_update(indfp,&prevpos100,lastfpos,fpos,func,&indcounter);
|
lastfpos = komodo_indfile_update(indfp,&prevpos100,lastfpos,fpos,func,&indcounter);
|
||||||
|
if ( lastfpos != fpos )
|
||||||
|
fprintf(stderr,"unexpected lastfpos.%ld != %ld\n",lastfpos,fpos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fclose(indfp);
|
fclose(indfp);
|
||||||
if ( komodo_stateind_validate(sp,indfname,filedata,datalen,&prevpos100,&indcounter,symbol,dest) < 0 )
|
if ( komodo_stateind_validate(sp,indfname,filedata,datalen,&prevpos100,&indcounter,symbol,dest) < 0 )
|
||||||
@@ -1528,7 +1533,7 @@ void komodo_passport_iteration()
|
|||||||
{
|
{
|
||||||
static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime,callcounter;
|
static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime,callcounter;
|
||||||
int32_t maxseconds = 10;
|
int32_t maxseconds = 10;
|
||||||
FILE *fp; uint8_t *filedata; long fpos,datalen; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0;
|
FILE *fp; uint8_t *filedata; long fpos,datalen,lastfpos; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0;
|
||||||
//printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL);
|
//printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL);
|
||||||
expired = 0;
|
expired = 0;
|
||||||
while ( KOMODO_INITDONE == 0 )
|
while ( KOMODO_INITDONE == 0 )
|
||||||
@@ -1589,9 +1594,9 @@ void komodo_passport_iteration()
|
|||||||
fpos = 0;
|
fpos = 0;
|
||||||
fprintf(stderr,"%s processing %s %ldKB\n",ASSETCHAINS_SYMBOL,fname,datalen/1024);
|
fprintf(stderr,"%s processing %s %ldKB\n",ASSETCHAINS_SYMBOL,fname,datalen/1024);
|
||||||
while ( komodo_parsestatefiledata(sp,filedata,&fpos,datalen,symbol,dest) >= 0 )
|
while ( komodo_parsestatefiledata(sp,filedata,&fpos,datalen,symbol,dest) >= 0 )
|
||||||
;
|
lastfpos = fpos;
|
||||||
fprintf(stderr,"%s took %d seconds to process %s %ldKB\n",ASSETCHAINS_SYMBOL,(int32_t)(time(NULL)-starttime),fname,datalen/1024);
|
fprintf(stderr,"%s took %d seconds to process %s %ldKB\n",ASSETCHAINS_SYMBOL,(int32_t)(time(NULL)-starttime),fname,datalen/1024);
|
||||||
lastpos[baseid] = fpos;
|
lastpos[baseid] = lastfpos;
|
||||||
free(filedata), filedata = 0;
|
free(filedata), filedata = 0;
|
||||||
datalen = 0;
|
datalen = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user