Add file_digest in Response::Transfer.
This commit is contained in:
parent
31604fe857
commit
b72d54f19d
@ -56,8 +56,9 @@ end
|
||||
class FileStorage::Response
|
||||
JSONIPC.request Transfer, 40 do
|
||||
property mid : String
|
||||
property file_digest : String
|
||||
property n : Int32 # chunk number
|
||||
def initialize(@mid, @n)
|
||||
def initialize(@mid, @file_digest, @n)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -82,7 +82,8 @@ class FileStorage::Storage
|
||||
|
||||
# TODO: verify the digest, if no more chunks.
|
||||
|
||||
FileStorage::Response::Transfer.new mid, chunk_number
|
||||
digest = transfer_info.file_info.digest
|
||||
FileStorage::Response::Transfer.new mid, digest, chunk_number
|
||||
rescue e
|
||||
puts "Error handling transfer: #{e.message}"
|
||||
FileStorage::Response::Error.new mid.not_nil!, "Unexpected error: #{e.message}"
|
||||
|
Loading…
Reference in New Issue
Block a user