mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
Replace code that updating the channel config low/high watermark with two calls conditionally in ConnectionBase by a single call updating both at the same time
This commit is contained in:
@@ -160,16 +160,7 @@ public abstract class ConnectionBase {
|
||||
|
||||
public void doSetWriteQueueMaxSize(int size) {
|
||||
ChannelConfig config = chctx.channel().config();
|
||||
int high = config.getWriteBufferHighWaterMark();
|
||||
int newLow = size / 2;
|
||||
int newHigh = size;
|
||||
if (newLow >= high) {
|
||||
config.setWriteBufferHighWaterMark(newHigh);
|
||||
config.setWriteBufferLowWaterMark(newLow);
|
||||
} else {
|
||||
config.setWriteBufferLowWaterMark(newLow);
|
||||
config.setWriteBufferHighWaterMark(newHigh);
|
||||
}
|
||||
config.setWriteBufferWaterMark(new WriteBufferWaterMark(size / 2, size));
|
||||
}
|
||||
|
||||
protected void checkContext() {
|
||||
|
||||
Reference in New Issue
Block a user