Improve regular (non-image) file transfer via frisbee.
Basically, make it possible to transfer a non imagezip image. Previously you had to wrap a regular file as an image in order to transfer it. The big hang up was that the frisbee protocol could only transfer files that were a multiple of 1MB (the chunk size). This commit changes the frisbee protocol slightly to allow transfer of non-1MB-multiple files. The protocol change was to add a new JOIN message that returns the size of the file in bytes rather than in blocks. This allows the client to know that the file in question is not a multiple of 1MB and allows it to request the correct partial number of blocks for the final chunk and to extract the correct amount of data from the final 1K block (that block is still padded to 1K by the server). For the server side, the request mostly allows it to do some sanity checking. The fact that the server is started with a file that is not a multiple of 1MB is what triggers it to know about partial chunks. The sanity checking is that the server will not acknowledge clients that attempt to join with a version 1 JOIN message, since nothing good would come of that pairing. On the client side, frisbee must be invoked with the -N (nodecompress) option in order to issue a v2 JOIN. See the comment in the code for the rationale, but it is largely a backward compat feature. While I was changing the JOIN message, I added a couple of other future features. One is that by passing back a 64-bit value for the size of the image in bytes, we can feed bigger images. However there is still much to be done to realize this. The other was to add blocksize/chunksize fields in the message so that the server/client can negotiate the transfer parameters, e.g., 1024 blocks of 1024 bytes vs. 256 blocks of 8192 bytes, the latter being for "jumbo" packets on a Gb ethernet. But there is still more to be done to get this working too.
Showing with 421 additions and 123 deletions