Remove explicit socket buffer locks in remote block stream handles

This commit is contained in:
axd1x8a
2026-06-26 01:53:22 +03:00
committed by ghidra1
parent c0f584bf22
commit 971bad82b2
3 changed files with 2 additions and 16 deletions

View File

@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -133,14 +133,6 @@ public abstract class RemoteBlockStreamHandle<T extends BlockStream> implements
return blockSize;
}
/**
* Get the preferred socket send/receive buffer size to be used
* @return preferred socket send/receive buffer size
*/
protected int getPreferredBufferSize() {
return (getBlockSize() + 4) * 12;
}
/**
* Generate a random number for use as a block stream authentication token.
* @return random value

View File

@@ -124,7 +124,6 @@ public class RemoteInputBlockStreamHandle extends RemoteBlockStreamHandle<InputB
public InputBlockStream openBlockStream() throws IOException {
Socket socket = connect();
socket.setReceiveBufferSize(getPreferredBufferSize());
return new ClientInputBlockStream(socket);
}
@@ -135,8 +134,6 @@ public class RemoteInputBlockStreamHandle extends RemoteBlockStreamHandle<InputB
throw new IllegalArgumentException("expected InputBlockStream");
}
socket.setSendBufferSize(getPreferredBufferSize());
InputBlockStream inputBlockStream = (InputBlockStream) blockStream;
try (OutputStream out = getBlockInputStream(socket)) {

View File

@@ -109,7 +109,6 @@ public class RemoteOutputBlockStreamHandle extends RemoteBlockStreamHandle<Outpu
public OutputBlockStream openBlockStream() throws IOException {
Socket socket = connect();
socket.setSendBufferSize(getPreferredBufferSize());
return new ClientOutputBlockStream(socket);
}
@@ -121,8 +120,6 @@ public class RemoteOutputBlockStreamHandle extends RemoteBlockStreamHandle<Outpu
throw new IllegalArgumentException("expected OutputBlockStream");
}
socket.setReceiveBufferSize(getPreferredBufferSize());
OutputBlockStream outputBlockStream = (OutputBlockStream) blockStream;
try (InputStream in = getBlockInputStream(socket)) {