serve: Make some error conditions non-fatal, test them.

We don't want flexnbd serve to fall over and die if the client sends an invalid request.
This commit is contained in:
nick
2013-02-15 16:51:28 +00:00
parent 63f7e3e8d4
commit 9b67d30608
7 changed files with 160 additions and 37 deletions

View File

@@ -8,6 +8,10 @@ class FileWriter
@pattern = ""
end
def size
@blocksize * @pattern.split("").size
end
# We write in fixed block sizes, given by "blocksize"
# _ means skip a block
# 0 means write a block full of zeroes