Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jul 2020 14:06:29 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r542134 - in head/net/syncthing: . files
Message-ID:  <202007131406.06DE6TR1064687@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Mon Jul 13 14:06:28 2020
New Revision: 542134
URL: https://svnweb.freebsd.org/changeset/ports/542134

Log:
  net/syncthing: add patch to fix issue 6827
  
  https://github.com/syncthing/syncthing/issues/6827

Added:
  head/net/syncthing/files/patch-171.diff   (contents, props changed)
Modified:
  head/net/syncthing/Makefile   (contents, props changed)

Modified: head/net/syncthing/Makefile
==============================================================================
--- head/net/syncthing/Makefile	Mon Jul 13 14:05:03 2020	(r542133)
+++ head/net/syncthing/Makefile	Mon Jul 13 14:06:28 2020	(r542134)
@@ -2,6 +2,7 @@
 
 PORTNAME=	syncthing
 PORTVERSION=	1.7.0
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	net
 MASTER_SITES=	https://github.com/syncthing/syncthing/releases/download/v${PORTVERSION}/

Added: head/net/syncthing/files/patch-171.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/syncthing/files/patch-171.diff	Mon Jul 13 14:06:28 2020	(r542134)
@@ -0,0 +1,20 @@
+--- syncthing/lib/scanner/blocks.go.orig
++++ syncthing/lib/scanner/blocks.go
+@@ -108,12 +108,12 @@ func Blocks(ctx context.Context, r io.Reader, blocksize int, sizehint int64, cou
+ 	return blocks, nil
+ }
+ 
+-// Validate quickly validates buf against the cryptohash hash (if len(hash)>0)
+-// and the 32-bit hash weakHash (if not zero). It is satisfied if either hash
+-// matches, or neither is given.
++// Validate quickly validates buf against the 32-bit weakHash, if not zero,
++// else against the cryptohash hash, if len(hash)>0. It is satisfied if
++// either hash matches or neither hash is given.
+ func Validate(buf, hash []byte, weakHash uint32) bool {
+-	if weakHash != 0 {
+-		return adler32.Checksum(buf) == weakHash
++	if weakHash != 0 && adler32.Checksum(buf) == weakHash {
++		return true
+ 	}
+ 
+ 	if len(hash) > 0 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007131406.06DE6TR1064687>