Fixed generation of sliced data frames, setting the end stream flag
only when all the content has been generated.
This commit is contained in:
parent
a58a5f8268
commit
d4783369bc
|
@ -67,10 +67,11 @@ public class DataGenerator
|
|||
int end = data.limit();
|
||||
for (int i = 1; i <= frames; ++i)
|
||||
{
|
||||
data.limit(begin + Math.min(dataBytesPerFrame * i, length));
|
||||
int limit = begin + Math.min(dataBytesPerFrame * i, length);
|
||||
data.limit(limit);
|
||||
ByteBuffer slice = data.slice();
|
||||
data.position(data.limit());
|
||||
generateFrame(lease, streamId, slice, i == frames && last);
|
||||
data.position(limit);
|
||||
generateFrame(lease, streamId, slice, i == frames && last && limit == end);
|
||||
}
|
||||
data.limit(end);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue