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