mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-25 17:00:36 -09:00
Merge remote-tracking branch 'origin/GP-6915_ghidra1_GhidraServerDataCompressionEnablement' into patch
This commit is contained in:
@@ -33,7 +33,7 @@ public class DataBuffer implements Buffer, Externalizable {
|
||||
"db.buffers.DataBuffer.compressedOutput";
|
||||
|
||||
private static boolean enableCompressedSerializationOutput =
|
||||
Boolean.parseBoolean(System.getProperty(COMPRESSED_SERIAL_OUTPUT_PROPERTY, "false"));
|
||||
Boolean.parseBoolean(System.getProperty(COMPRESSED_SERIAL_OUTPUT_PROPERTY, "true"));
|
||||
|
||||
public static void enableCompressedSerializationOutput(boolean enable) {
|
||||
System.setProperty(COMPRESSED_SERIAL_OUTPUT_PROPERTY, Boolean.toString(enable));
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -15,12 +15,13 @@
|
||||
*/
|
||||
package db.buffers;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import generic.test.AbstractGenericTest;
|
||||
@@ -35,6 +36,12 @@ public class DataBufferTest extends AbstractGenericTest {
|
||||
super();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
// restore default compression: enabled
|
||||
DataBuffer.enableCompressedSerializationOutput(true);
|
||||
}
|
||||
|
||||
private void transferData(boolean useRandomFill) throws Exception {
|
||||
|
||||
for (int k = 0; k < 20; k++) {
|
||||
|
||||
@@ -95,9 +95,9 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
||||
private static final String SHOW_TOOLTIPS_OPTION_NAME = "Show Tooltips";
|
||||
private static final String BLINKING_CURSORS_OPTION_NAME = "Allow Blinking Cursors";
|
||||
|
||||
// TODO: Experimental Option !!
|
||||
private static final String ENABLE_COMPRESSED_DATABUFFER_OUTPUT =
|
||||
"Use DataBuffer Output Compression";
|
||||
private static final Boolean ENABLE_COMPRESSED_DATABUFFER_OUTPUT_DEFAULT = true;
|
||||
|
||||
private static final String RESTORE_PREVIOUS_PROJECT_NAME = "Restore Previous Project";
|
||||
private boolean shouldRestorePreviousProject;
|
||||
@@ -356,7 +356,8 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
||||
|
||||
options.registerOption(SHOW_TOOLTIPS_OPTION_NAME, true, help,
|
||||
"Controls the display of tooltip popup windows.");
|
||||
options.registerOption(ENABLE_COMPRESSED_DATABUFFER_OUTPUT, false, help,
|
||||
options.registerOption(ENABLE_COMPRESSED_DATABUFFER_OUTPUT,
|
||||
ENABLE_COMPRESSED_DATABUFFER_OUTPUT_DEFAULT, help,
|
||||
"When enabled data buffers sent to Ghidra Server are compressed (see server " +
|
||||
"configuration for other direction)");
|
||||
|
||||
@@ -381,7 +382,8 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
||||
DockingUtils.setGlobalTooltipEnabledOption(showToolTips);
|
||||
|
||||
boolean compressDataBuffers =
|
||||
options.getBoolean(ENABLE_COMPRESSED_DATABUFFER_OUTPUT, false);
|
||||
options.getBoolean(ENABLE_COMPRESSED_DATABUFFER_OUTPUT,
|
||||
ENABLE_COMPRESSED_DATABUFFER_OUTPUT_DEFAULT);
|
||||
DataBuffer.enableCompressedSerializationOutput(compressDataBuffers);
|
||||
|
||||
shouldRestorePreviousProject = options.getBoolean(RESTORE_PREVIOUS_PROJECT_NAME, true);
|
||||
|
||||
Reference in New Issue
Block a user