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">&lt;<a href="mailto:rusty@rustcorp.com.au">rusty@rustcorp.com.au</a>&gt;</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>
&gt; The current version in git now implements the standard document completely<br>
&gt; as far as I am aware (doc is available from git<br>
&gt; <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>

&gt;<br>
&gt; So now we need some testing, not sure the best way to do this, Martin, do<br>
&gt; you want to set up access to a server?<br>
&gt;<br>
&gt; Rusty: There was an assertion that tailsize be &lt; block-size in the crc code.<br>
&gt; The latest version has tail_size = blocksize + remainder. It seems to work<br>
&gt; when that assertion is removed and I couldnt see any reason why it can&#39;t be<br>
&gt; greater in the current implementation. Could you confirm?<br>
<br>
</div>There&#39;s no real reason, but it seems wrong.  if tailsize &gt; blocksize, why<br>
isn&#39;t there simply one more block?<br>
<br>
Cheers,<br>
Rusty (who hasn&#39;t really been paying any attention)<br>
</blockquote></div><br>