Merge branch 'sp/clip-read-write-to-8mb'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2013 21:50:39 +0000 (14:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2013 21:50:39 +0000 (14:50 -0700)
Send a large request to read(2)/write(2) as a smaller but still
reasonably large chunks, which would improve the latency when the
operation needs to be killed and incidentally works around broken
64-bit systems that cannot take a 2GB write or read in one go.

* sp/clip-read-write-to-8mb:
Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
xread, xwrite: limit size of IO to 8MB

1  2 
Makefile
git-compat-util.h
diff --combined Makefile
index 9135cc9358fb3cb8305eebe8ef209652f758a395,4026211cb42e8caca91b2bbe0c9236a4db543352..e2abb7b4ea3d3d02dc6e5a8f67516ad1069e31a4
+++ b/Makefile
@@@ -69,9 -69,6 +69,6 @@@ all:
  # Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
  # doesn't support GNU extensions like --check and --statistics
  #
- # Define NEEDS_CLIPPED_WRITE if your write(2) cannot write more than
- # INT_MAX bytes at once (e.g. MacOS X).
- #
  # Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
  # it specifies.
  #
@@@ -580,7 -577,6 +577,7 @@@ TEST_PROGRAMS_NEED_X += test-sigchai
  TEST_PROGRAMS_NEED_X += test-string-list
  TEST_PROGRAMS_NEED_X += test-subprocess
  TEST_PROGRAMS_NEED_X += test-svn-fe
 +TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
  TEST_PROGRAMS_NEED_X += test-wildmatch
  
  TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
@@@ -737,7 -733,6 +734,7 @@@ LIB_H += tree-walk.
  LIB_H += tree.h
  LIB_H += unpack-trees.h
  LIB_H += url.h
 +LIB_H += urlmatch.h
  LIB_H += userdiff.h
  LIB_H += utf8.h
  LIB_H += varint.h
@@@ -888,7 -883,6 +885,7 @@@ LIB_OBJS += tree.
  LIB_OBJS += tree-walk.o
  LIB_OBJS += unpack-trees.o
  LIB_OBJS += url.o
 +LIB_OBJS += urlmatch.o
  LIB_OBJS += usage.o
  LIB_OBJS += userdiff.o
  LIB_OBJS += utf8.o
@@@ -1185,9 -1179,6 +1182,9 @@@ ifdef NEEDS_SSL_WITH_CRYPT
  else
        LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
  endif
 +ifdef APPLE_COMMON_CRYPTO
 +      LIB_4_CRYPTO += -framework Security -framework CoreFoundation
 +endif
  endif
  ifdef NEEDS_LIBICONV
        ifdef ICONVDIR
@@@ -1499,11 -1490,6 +1496,6 @@@ ifndef NO_MSGFMT_EXTENDED_OPTION
        MSGFMT += --check --statistics
  endif
  
- ifdef NEEDS_CLIPPED_WRITE
-       BASIC_CFLAGS += -DNEEDS_CLIPPED_WRITE
-       COMPAT_OBJS += compat/clipped-write.o
- endif
  ifneq (,$(XDL_FAST_HASH))
        BASIC_CFLAGS += -DXDL_FAST_HASH
  endif
diff --combined git-compat-util.h
index 8752317fe9a52e0e3ba941c63484b00968b2b695,96d888165b9185e146aae4ab29998a11aeec312e..9549de6318147839c73b60b1fc72ceb44d9adb47
@@@ -185,11 -185,6 +185,6 @@@ typedef unsigned long uintptr_t
  #define probe_utf8_pathname_composition(a,b)
  #endif
  
- #ifdef NEEDS_CLIPPED_WRITE
- ssize_t clipped_write(int fildes, const void *buf, size_t nbyte);
- #define write(x,y,z) clipped_write((x),(y),(z))
- #endif
  #ifdef MKDIR_WO_TRAILING_SLASH
  #define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
  extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
@@@ -330,16 -325,6 +325,16 @@@ extern NORETURN void die_errno(const ch
  extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
  extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
  
 +#ifndef NO_OPENSSL
 +#ifdef APPLE_COMMON_CRYPTO
 +#include "compat/apple-common-crypto.h"
 +#else
 +#include <openssl/evp.h>
 +#include <openssl/hmac.h>
 +#endif /* APPLE_COMMON_CRYPTO */
 +#include <openssl/x509v3.h>
 +#endif /* NO_OPENSSL */
 +
  /*
   * Let callers be aware of the constant return value; this can help
   * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
@@@ -524,7 -509,7 +519,7 @@@ int inet_pton(int af, const char *src, 
  const char *inet_ntop(int af, const void *src, char *dst, size_t size);
  #endif
  
 -extern void release_pack_memory(size_t, int);
 +extern void release_pack_memory(size_t);
  
  typedef void (*try_to_free_t)(size_t);
  extern try_to_free_t set_try_to_free_routine(try_to_free_t);