File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed
rsocket-core/src/main/java/io/rsocket/core Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2015-2018 the original author or authors.
2
+ * Copyright 2015-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
19
19
import static io .rsocket .keepalive .KeepAliveSupport .ClientKeepAliveSupport ;
20
20
21
21
import io .netty .buffer .ByteBuf ;
22
+ import io .netty .util .collection .IntObjectMap ;
22
23
import io .rsocket .DuplexConnection ;
23
24
import io .rsocket .Payload ;
24
25
import io .rsocket .RSocket ;
@@ -343,15 +344,15 @@ private void terminate(Throwable e) {
343
344
}
344
345
345
346
synchronized (this ) {
346
- activeStreams
347
- . values ()
348
- . forEach (
349
- receiver -> {
350
- try {
351
- receiver . handleError ( e );
352
- } catch ( Throwable ignored ) {
353
- }
354
- });
347
+ for ( IntObjectMap . PrimitiveEntry < FrameHandler > entry : activeStreams . entries ()) {
348
+ FrameHandler handler = entry . value ();
349
+ if ( handler != null ) {
350
+ try {
351
+ handler . handleError ( e );
352
+ } catch ( Throwable ignored ) {
353
+ }
354
+ }
355
+ }
355
356
}
356
357
357
358
if (e == CLOSED_CHANNEL_EXCEPTION ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2015-2018 the original author or authors.
2
+ * Copyright 2015-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package io .rsocket .core ;
18
18
19
19
import io .netty .buffer .ByteBuf ;
20
+ import io .netty .util .collection .IntObjectMap ;
20
21
import io .rsocket .DuplexConnection ;
21
22
import io .rsocket .Payload ;
22
23
import io .rsocket .RSocket ;
@@ -183,7 +184,12 @@ final void doOnDispose() {
183
184
}
184
185
185
186
private synchronized void cleanUpSendingSubscriptions () {
186
- activeStreams .values ().forEach (FrameHandler ::handleCancel );
187
+ for (IntObjectMap .PrimitiveEntry <FrameHandler > entry : activeStreams .entries ()) {
188
+ FrameHandler handler = entry .value ();
189
+ if (handler != null ) {
190
+ handler .handleCancel ();
191
+ }
192
+ }
187
193
activeStreams .clear ();
188
194
}
189
195
You can’t perform that action at this time.
0 commit comments