Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d5f989d7c3
  1. 6
      iguana/iguana_peers.c

6
iguana/iguana_peers.c

@ -400,7 +400,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
} }
} }
addr->totalsent += len; addr->totalsent += len;
printf(" sent.%d bytes to %s\n",len,addr->ipaddr);// getchar(); printf(" %s sent.%d bytes to %s\n",(char *)&serialized[4],len,addr->ipaddr);// getchar();
return(len); return(len);
} }
@ -440,7 +440,7 @@ int32_t iguana_recv(int32_t usock,uint8_t *recvbuf,int32_t len)
{ {
if ( (recvlen= (int32_t)recv(usock,recvbuf,remains,0)) < 0 ) if ( (recvlen= (int32_t)recv(usock,recvbuf,remains,0)) < 0 )
{ {
//printf("recv errno.%d %s\n",errno,strerror(errno)); printf("recv errno.%d %s\n",errno,strerror(errno));
if ( errno == EAGAIN ) if ( errno == EAGAIN )
{ {
#ifdef IGUANA_DEDICATED_THREADS #ifdef IGUANA_DEDICATED_THREADS
@ -457,7 +457,7 @@ int32_t iguana_recv(int32_t usock,uint8_t *recvbuf,int32_t len)
remains -= recvlen; remains -= recvlen;
recvbuf = &recvbuf[recvlen]; recvbuf = &recvbuf[recvlen];
} else usleep(10000); } else usleep(10000);
if ( 0 && remains > 0 ) //if ( 0 && remains > 0 )
printf("got %d remains.%d of total.%d\n",recvlen,remains,len); printf("got %d remains.%d of total.%d\n",recvlen,remains,len);
} }
} }

Loading…
Cancel
Save