From 5df170f98299ab34cedbf35b7ecdc43cab4a23e3 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 24 May 2019 19:33:50 +0100 Subject: [PATCH] write the number of results before the results --- core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy index 5c3d674d..f58c1198 100644 --- a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy +++ b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy @@ -71,6 +71,7 @@ class ResultsSender { DataOutputStream os = new DataOutputStream(endpoint.getOutputStream()) os.write("POST $uuid\r\n".getBytes(StandardCharsets.US_ASCII)) me.write(os) + os.writeShort((short)results.length) results.each { byte [] name = it.getFile().getName().getBytes(StandardCharsets.UTF_8) def baos = new ByteArrayOutputStream()