[Http-crcsync] crccache ready for some testing I think

Alex Wulms alex.wulms at scarlet.be
Tue Mar 31 04:40:02 EDT 2009


Op dinsdag 31 maart 2009, schreef Rusty Russell:
> On Tuesday 31 March 2009 14:55:05 Rusty Russell wrote:
> > For that, you need this as well:
>
> (At this point, note that this is all available via
>  bzr clone http://ccan.ozlabs.org/repo )
>
> And to fix the actual output (I turned your test.c into a ccan testcase
> and manually calculated what it should show), you need this patch.
>
> BTW, what licence for test.c?
The same as you use for libcrc itself. Otherwise it becomes too confusing if 
people have to deal with multiple licenses for the library and it's test 
cases.



>
> === modified file 'ccan/crcsync/crcsync.c'
> --- ccan/crcsync/crcsync.c	2009-03-31 04:05:04 +0000
> +++ ccan/crcsync/crcsync.c	2009-03-31 05:01:46 +0000
> @@ -206,7 +210,9 @@
>  			ctx->buffer_end -= ctx->buffer_start;
>  			ctx->buffer_start = 0;
>  		}
> -		memcpy(ctx->buffer + ctx->buffer_end, buf, len);
> +
> +		/* Copy len bytes from tail of buffer. */
> +		memcpy(ctx->buffer + ctx->buffer_end, buf + buflen - len, len);
>  		ctx->buffer_end += len;
>  		assert(buffer_size(ctx) <= ctx->block_size);
>  	}




More information about the Http-crcsync mailing list