summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorAtousa Pahlevan Duprat <apahlevan@ieee.org>2015-11-05 06:38:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-11-05 18:35:11 (GMT)
commit001fd7a90b5851f62e700510729a5e09706f9b63 (patch)
tree125503b4986b65ef3da657d506a4adb2ec1add8c /cache.h
parent3bc72fde3f35b988c902abf5a0bc027f2e54d0c1 (diff)
downloadgit-001fd7a90b5851f62e700510729a5e09706f9b63.zip
git-001fd7a90b5851f62e700510729a5e09706f9b63.tar.gz
git-001fd7a90b5851f62e700510729a5e09706f9b63.tar.bz2
sha1: allow limiting the size of the data passed to SHA1_Update()
Using the previous commit's inredirection mechanism for SHA1, support a chunked implementation of SHA1_Update() that limits the amount of data in the chunk passed to SHA1_Update(). This is enabled by using the Makefile variable SHA1_MAX_BLOCK_SIZE to specify chunk size. When using Apple's CommonCrypto library this is set to 1GiB (the implementation cannot handle more 4GiB). Signed-off-by: Atousa Pahlevan Duprat <apahlevan@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 0d89ad8..0adc7ef 100644
--- a/cache.h
+++ b/cache.h
@@ -30,6 +30,12 @@
#define git_SHA1_Update platform_SHA1_Update
#define git_SHA1_Final platform_SHA1_Final
+#ifdef SHA1_MAX_BLOCK_SIZE
+#include "compat/sha1-chunked.h"
+#undef git_SHA1_Update
+#define git_SHA1_Update git_SHA1_Update_Chunked
+#endif
+
#include <zlib.h>
typedef struct git_zstream {
z_stream z;