From bb4f0e6a40f4f8273bdec4f240d06de683e5b4ff Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 7 Dec 2023 16:00:49 +0100 Subject: [PATCH] Rename method to be more consistent Motivation: We should rename the method and remove the "Now" suffix to be more consistent with other methods. Modifications: Rename method Result: Cleanup --- .../java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java | 2 +- .../incubator/codec/ohttp/OHttpRequestResponseContext.java | 4 ++-- .../java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java index 6a38e92..17ca4d8 100644 --- a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java +++ b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java @@ -331,7 +331,7 @@ protected void decryptChunk(ByteBuf chunk, int chunkLength, boolean isFinal, Byt } @Override - public void encodePrefixNow(ByteBuf out) { + public void encodePrefix(ByteBuf out) { sender.writeHeader(out); } diff --git a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpRequestResponseContext.java b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpRequestResponseContext.java index 407ef69..33cd90a 100644 --- a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpRequestResponseContext.java +++ b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpRequestResponseContext.java @@ -71,7 +71,7 @@ protected abstract void encryptChunk(ByteBuf chunk, int chunkLength, boolean isF * @param out buffer to write the bytes. * @throws CryptoException if the prefix cannot be encoded. */ - protected abstract void encodePrefixNow(ByteBuf out) throws CryptoException; + protected abstract void encodePrefix(ByteBuf out) throws CryptoException; private final class ContentEncoder implements OHttpChunkFramer.Encoder { @@ -101,7 +101,7 @@ public void encodePrefix(ByteBuf out) throws CryptoException { if (encodedPrefix) { throw new IllegalStateException("Prefix already encoded"); } - encodePrefixNow(out); + OHttpRequestResponseContext.this.encodePrefix(out); encodedPrefix = true; } } diff --git a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java index ceedd4c..7121777 100644 --- a/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java +++ b/codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java @@ -277,7 +277,7 @@ protected void decryptChunk(ByteBuf chunk, int chunkSize, boolean isFinal, ByteB @Override - public void encodePrefixNow(ByteBuf out) throws CryptoException { + public void encodePrefix(ByteBuf out) throws CryptoException { checkPrefixDecoded(); receiver.writeResponseNonce(out); }