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 d2a40486..d1591c27 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy @@ -256,10 +256,10 @@ class ConnectionAcceptor { private void processBROWSE(Endpoint e) { try { - byte [] rowse = new byte[5] + byte [] rowse = new byte[7] DataInputStream dis = new DataInputStream(e.getInputStream()) dis.readFully(rowse) - if (rowse != "OWSE\r\n".getBytes(StandardCharsets.US_ASCII)) + if (rowse != "ROWSE\r\n".getBytes(StandardCharsets.US_ASCII)) throw new IOException("Invalid BROWSE connection") String header while ((header = DataUtil.readTillRN(dis)) != ""); // ignore headers for now diff --git a/core/src/main/groovy/com/muwire/core/search/BrowseManager.groovy b/core/src/main/groovy/com/muwire/core/search/BrowseManager.groovy index a5fccf7f..88fa1e83 100644 --- a/core/src/main/groovy/com/muwire/core/search/BrowseManager.groovy +++ b/core/src/main/groovy/com/muwire/core/search/BrowseManager.groovy @@ -7,11 +7,14 @@ import com.muwire.core.connection.I2PConnector import com.muwire.core.util.DataUtil import groovy.json.JsonSlurper +import groovy.util.logging.Log import java.nio.charset.StandardCharsets import java.util.concurrent.Executor import java.util.concurrent.Executors +import java.util.logging.Level +@Log class BrowseManager { private final I2PConnector connector @@ -73,6 +76,7 @@ class BrowseManager { eventBus.publish(new BrowseStatusEvent(status : BrowseStatus.FINISHED)) } catch (Exception bad) { + log.log(Level.WARNING, "browse failed", bad) eventBus.publish(new BrowseStatusEvent(status : BrowseStatus.FAILED)) } finally { endpoint?.close()