it works now,without anything changed..

This commit is contained in:
wangyu- 2017-10-09 02:24:23 -05:00
parent 8fd5118e6c
commit d3beacf586
3 changed files with 27 additions and 19 deletions

View File

@ -281,7 +281,7 @@ int conn_manager_t::clear_inactive()
} }
int conn_manager_t::clear_inactive0() int conn_manager_t::clear_inactive0()
{ {
mylog(log_info,"called\n"); //mylog(log_info,"called\n");
unordered_map<u64_t,conn_info_t*>::iterator it; unordered_map<u64_t,conn_info_t*>::iterator it;
unordered_map<u64_t,conn_info_t*>::iterator old_it; unordered_map<u64_t,conn_info_t*>::iterator old_it;
@ -293,12 +293,12 @@ mylog(log_info,"called\n");
int size=mp.size(); int size=mp.size();
int num_to_clean=size/conn_clear_ratio+conn_clear_min; //clear 1/10 each time,to avoid latency glitch int num_to_clean=size/conn_clear_ratio+conn_clear_min; //clear 1/10 each time,to avoid latency glitch
mylog(log_trace,"mp.size() %d\n", size); //mylog(log_trace,"mp.size() %d\n", size);
num_to_clean=min(num_to_clean,(int)mp.size()); num_to_clean=min(num_to_clean,(int)mp.size());
u64_t current_time=get_current_time(); u64_t current_time=get_current_time();
mylog(log_info,"here size=%d\n",(int)mp.size()); //mylog(log_info,"here size=%d\n",(int)mp.size());
for(;;) for(;;)
{ {
if(cnt>=num_to_clean) break; if(cnt>=num_to_clean) break;
@ -310,7 +310,7 @@ mylog(log_info,"called\n");
if(it->second->conv_manager.get_size() >0) if(it->second->conv_manager.get_size() >0)
{ {
mylog(log_info,"[%s:%d]size %d \n",my_ntoa(get_u64_h(it->first)),get_u64_l(it->first),(int)it->second->conv_manager.get_size()); //mylog(log_info,"[%s:%d]size %d \n",my_ntoa(get_u64_h(it->first)),get_u64_l(it->first),(int)it->second->conv_manager.get_size());
it++; it++;
} }
else else

View File

@ -276,6 +276,8 @@ int fec_decode_manager_t::input(char *s,int len)
ok=0; ok=0;
if(fec_data[first_idx].len!=len) if(fec_data[first_idx].len!=len)
ok=0; ok=0;
if(fec_data[first_idx].type!=type)
ok=0;
if(ok==0) if(ok==0)
{ {
return 0; return 0;
@ -308,7 +310,8 @@ int fec_decode_manager_t::input(char *s,int len)
assert((int)inner_mp.size()<=data_num); assert((int)inner_mp.size()<=data_num);
if((int)inner_mp.size()==data_num) if((int)inner_mp.size()==data_num)
{ {
if(type==0)
{
char *fec_tmp_arr[max_fec_packet_num+5]={0}; char *fec_tmp_arr[max_fec_packet_num+5]={0};
for(auto it=inner_mp.begin();it!=inner_mp.end();it++) for(auto it=inner_mp.begin();it!=inner_mp.end();it++)
{ {
@ -324,6 +327,11 @@ int fec_decode_manager_t::input(char *s,int len)
ready_for_output=1; ready_for_output=1;
anti_replay.set_invaild(seq); anti_replay.set_invaild(seq);
} }
else
{
}
}
return 0; return 0;
} }

View File

@ -310,7 +310,7 @@ int client_event_loop()
if(events[idx].data.u64 == conn_info.fec_encode_manager.get_timer_fd64()) if(events[idx].data.u64 == conn_info.fec_encode_manager.get_timer_fd64())
{ {
mylog(log_info,"timer!!!\n"); //mylog(log_info,"timer!!!\n");
uint64_t value; uint64_t value;
if(!fd_manager.exist(fd64)) //fd64 has been closed if(!fd_manager.exist(fd64)) //fd64 has been closed
{ {
@ -733,7 +733,7 @@ int server_event_loop()
if(fd64==conn_info.fec_encode_manager.get_timer_fd64()) if(fd64==conn_info.fec_encode_manager.get_timer_fd64())
{ {
mylog(log_info,"timer!!!\n"); //mylog(log_info,"timer!!!\n");
uint64_t value; uint64_t value;
if(read(fd_manager.to_fd(fd64), &value, 8)!=8) if(read(fd_manager.to_fd(fd64), &value, 8)!=8)
{ {