mirror of https://github.com/zlatinb/muwire
fix constructors and sending of profile header with hashlist request
parent
eba41cdcf6
commit
9fbf6d1b5d
|
@ -142,7 +142,8 @@ public class DownloadManager {
|
|||
incompletes.mkdirs()
|
||||
|
||||
Pieces pieces = getPieces(infoHash, size, pieceSize, sequential)
|
||||
downloader = new NetworkDownloader(eventBus, this, chatServer, me, target, toShare, size,
|
||||
downloader = new NetworkDownloader(eventBus, this, chatServer, me, profileSupplier,
|
||||
target, toShare, size,
|
||||
infoHash, collectionInfoHash, pieceSize, connector, destinations,
|
||||
incompletes, pieces, muSettings.downloadMaxFailures)
|
||||
}
|
||||
|
@ -221,7 +222,7 @@ public class DownloadManager {
|
|||
|
||||
Pieces pieces = getPieces(infoHash, (long)json.length, json.pieceSizePow2, sequential)
|
||||
|
||||
downloader = new NetworkDownloader(eventBus, this, chatServer, me, file, toShare, (long)json.length,
|
||||
downloader = new NetworkDownloader(eventBus, this, chatServer, me, profileSupplier, file, toShare, (long)json.length,
|
||||
infoHash, collectionInfoHash, json.pieceSizePow2, connector, destinations, incompletes, pieces, muSettings.downloadMaxFailures)
|
||||
downloader.successfulDestinations.addAll(destinations) // if it was persisted, it was successful
|
||||
downloader.readPieces()
|
||||
|
|
|
@ -39,9 +39,10 @@ class HashListSession {
|
|||
|
||||
String root = Base64.encode(infoHash.getRoot())
|
||||
os.write("HASHLIST $root\r\n".getBytes(StandardCharsets.US_ASCII))
|
||||
os.write("X-Persona: $meB64\r\n\r\n".getBytes(StandardCharsets.US_ASCII))
|
||||
os.write("X-Persona: $meB64\r\n".getBytes(StandardCharsets.US_ASCII))
|
||||
if (profile != null)
|
||||
os.write("ProfileHeader: ${profile.getHeader().toBase64()}\r\n".getBytes(StandardCharsets.US_ASCII))
|
||||
os.write("\r\n".getBytes(StandardCharsets.US_ASCII))
|
||||
os.flush()
|
||||
|
||||
String code = readTillRN(is)
|
||||
|
|
|
@ -428,7 +428,7 @@ class NetworkDownloader extends Downloader {
|
|||
endpoint.getOutputStream().flush()
|
||||
}
|
||||
available.removeAll(queuedPieces)
|
||||
def nextSession = new DownloadSession(eventBus, me.toBase64(), pieces, infoHash,
|
||||
def nextSession = new DownloadSession(eventBus, me.toBase64(), null, pieces, infoHash,
|
||||
endpoint, incompleteFile, pieceSize, length, available, dataSinceLastRead,
|
||||
browse, feed, chat, message)
|
||||
if (nextSession.sendRequest()) {
|
||||
|
|
Loading…
Reference in New Issue