mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-07-30 07:18:37 -09:00
Remove explicit socket buffer locks in remote block stream handles
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user