Skip to content

Commit 31270f2

Browse files
committed
convert to block comment
1 parent 1564b49 commit 31270f2

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/main/java/software/amazon/encryption/s3/internal/CipherSubscriber.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,25 @@ public void onNext(ByteBuffer byteBuffer) {
6565
// send an empty buffer to the wrapped subscriber.
6666
wrappedSubscriber.onNext(ByteBuffer.allocate(0));
6767
} else {
68-
// Check if stream has read all expected content.
69-
// Once all content has been read, call onComplete.
70-
//
71-
// This class determines that all content has been read by checking if
72-
// the amount of data read so far plus the tag length is at least the content length.
73-
// Once this is true, downstream will never call `request` again
74-
// (beyond the current request that is being responded to in this onNext invocation.)
75-
// As a result, this class can only call `wrappedSubscriber.onNext` one more time.
76-
// (Reactive streams require that downstream sends a `request(n)`
77-
// to indicate it is ready for more data, and upstream responds to that request by calling `onNext`.
78-
// The `n` in request is the maximum number of `onNext` calls that downstream
79-
// will allow upstream to make, and seems to always be 1 for the AsyncBodySubscriber.)
80-
// Since this class can only call `wrappedSubscriber.onNext` once,
81-
// it must send all remaining data in the next onNext call,
82-
// including the result of cipher.doFinal(), if applicable.
83-
// Calling `wrappedSubscriber.onNext` more than once for `request(1)`
84-
// violates the Reactive Streams specification and can cause exceptions downstream.
68+
/*
69+
Check if stream has read all expected content.
70+
Once all content has been read, call onComplete.
71+
72+
This determines that all content has been read by checking if
73+
the amount of data read so far plus the tag length is at least the content length.
74+
Once this is true, downstream will never call `request` again
75+
(beyond the current request that is being responded to in this onNext invocation.)
76+
As a result, this class can only call `wrappedSubscriber.onNext` one more time.
77+
(Reactive streams require that downstream sends a `request(n)`
78+
to indicate it is ready for more data, and upstream responds to that request by calling `onNext`.
79+
The `n` in request is the maximum number of `onNext` calls that downstream
80+
will allow upstream to make, and seems to always be 1 for the AsyncBodySubscriber.)
81+
Since this class can only call `wrappedSubscriber.onNext` once,
82+
it must send all remaining data in the next onNext call,
83+
including the result of cipher.doFinal(), if applicable.
84+
Calling `wrappedSubscriber.onNext` more than once for `request(1)`
85+
violates the Reactive Streams specification and can cause exceptions downstream.
86+
*/
8587
if (contentRead.get() + tagLength >= contentLength) {
8688
// All content has been read; complete the stream.
8789
// (Signalling onComplete from here is Reactive Streams-spec compliant;

0 commit comments

Comments
 (0)