Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
6dc61e5656
  1. 6
      iguana/main.c
  2. 4
      iguana/poker.c
  3. 2
      includes/iguana_funcs.h
  4. 4
      pnacl_main.h

6
iguana/main.c

@ -134,11 +134,13 @@ void SuperNET_MYINFOadd(struct supernet_info *myinfo)
}
}
char *iguana_JSON(struct supernet_info *myinfo,struct iguana_info *coin,char *jsonstr,uint16_t port)
char *iguana_JSON(void *_myinfo,void *_coin,char *jsonstr,uint16_t port)
{
char *retstr=0; cJSON *json;
char *retstr=0; cJSON *json; struct supernet_info *myinfo = _myinfo; struct iguana_info *coin = _coin;
if ( (json= cJSON_Parse(jsonstr)) != 0 )
{
if ( myinfo == 0 )
myinfo = SuperNET_MYINFO(0);
retstr = SuperNET_JSON(myinfo,coin,json,"127.0.0.1",port);
free_json(json);
}

4
iguana/poker.c

@ -625,8 +625,8 @@ void poker_test()
}
starttime = (uint32_t)time(NULL);
#ifndef _WIN32
while ( (uint32_t)time(NULL) == starttime )
usleep(100);
//while ( (uint32_t)time(NULL) == starttime )
// usleep(100);
total = counter = 0;
while ( (uint32_t)time(NULL) < starttime+11 )
{

2
includes/iguana_funcs.h

@ -138,7 +138,7 @@ double dxblend(double *destp,double val,double decay);
// json
int32_t iguana_processjsonQ(struct iguana_info *coin); // reentrant, can be called during any idletime
char *iguana_JSON(struct supernet_info *myinfo,struct iguana_info *coin,char *,uint16_t port);
char *iguana_JSON(void *_myinfo,void *_coin,char *jsonstr,uint16_t port);
char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *delaymillisp,char *ipaddr,uint8_t *data,int32_t datalen,int32_t compressed);
char *mbstr(char *str,double);

4
pnacl_main.h

@ -622,14 +622,14 @@ static int GetParamString(struct PP_Var params,
int CHROMEAPP_HANDLER(struct PP_Var params,struct PP_Var *output,const char **out_error)
{
char *CHROMEAPP_JSON(char *,uint16_t port);
char *CHROMEAPP_JSON(void *_myinfo,void *_coin,char *,uint16_t port);
char *retstr;
PNACL_message("inside Handle_%s\n",CHROMEAPP_STR);
CHECK_PARAM_COUNT(CHROMEAPP_STR, 1);
PARAM_STRING(0,jsonstr);
if ( jsonstr == 0 )
retstr = clonestr("{\"error\":\"illegal null jsonstr received\"}");
else if ( (retstr= CHROMEAPP_JSON(jsonstr,7778)) == 0 )
else if ( (retstr= CHROMEAPP_JSON(0,0,jsonstr,7778)) == 0 )
retstr = clonestr("{\"error\":\"null return\"}");
CREATE_RESPONSE(CHROMEAPP_STR);
RESPONSE_STRING(retstr);

Loading…
Cancel
Save