diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 5d4c097ca..74566a50f 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -249,13 +249,15 @@ void *queue_dequeue(queue_t *queue,int32_t offsetflag) void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem) { + struct allocitem *ptr; struct queueitem *item = 0; lock_queue(queue); if ( queue->list != 0 ) { DL_FOREACH(queue->list,item) { - if ( item == copy || memcmp((void *)((long)item + sizeof(struct queueitem)),(void *)((long)item + sizeof(struct queueitem)),copysize) == 0 ) + ptr = (void *)((long)item - sizeof(struct allocitem)); + if ( item == copy || (ptr->allocsize == copysize && memcmp((void *)((long)item + sizeof(struct queueitem)),(void *)((long)item + sizeof(struct queueitem)),copysize) == 0) ) { DL_DELETE(queue->list,item); portable_mutex_unlock(&queue->mutex); diff --git a/iguana/main.c b/iguana/main.c index 5f902ccfe..d7abb07bc 100644 --- a/iguana/main.c +++ b/iguana/main.c @@ -100,8 +100,8 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,char *jsonstr,uint64_t usleep(100); if ( retjsonstr != 0 ) { - //printf("blocking retjsonstr.(%s)\n",retjsonstr); - queue_delete(&finishedQ,&ptr->DL,allocsize,1); + printf("got blocking retjsonstr.(%s) delete allocsize.%d:%d\n",retjsonstr,allocsize,ptr->allocsize); + queue_delete(&finishedQ,&ptr->DL,ptr->allocsize,1); return(retjsonstr); } usleep(1000);