Skip to content

Commit 02c1943

Browse files
committed
ensures InMemoryResumableFramesStore does not retain not resumable frames
Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 05ca60b commit 02c1943

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rsocket-core/src/main/java/io/rsocket/resume/InMemoryResumableFramesStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public void onNext(ByteBuf frame) {
274274

275275
final CoreSubscriber<? super ByteBuf> actual = this.actual;
276276
if (state == 1) {
277-
actual.onNext(frame.retain());
277+
actual.onNext(isResumable ? frame.retainedSlice() : frame);
278278
} else if (!isResumable || state == 2) {
279279
frame.release();
280280
}
@@ -302,7 +302,7 @@ public void subscribe(CoreSubscriber<? super ByteBuf> actual) {
302302
actual.onSubscribe(this);
303303
synchronized (this) {
304304
for (final ByteBuf frame : cachedFrames) {
305-
actual.onNext(frame.retain());
305+
actual.onNext(frame.retainedSlice());
306306
}
307307
}
308308

0 commit comments

Comments
 (0)