aloww len==fec_mtu

This commit is contained in:
wangyu-
2017-10-27 21:16:59 -05:00
parent ba81aa14d4
commit a3b5187b1f
7 changed files with 190 additions and 80 deletions

View File

@@ -218,12 +218,12 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
//int counter_back=counter;
assert(fec_mode==0||fec_mode==1);
if(fec_mode==0&& s!=0 &&counter==0&&blob_encode.get_shard_len(fec_data_num,len)>=fec_mtu)
if(fec_mode==0&& s!=0 &&counter==0&&blob_encode.get_shard_len(fec_data_num,len)>fec_mtu)
{
mylog(log_warn,"message too long len=%d,ignored\n",len);
return -1;
}
if(fec_mode==1&&s!=0&&len>=fec_mtu)
if(fec_mode==1&&s!=0&&len>fec_mtu)
{
mylog(log_warn,"message too long len=%d fec_mtu=%d,ignored\n",len,fec_mtu);
return -1;
@@ -235,7 +235,7 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
}
if(s==0) about_to_fec=1;//now
if(fec_mode==0&& blob_encode.get_shard_len(fec_data_num,len)>=fec_mtu) {about_to_fec=1; delayed_append=1;}//fec then add packet
if(fec_mode==0&& blob_encode.get_shard_len(fec_data_num,len)>fec_mtu) {about_to_fec=1; delayed_append=1;}//fec then add packet
if(fec_mode==0) assert(counter<fec_queue_len);//counter will never equal fec_pending_num,if that happens fec should already been done.
if(fec_mode==1) assert(counter<fec_data_num);