webfirmframework for Java Experts
BrowserPage buffer limit in wffweb-12
It is available since 12.0.0. It is enabled by default.
The
BrowserPage
uses a buffer to store data for its incoming and outgoing
payloads. Now we can limit it with
BrowserPage.Settings.inputBufferLimit
and
BrowserPage.Settings.outputBufferLimit
for its incoming and outgoing buffer resp. Lossless communication
should be enabled to fully enable this feature. Limiting the
buffer will prevent using unlimited memory for server and client
payloads.
browserPage.defaultSettings()
can be used to get a default value. To change its settings
override
useSettings
method in the subclass of
BrowserPage
.
getSettings
may be used to get the current settings (i.e. the applied settings by useSettings
method).
@Override
protected Settings useSettings() {
final int limit1MB = 1024 * 1024 * 1024;
final long timeout1Second = TimeUnit.SECONDS.toNanos(1);
final Settings newSettings = new Settings(
limit1MB, timeout1Second,
limit1MB, timeout1Second,
defaultSettings().onPayloadLoss());
return newSettings;
}