Browse Source

Test

etomic
jl777 7 years ago
parent
commit
bcff592f3a
  1. 6
      iguana/exchanges/LP_nativeDEX.c
  2. 16
      iguana/exchanges/stats.c

6
iguana/exchanges/LP_nativeDEX.c

@ -1203,12 +1203,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
printf("RPC port got stuck, start a new thread\n");
LP_bindsock = -1;
closesocket(sock);
LP_bindsock_reset++;
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 )
{
printf("error launching stats rpcloop for port.%u\n",myport);
exit(-1);
}
}
}
}

16
iguana/exchanges/stats.c

@ -23,6 +23,9 @@
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h> /* See NOTES */
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/socket.h>
#include "../../crypto777/OS_portable.h"
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define STATS_DESTDIR "/var/www/html"
@ -762,7 +765,20 @@ void stats_rpcloop(void *args)
}
//printf("after LP_bindsock.%d\n",LP_bindsock);
clilen = sizeof(cli_addr);
#ifdef _WIN32
sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen);
#else
#ifdef __APPLE__
sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen);
#else
sock = accept4(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen,SOCK_NONBLOCK);
if ( sock < 0 )
{
usleep(50000);
continue;
}
#endif
#endif
if ( sock < 0 )
{
printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno));

Loading…
Cancel
Save