summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twosigma.com>2017-04-11 18:13:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-14 01:24:32 (GMT)
commit37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59 (patch)
tree1647210565dd94cb2e7116a9980be30ee0fbf105 /config.c
parentb14f27f91770e0f99f64135348977a0ce1c7993a (diff)
downloadgit-37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59.zip
git-37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59.tar.gz
git-37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59.tar.bz2
http.postbuffer: allow full range of ssize_t values
Unfortunately, in order to push some large repos where a server does not support chunked encoding, the http postbuffer must sometimes exceed two gigabytes. On a 64-bit system, this is OK: we just malloc a larger buffer. This means that we need to use CURLOPT_POSTFIELDSIZE_LARGE to set the buffer size. Signed-off-by: David Turner <dturner@twosigma.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/config.c b/config.c
index 1a4d855..aae6dcc 100644
--- a/config.c
+++ b/config.c
@@ -834,6 +834,15 @@ int git_parse_ulong(const char *value, unsigned long *ret)
return 1;
}
+static int git_parse_ssize_t(const char *value, ssize_t *ret)
+{
+ intmax_t tmp;
+ if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(ssize_t)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
NORETURN
static void die_bad_number(const char *name, const char *value)
{
@@ -892,6 +901,14 @@ unsigned long git_config_ulong(const char *name, const char *value)
return ret;
}
+ssize_t git_config_ssize_t(const char *name, const char *value)
+{
+ ssize_t ret;
+ if (!git_parse_ssize_t(value, &ret))
+ die_bad_number(name, value);
+ return ret;
+}
+
int git_parse_maybe_bool(const char *value)
{
if (!value)