mirror of https://github.com/zlatinb/muwire
wip on browse host
parent
8850d49c63
commit
94340480b4
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue