relax restriction for fec_data_num==1

This commit is contained in:
wangyu- 2017-10-31 22:14:57 -05:00
parent d83ae88716
commit ec63c61e09

View File

@ -219,6 +219,16 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
assert(fec_mode==0||fec_mode==1); assert(fec_mode==0||fec_mode==1);
if(fec_mode==0&& s!=0 &&counter==0) if(fec_mode==0&& s!=0 &&counter==0)
{
if(fec_data_num==1)
{
if(len>fec_mtu)
{
mylog(log_warn,"message too long for fec_data_num=1, len=%d fec_mtu=%d,ignored\n",len,fec_mtu);
return -1;
}
}
else
{ {
int out_len=blob_encode.get_shard_len(fec_data_num,len); int out_len=blob_encode.get_shard_len(fec_data_num,len);
if(out_len>fec_mtu) if(out_len>fec_mtu)
@ -227,6 +237,7 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
return -1; 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); mylog(log_warn,"message too long len=%d fec_mtu=%d,ignored\n",len,fec_mtu);