|
|
@ -250,7 +250,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, |
|
|
|
if ( duplicate != 0 ) |
|
|
|
dup++; |
|
|
|
else uniq++; |
|
|
|
//portable_mutex_lock(&LP_commandmutex);
|
|
|
|
portable_mutex_lock(&LP_commandmutex); |
|
|
|
if ( (LP_rand() % 100000) == 0 ) |
|
|
|
printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); |
|
|
|
if ( duplicate == 0 ) |
|
|
@ -341,7 +341,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, |
|
|
|
free_json(argjson); |
|
|
|
} |
|
|
|
} //else printf("DUPLICATE.(%s)\n",(char *)ptr);
|
|
|
|
//portable_mutex_unlock(&LP_commandmutex);
|
|
|
|
portable_mutex_unlock(&LP_commandmutex); |
|
|
|
if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 ) |
|
|
|
free(jsonstr); |
|
|
|
return(retstr); |
|
|
@ -448,7 +448,7 @@ int32_t LP_nanomsg_recvs(void *ctx) |
|
|
|
int32_t n=0,nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; |
|
|
|
if ( (origipaddr= LP_myipaddr) == 0 ) |
|
|
|
origipaddr = "127.0.0.1"; |
|
|
|
//portable_mutex_lock(&LP_nanorecvsmutex);
|
|
|
|
portable_mutex_lock(&LP_nanorecvsmutex); |
|
|
|
HASH_ITER(hh,LP_peerinfos,peer,tmp) |
|
|
|
{ |
|
|
|
if ( n++ > 0 && peer->errors >= LP_MAXPEER_ERRORS ) |
|
|
@ -474,7 +474,7 @@ int32_t LP_nanomsg_recvs(void *ctx) |
|
|
|
{ |
|
|
|
nonz += LP_sock_check("PULL",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); |
|
|
|
} |
|
|
|
//portable_mutex_unlock(&LP_nanorecvsmutex);
|
|
|
|
portable_mutex_unlock(&LP_nanorecvsmutex); |
|
|
|
return(nonz); |
|
|
|
} |
|
|
|
|
|
|
|