If we use last_block_size = file % block_count the final block will have a maximum size of block_count, so if we have 40 blocks for 39k + 2 byte file then we have 39 1k blocks and a trailing block of size 2 bytes. Another option is simply to drop the trailing blocks and they will always be returned as a literal.<br>
<br>Feel free to correct my maths if I am missing something...<br><br>Toby<br><br><div class="gmail_quote">2009/11/2 Rusty Russell <span dir="ltr"><<a href="mailto:rusty@rustcorp.com.au">rusty@rustcorp.com.au</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Thu, 29 Oct 2009 06:11:53 am Toby Collett wrote:<br>
> The current version in git now implements the standard document completely<br>
> as far as I am aware (doc is available from git<br>
> <a href="http://repo.or.cz/w/httpd-crcsyncproxy.git?a=tree;f=crccache/doc;h=37d90acd37bb0199a37e6d6a779c37c4f37da29b;hb=HEAD" target="_blank">http://repo.or.cz/w/httpd-crcsyncproxy.git?a=tree;f=crccache/doc;h=37d90acd37bb0199a37e6d6a779c37c4f37da29b;hb=HEAD</a>)<br>
><br>
> So now we need some testing, not sure the best way to do this, Martin, do<br>
> you want to set up access to a server?<br>
><br>
> Rusty: There was an assertion that tailsize be < block-size in the crc code.<br>
> The latest version has tail_size = blocksize + remainder. It seems to work<br>
> when that assertion is removed and I couldnt see any reason why it can't be<br>
> greater in the current implementation. Could you confirm?<br>
<br>
</div>There's no real reason, but it seems wrong. if tailsize > blocksize, why<br>
isn't there simply one more block?<br>
<br>
Cheers,<br>
Rusty (who hasn't really been paying any attention)<br>
</blockquote></div><br>