mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
@@ -220,6 +220,7 @@ public class CreateBsimServerInfoDialog extends DialogComponentProvider {
|
||||
createDBNameField();
|
||||
createUserField();
|
||||
createHostField();
|
||||
|
||||
int defaultPort = -1;
|
||||
if (type == BSimServerInfo.DBType.postgres) {
|
||||
defaultPort = BSimServerInfo.DEFAULT_POSTGRES_PORT;
|
||||
|
||||
@@ -1143,6 +1143,7 @@ public class ElasticDatabase implements FunctionDatabase {
|
||||
String exeId, DescriptionManager manager, int maxDocuments) throws ElasticException {
|
||||
long total;
|
||||
long start = 0;
|
||||
long count = 0;
|
||||
do {
|
||||
int limit = MAX_FUNCTION_WINDOW;
|
||||
if (maxDocuments != 0 && maxDocuments - start < limit) {
|
||||
@@ -1161,6 +1162,7 @@ public class ElasticDatabase implements FunctionDatabase {
|
||||
doc = (JSONObject) element;
|
||||
FunctionDescription funcDesc = convertDescriptionRow(doc, exeRecord, manager, null);
|
||||
listFunctions.add(funcDesc);
|
||||
++count;
|
||||
}
|
||||
if (hitsarray.size() == 0) {
|
||||
break; // Shouldn't need this, but just in case
|
||||
@@ -1168,7 +1170,7 @@ public class ElasticDatabase implements FunctionDatabase {
|
||||
JSONArray sort = (JSONArray) doc.get("sort");
|
||||
start = (Long) sort.get(0); // Sort value for last entry, for passing as search_after parameter
|
||||
}
|
||||
while (total > start);
|
||||
while (total > count);
|
||||
return (int) total;
|
||||
}
|
||||
|
||||
@@ -1765,7 +1767,6 @@ public class ElasticDatabase implements FunctionDatabase {
|
||||
buffer.append(
|
||||
"{ \"script\": { \"inline\": \"if ((ctx._source.count -= params.count) <=0) { ctx.op = \\\"delete\\\" }\", ");
|
||||
buffer.append("\"params\": { \"count\": ").append(entry.count).append("} } }\n");
|
||||
maxVectors -= 1;
|
||||
}
|
||||
JSONObject resp = connection.executeBulk("/_bulk", buffer.toString());
|
||||
JSONArray items = (JSONArray) resp.get("items");
|
||||
|
||||
Reference in New Issue
Block a user