Http2ConnectionDecoder remove localSettings setter method

Motivation:
Http2ConnectionDecoder#localSettings(Http2Settings) is not used in codec-http2 and currently results in duplicated code.

Modifications:
- Remove Http2ConnectionDecoder#localSettings(Http2Settings)

Result:
Smaller interface and less duplicated code.
This commit is contained in:
Scott Mitchell 2016-08-09 13:55:43 -07:00
parent 129aee8a92
commit a4ad68239e
3 changed files with 0 additions and 50 deletions

View File

@ -68,11 +68,6 @@ public class DecoratingHttp2ConnectionDecoder implements Http2ConnectionDecoder
return delegate.localSettings();
}
@Override
public void localSettings(Http2Settings settings) throws Http2Exception {
delegate.localSettings(settings);
}
@Override
public boolean prefaceReceived() {
return delegate.prefaceReceived();

View File

@ -131,46 +131,6 @@ public class DefaultHttp2ConnectionDecoder implements Http2ConnectionDecoder {
return settings;
}
@Override
public void localSettings(Http2Settings settings) throws Http2Exception {
Boolean pushEnabled = settings.pushEnabled();
Http2FrameReader.Configuration config = frameReader.configuration();
Http2HeaderTable inboundHeaderTable = config.headerTable();
Http2FrameSizePolicy inboundFrameSizePolicy = config.frameSizePolicy();
if (pushEnabled != null) {
if (connection.isServer()) {
throw connectionError(PROTOCOL_ERROR, "Server sending SETTINGS frame with ENABLE_PUSH specified");
}
connection.local().allowPushTo(pushEnabled);
}
Long maxConcurrentStreams = settings.maxConcurrentStreams();
if (maxConcurrentStreams != null) {
int value = (int) Math.min(maxConcurrentStreams, Integer.MAX_VALUE);
connection.remote().maxActiveStreams(value);
}
Long headerTableSize = settings.headerTableSize();
if (headerTableSize != null) {
inboundHeaderTable.maxHeaderTableSize((int) Math.min(headerTableSize, Integer.MAX_VALUE));
}
Integer maxHeaderListSize = settings.maxHeaderListSize();
if (maxHeaderListSize != null) {
inboundHeaderTable.maxHeaderListSize(maxHeaderListSize);
}
Integer maxFrameSize = settings.maxFrameSize();
if (maxFrameSize != null) {
inboundFrameSizePolicy.maxFrameSize(maxFrameSize);
}
Integer initialWindowSize = settings.initialWindowSize();
if (initialWindowSize != null) {
flowController().initialWindowSize(initialWindowSize);
}
}
@Override
public void close() {
frameReader.close();

View File

@ -67,11 +67,6 @@ public interface Http2ConnectionDecoder extends Closeable {
*/
Http2Settings localSettings();
/**
* Sets the local settings for this endpoint of the HTTP/2 connection.
*/
void localSettings(Http2Settings settings) throws Http2Exception;
/**
* Indicates whether or not the first initial {@code SETTINGS} frame was received from the remote endpoint.
*/