Compare commits
9 Commits
muwire-0.1
...
muwire-0.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c48df7f14b | ||
![]() |
9d04148001 | ||
![]() |
bb4d522572 | ||
![]() |
8052501e52 | ||
![]() |
66cc6d8ab7 | ||
![]() |
a45e57f5ec | ||
![]() |
7d8ca55d87 | ||
![]() |
de22f3c6b9 | ||
![]() |
3b0eb5678d |
@@ -34,7 +34,7 @@ class Cli {
|
|||||||
|
|
||||||
Core core
|
Core core
|
||||||
try {
|
try {
|
||||||
core = new Core(props, home, "0.1.6")
|
core = new Core(props, home, "0.1.9")
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
bad.printStackTrace(System.out)
|
bad.printStackTrace(System.out)
|
||||||
println "Failed to initialize core, exiting"
|
println "Failed to initialize core, exiting"
|
||||||
|
@@ -53,7 +53,7 @@ class CliDownloader {
|
|||||||
|
|
||||||
Core core
|
Core core
|
||||||
try {
|
try {
|
||||||
core = new Core(props, home, "0.1.6")
|
core = new Core(props, home, "0.1.9")
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
bad.printStackTrace(System.out)
|
bad.printStackTrace(System.out)
|
||||||
println "Failed to initialize core, exiting"
|
println "Failed to initialize core, exiting"
|
||||||
|
@@ -160,7 +160,7 @@ public class Core {
|
|||||||
eventBus.register(SearchEvent.class, fileManager)
|
eventBus.register(SearchEvent.class, fileManager)
|
||||||
|
|
||||||
log.info "initializing persistence service"
|
log.info "initializing persistence service"
|
||||||
persisterService = new PersisterService(new File(home, "files.json"), eventBus, 5000, fileManager)
|
persisterService = new PersisterService(new File(home, "files.json"), eventBus, 15000, fileManager)
|
||||||
|
|
||||||
log.info("initializing host cache")
|
log.info("initializing host cache")
|
||||||
File hostStorage = new File(home, "hosts.json")
|
File hostStorage = new File(home, "hosts.json")
|
||||||
@@ -260,7 +260,7 @@ public class Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core core = new Core(props, home, "0.1.6")
|
Core core = new Core(props, home, "0.1.9")
|
||||||
core.startServices()
|
core.startServices()
|
||||||
|
|
||||||
// ... at the end, sleep or execute script
|
// ... at the end, sleep or execute script
|
||||||
|
@@ -99,6 +99,7 @@ public class DownloadManager {
|
|||||||
}
|
}
|
||||||
def downloader = new Downloader(eventBus, this, me, file, (long)json.length,
|
def downloader = new Downloader(eventBus, this, me, file, (long)json.length,
|
||||||
infoHash, json.pieceSizePow2, connector, destinations, incompletes)
|
infoHash, json.pieceSizePow2, connector, destinations, incompletes)
|
||||||
|
downloaders.add(downloader)
|
||||||
downloader.download()
|
downloader.download()
|
||||||
eventBus.publish(new DownloadStartedEvent(downloader : downloader))
|
eventBus.publish(new DownloadStartedEvent(downloader : downloader))
|
||||||
}
|
}
|
||||||
|
@@ -239,9 +239,12 @@ public class Downloader {
|
|||||||
if (downloaded.isComplete() && !eventFired) {
|
if (downloaded.isComplete() && !eventFired) {
|
||||||
piecesFile.delete()
|
piecesFile.delete()
|
||||||
eventFired = true
|
eventFired = true
|
||||||
eventBus.publish(new FileDownloadedEvent(downloadedFile : new DownloadedFile(file, getInfoHash(), pieceSizePow2, Collections.emptySet())),
|
eventBus.publish(
|
||||||
downloader : Downloader.this)
|
new FileDownloadedEvent(
|
||||||
}
|
downloadedFile : new DownloadedFile(file, getInfoHash(), pieceSizePow2, Collections.emptySet()),
|
||||||
|
downloader : Downloader.this))
|
||||||
|
|
||||||
|
}
|
||||||
endpoint?.close()
|
endpoint?.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,12 +20,12 @@ class FileHasher {
|
|||||||
* @return the size of each piece in power of 2
|
* @return the size of each piece in power of 2
|
||||||
*/
|
*/
|
||||||
static int getPieceSize(long size) {
|
static int getPieceSize(long size) {
|
||||||
if (size <= 0x1 << 27)
|
if (size <= 0x1 << 30)
|
||||||
return 17
|
return 17
|
||||||
|
|
||||||
for (int i = 28; i <= 37; i++) {
|
for (int i = 31; i <= 37; i++) {
|
||||||
if (size <= 0x1L << i) {
|
if (size <= 0x1L << i) {
|
||||||
return i-10
|
return i-13
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -181,6 +181,8 @@ Search results are sent through and HTTP POST method from the responder to the o
|
|||||||
* The "altlocs" list contains list of alternate personas that the responder thinks may also have the file.
|
* The "altlocs" list contains list of alternate personas that the responder thinks may also have the file.
|
||||||
* The "pieceSize" field is the size of the each individual file piece (except possibly the last) in powers of 2
|
* The "pieceSize" field is the size of the each individual file piece (except possibly the last) in powers of 2
|
||||||
|
|
||||||
|
Results version 1 contain the full hashlist, version 2 does not contain that list. See the "infohash-upgrade" document for more information.
|
||||||
|
|
||||||
### "Who do you trust" query - any node to any node
|
### "Who do you trust" query - any node to any node
|
||||||
(See the "web-of-trust" document for more info on this query)
|
(See the "web-of-trust" document for more info on this query)
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
group = com.muwire
|
group = com.muwire
|
||||||
version = 0.1.6
|
version = 0.1.9
|
||||||
groovyVersion = 2.4.15
|
groovyVersion = 2.4.15
|
||||||
slf4jVersion = 1.7.25
|
slf4jVersion = 1.7.25
|
||||||
spockVersion = 1.1-groovy-2.4
|
spockVersion = 1.1-groovy-2.4
|
||||||
|
@@ -69,8 +69,13 @@ class Initialize extends AbstractLifecycleHandler {
|
|||||||
uiSettings = new UISettings(props)
|
uiSettings = new UISettings(props)
|
||||||
log.info "will try default lnfs"
|
log.info "will try default lnfs"
|
||||||
if (isMacOSX()) {
|
if (isMacOSX()) {
|
||||||
uiSettings.lnf = "nimbus"
|
if (SystemVersion.isJava9()) {
|
||||||
lookAndFeel('nimbus') // otherwise the file chooser doesn't open???
|
uiSettings.lnf = "metal"
|
||||||
|
lookAndFeel("metal")
|
||||||
|
} else {
|
||||||
|
uiSettings.lnf = "nimbus"
|
||||||
|
lookAndFeel('nimbus') // otherwise the file chooser doesn't open???
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LookAndFeel chosen = lookAndFeel('system', 'gtk')
|
LookAndFeel chosen = lookAndFeel('system', 'gtk')
|
||||||
uiSettings.lnf = chosen.name
|
uiSettings.lnf = chosen.name
|
||||||
|
Reference in New Issue
Block a user