fix constructors and sending of profile header with hashlist request

dbus-notify
Zlatin Balevsky 2022-06-02 11:31:41 +01:00
parent eba41cdcf6
commit 9fbf6d1b5d
No known key found for this signature in database
GPG Key ID: A72832072D525E41
3 changed files with 6 additions and 4 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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()) {