couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <kocol...@apache.org>
Subject Re: svn commit: r811709 - in /couchdb/trunk/src/couchdb: couch_config.erl couch_httpd_auth.erl couch_rep.erl
Date Sun, 06 Sep 2009 19:04:37 GMT
On Sep 5, 2009, at 4:37 PM, jan@apache.org wrote:

> -compare_rep_history(S, T) when length(S) =:= 0 orelse length(T) =:=  
> 0 ->
> +compare_rep_history([], []) ->

Hi Jan, this patch isn't quite right and can crash the replicator.   
The old version checked if _either_ list was empty and aborted the  
comparison; the new version requires that _both_ are empty.  If the  
histories have different lengths we'll get a badmatch in the next clause

> compare_rep_history([{S}|SourceRest], [{T}|TargetRest]=Target) ->

I think what you wanted was

> compare_rep_history(S, T) when S =:= [] orelse T =:= [] ->

Best, Adam

Mime
View raw message