From f13db3e8ee38ea212dd1d7502d0604726021f44f Mon Sep 17 00:00:00 2001
From: Markus Himmel <markus@himmel-villmar.de>
Date: Fri, 26 Dec 2014 00:07:56 +0000
Subject: [PATCH] Update to the interface of librsync v.1.0.0

Librsync has moved away from MD4 for signatures, but to maintain
compatibility with non-Haiku versions, we hang on to it.
---
 src/backup_phase2_server.c | 2 +-
 src/backup_phase4_server.c | 2 +-
 src/rs_buf.c               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backup_phase2_server.c b/src/backup_phase2_server.c
index 6e78515..747a369 100644
--- a/src/backup_phase2_server.c
+++ b/src/backup_phase2_server.c
@@ -483,7 +483,7 @@ static int process_changed_file(struct sbuf *cb, struct sbuf *p1b, const char *c
 	free(curpath);
 
 	blocklen=get_librsync_block_len(cb->endfile);
-	if(!(p1b->sigjob=rs_sig_begin(blocklen, RS_DEFAULT_STRONG_LEN)))
+	if(!(p1b->sigjob=rs_sig_begin(blocklen, 8, RS_MD4_SIG_MAGIC)))
 	{
 		logp("could not start signature job.\n");
 		return -1;
diff --git a/src/backup_phase4_server.c b/src/backup_phase4_server.c
index ead92b3..f1b5a84 100644
--- a/src/backup_phase4_server.c
+++ b/src/backup_phase4_server.c
@@ -38,7 +38,7 @@ static int make_rev_sig(const char *dst, const char *sig, const char *endfile, i
 	}
 	result=rs_sig_gzfile(dstfp, dstzp, sigp,
 		get_librsync_block_len(endfile),
-		RS_DEFAULT_STRONG_LEN, NULL, cntr);
+		8, NULL, cntr);
 	gzclose_fp(&dstzp);
 	close_fp(&dstfp);
 	if(close_fp(&sigp))
diff --git a/src/rs_buf.c b/src/rs_buf.c
index 78f65b2..0a3c33a 100644
--- a/src/rs_buf.c
+++ b/src/rs_buf.c
@@ -497,7 +497,7 @@ rs_result rs_sig_gzfile(FILE *old_file, gzFile old_zfile, FILE *sig_file, size_t
     rs_job_t        *job;
     rs_result       r;
 
-    job = rs_sig_begin(new_block_len, strong_len);
+    job = rs_sig_begin(new_block_len, strong_len, RS_MD4_SIG_MAGIC);
     r = rs_whole_gzrun(job, old_file, old_zfile, sig_file, NULL, cntr);
 /*
     if (stats)
-- 
1.8.3.4

