diff --git a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy index 4fbb53d6..4a33d05c 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy @@ -182,9 +182,9 @@ class ConnectionAcceptor { if (!searchManager.hasLocalSearch(resultsUUID)) throw new UnexpectedResultsException(resultsUUID.toString()) - byte[] rn = new byte[2] + byte[] rn = new byte[4] dis.readFully(rn) - if (rn != "\r\n".getBytes(StandardCharsets.US_ASCII)) + if (rn != "\r\n\r\n".getBytes(StandardCharsets.US_ASCII)) throw new IOException("invalid request header") Persona sender = new Persona(dis) 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 31359679..9e7ab3d2 100644 --- a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy +++ b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy @@ -77,7 +77,7 @@ class ResultsSender { try { endpoint = connector.connect(target) DataOutputStream os = new DataOutputStream(endpoint.getOutputStream()) - os.write("POST $uuid\r\n".getBytes(StandardCharsets.US_ASCII)) + os.write("POST $uuid\r\n\r\n".getBytes(StandardCharsets.US_ASCII)) me.write(os) os.writeShort((short)results.length) results.each {