This commit is contained in:
binlaab
2026-04-30 12:31:11 +02:00
parent 72899acd74
commit b87b710c50
6 changed files with 125 additions and 4 deletions

View File

@@ -420,8 +420,17 @@ public class DirectoryConnector {
long filesize = -1;
String filehash = null;
FileInfo[] list = this.getFileList();
FileInfo[] foundFile = FileInfo.lookupHashSubstring(list, hashSubstring);
DirMessage requestDL = new DirMessage(DirMessageOps.OPERATION_REQUEST_DIRDL, hashSubstring);
byte[] requestBytes = requestDL.toString().getBytes();
byte[] response = sendAndReceiveDatagrams(requestBytes);
String respStr = new String(response, 0, response.length);
DirMessage respDL = DirMessage.fromString(respStr);
fileData = java.util.Base64.getDecoder().decode(respDL.getFiledata());
filename = respDL.getFilename();
filesize = respDL.getFileSize();
filehash = respDL.getHash();
// TODO: crear nuevo mensaje dirdl y requestdirdl
// similar a un mensaje peerdl