use of com.webpieces.http2parser.api.dto.lib.SettingsParameter in project webpieces by deanhiller.
the class RemoteSettingsManagement method applyRemoteSettings.
public void applyRemoteSettings(SettingsFrame settings) {
for (Http2Setting setting : settings.getSettings()) {
SettingsParameter key = setting.getKnownName();
if (key == null)
//TODO: forward unknown settings to clients
continue;
//unknown setting so skip it
apply(key, setting.getValue());
}
}
use of com.webpieces.http2parser.api.dto.lib.SettingsParameter in project webpieces by deanhiller.
the class SettingsMarshaller method validate.
private void validate(Http2Setting http2Setting) {
SettingsParameter key = SettingsParameter.lookup(http2Setting.getId());
long value = http2Setting.getValue();
if (key == null)
//unknown setting
return;
switch(key) {
case SETTINGS_ENABLE_PUSH:
if (value != 0 && value != 1)
throw new ConnectionException(CancelReasonCode.INVALID_SETTING, 0, "push setting must be 0 or 1 but was=" + value);
break;
case SETTINGS_INITIAL_WINDOW_SIZE:
validateWindowSize(value);
break;
case SETTINGS_MAX_FRAME_SIZE:
validateMaxFrameSize(value);
break;
case SETTINGS_HEADER_TABLE_SIZE:
case SETTINGS_MAX_CONCURRENT_STREAMS:
case SETTINGS_MAX_HEADER_LIST_SIZE:
break;
default:
throw new IllegalArgumentException("case statement missing new setting=" + key + " with value=" + value);
}
}
Aggregations