gokrazy / rsync

gokrazy rsync
BSD 3-Clause "New" or "Revised" License
510 stars 32 forks source link

build_hash_table seems not point to the first entry #25

Closed guodoliu closed 1 year ago

guodoliu commented 1 year ago

// “A 16 bit index table is then formed which takes a 16 bit hash // value and gives an index into the sorted signature table which // points to the first entry in the table which has a matching // hash.” for idx := range head.Sums { tagTable[targets[idx].tag] = idx }

here the latter will overwrite the previous value

stapelberg commented 1 year ago

Thanks for the hint. This is changed with commit https://github.com/gokrazy/rsync/commit/197246cdaa697ce55d511dd99491a2cc1465ef18 now.

Newer versions of rsync seem to use a dynamically allocated hash table with 32 bit keys.