From f7a2848c7bdba04d7ce978322ff868c802fe1a72 Mon Sep 17 00:00:00 2001 From: Michael Pilquist Date: Sat, 20 Feb 2021 09:40:00 -0500 Subject: [PATCH] Scalafmt --- io/src/main/scala/fs2/io/tls/TLSEngine.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/io/src/main/scala/fs2/io/tls/TLSEngine.scala b/io/src/main/scala/fs2/io/tls/TLSEngine.scala index 3f79268579..73a3d736c0 100644 --- a/io/src/main/scala/fs2/io/tls/TLSEngine.scala +++ b/io/src/main/scala/fs2/io/tls/TLSEngine.scala @@ -130,10 +130,12 @@ private[tls] object TLSEngine { // Check if the initial handshake has finished -- if so, read; otherwise, handshake and then read dequeueUnwrap(maxBytes).flatMap { out => if (out.isEmpty) - initialHandshakeDone.ifM(read1(maxBytes, timeout), + initialHandshakeDone.ifM( + read1(maxBytes, timeout), write(Chunk.empty, None) >> dequeueUnwrap(maxBytes).flatMap { out => if (out.isEmpty) read1(maxBytes, timeout) else Applicative[F].pure(out) - }) + } + ) else Applicative[F].pure(out) } @@ -209,7 +211,10 @@ private[tls] object TLSEngine { else binding.read(engine.getSession.getPacketBufferSize, timeout).flatMap { case Some(c) => unwrapBuffer.input(c) >> unwrapHandshake(timeout) - case None => unwrapBuffer.inputRemains.flatMap(x => if (x > 0) Applicative[F].unit else stopUnwrap) + case None => + unwrapBuffer.inputRemains.flatMap(x => + if (x > 0) Applicative[F].unit else stopUnwrap + ) } } case SSLEngineResult.HandshakeStatus.NEED_UNWRAP_AGAIN =>