Add chunk number to Response::Transfer.

This commit is contained in:
Karchnu 2020-05-20 09:28:06 +02:00
parent 3c7a2eb8f7
commit 31604fe857
2 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,8 @@ end
class FileStorage::Response
JSONIPC.request Transfer, 40 do
property mid : String
def initialize(@mid)
property n : Int32 # chunk number
def initialize(@mid, @n)
end
end
end

View File

@ -82,7 +82,7 @@ class FileStorage::Storage
# TODO: verify the digest, if no more chunks.
FileStorage::Response::Transfer.new mid
FileStorage::Response::Transfer.new mid, chunk_number
rescue e
puts "Error handling transfer: #{e.message}"
FileStorage::Response::Error.new mid.not_nil!, "Unexpected error: #{e.message}"