|
|
@ -106,12 +106,12 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) |
|
|
|
while ( (size= nn_recv(myinfo->DPOW.sock,&np,NN_MSG,0)) >= 0 ) |
|
|
|
{ |
|
|
|
if ( size >= 0 ) |
|
|
|
{ |
|
|
|
if ( np->version0 == (DPOW_VERSION & 0xff) && np->version1 == ((DPOW_VERSION >> 8) & 0xff) ) |
|
|
|
{ |
|
|
|
if ( np->datalen == (size - sizeof(*np)) ) |
|
|
|
{ |
|
|
|
crc32 = calc_crc32(0,np->packet,np->datalen); |
|
|
|
if ( np->version0 != (DPOW_VERSION & 0xff) || np->version1 != ((DPOW_VERSION >> 8) & 0xff) ) |
|
|
|
return; |
|
|
|
if ( crc32 == np->crc32 && (firstz= dpow_crc32find(myinfo,crc32,np->channel)) >= 0 ) |
|
|
|
{ |
|
|
|
myinfo->DPOW.crcs[firstz] = crc32; |
|
|
@ -119,6 +119,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) |
|
|
|
dpow_datahandler(myinfo,np->channel,np->height,np->packet,np->datalen,1); |
|
|
|
} |
|
|
|
} else printf("np->datalen.%d %d (size %d - %ld)\n",np->datalen,(int32_t)(size-sizeof(*np)),size,sizeof(*np)); |
|
|
|
} |
|
|
|
if ( np != 0 ) |
|
|
|
nn_freemsg(np); |
|
|
|
} |
|
|
|