Skip to content

Commit cf2a605

Browse files
author
Marcelo Vanzin
committed
Clean up some code.
1 parent 8584323 commit cf2a605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

network/common/src/main/java/org/apache/spark/network/sasl/SaslEncryption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public long transferTo(final WritableByteChannel target, final long position)
196196
do {
197197
if (currentChunk == null) {
198198
nextChunk();
199-
currentHeader = Unpooled.copyLong(8 + currentChunkSize);
200199
}
201200

202201
if (currentHeader.readableBytes() > 0) {
@@ -236,6 +235,7 @@ private void nextChunk() throws IOException {
236235
byte[] encrypted = backend.wrap(byteChannel.getData(), 0, byteChannel.length());
237236
this.currentChunk = ByteBuffer.wrap(encrypted);
238237
this.currentChunkSize = encrypted.length;
238+
this.currentHeader = Unpooled.copyLong(8 + currentChunkSize);
239239
this.unencryptedChunkSize = byteChannel.length();
240240
}
241241

0 commit comments

Comments
 (0)