diff --git a/connection.cpp b/connection.cpp index 667f91f..2638cf0 100644 --- a/connection.cpp +++ b/connection.cpp @@ -711,7 +711,17 @@ int parse_safer(conn_info_t &conn_info,const char * input,int input_len,char &ty conn_info.oppsite_roller=roller; conn_info.last_oppsite_roller_time=get_current_time(); } - conn_info.my_roller++;//increase on a successful recv + if(hb_mode==0) + conn_info.my_roller++;//increase on a successful recv + else if(hb_mode==1) + { + if(type=='h') + conn_info.my_roller++; + } + else + { + assert(0==1); + } if(after_recv_raw0(conn_info.raw_info)!=0) return -1; diff --git a/main.cpp b/main.cpp index 1d1b1da..2c06530 100755 --- a/main.cpp +++ b/main.cpp @@ -439,7 +439,7 @@ int client_on_raw_recv(conn_info_t &conn_info) //called when raw fd received a p } if(data_len>=0&&type=='h') { - mylog(log_debug,"[hb]heart beat received\n"); + mylog(log_debug,"[hb]heart beat received,oppsite_roller=%d\n",int(conn_info.oppsite_roller)); conn_info.last_hb_recv_time=get_current_time(); return 0; }