src: Fix select_padding_callback which returns value greater than max_payload
This commit is contained in:
parent
dbb131d13d
commit
cd3eae3dd2
|
@ -936,7 +936,7 @@ ssize_t select_padding_callback
|
||||||
return frame->hd.length;
|
return frame->hd.length;
|
||||||
}
|
}
|
||||||
if(frame->hd.length == 0) {
|
if(frame->hd.length == 0) {
|
||||||
return bd;
|
return std::min(max_payload, bd);
|
||||||
}
|
}
|
||||||
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1136,7 +1136,7 @@ ssize_t select_padding_callback
|
||||||
return frame->hd.length;
|
return frame->hd.length;
|
||||||
}
|
}
|
||||||
if(frame->hd.length == 0) {
|
if(frame->hd.length == 0) {
|
||||||
return bd;
|
return std::min(max_payload, bd);
|
||||||
}
|
}
|
||||||
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ ssize_t select_padding_callback
|
||||||
{
|
{
|
||||||
auto bd = get_config()->padding;
|
auto bd = get_config()->padding;
|
||||||
if(frame->hd.length == 0) {
|
if(frame->hd.length == 0) {
|
||||||
return bd;
|
return std::min(max_payload, bd);
|
||||||
}
|
}
|
||||||
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
return std::min(max_payload, (frame->hd.length + bd - 1) / bd * bd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue