@Override
public WebSocketExtension accept(final WebSocketExtension extension) {
if (extension == null || !extension.getName().equals(getName())) return null;
WebSocketExtension negotiated = new WebSocketExtension(extension.getName());
if (extension.getParameters() == null || extension.getParameters().size() == 0) return negotiated;
for (WebSocketExtension.Parameter parameter : extension.getParameters()) {
if (parameter.getName().equals(SERVER_MAX_WINDOW_BITS)) {
/*
Not supported
*/
} else if (parameter.getName().equals(CLIENT_MAX_WINDOW_BITS)) {
/*
Not supported
*/
} else if (parameter.getName().equals(SERVER_NO_CONTEXT_TAKEOVER)) {
negotiated.getParameters().add(parameter);
if (client) {
decompressContextTakeover = false;
} else {
compressContextTakeover = false;
}
} else if (parameter.getName().equals(CLIENT_NO_CONTEXT_TAKEOVER)) {
negotiated.getParameters().add(parameter);
if (client) {
compressContextTakeover = false;
} else {
decompressContextTakeover = false;
}