Merge branch 'dt/http-postbuffer-can-be-large'

Allow the http.postbuffer configuration variable to be set to a
size that can be expressed in size_t, which can be larger than
ulong on some platforms.

* dt/http-postbuffer-can-be-large:
  http.postbuffer: allow full range of ssize_t values
This commit is contained in:
Junio C Hamano
2017-04-23 22:07:45 -07:00
5 changed files with 32 additions and 6 deletions

6
http.c
View File

@ -19,7 +19,7 @@ long int git_curl_ipresolve;
#endif
int active_requests;
int http_is_verbose;
size_t http_post_buffer = 16 * LARGE_PACKET_MAX;
ssize_t http_post_buffer = 16 * LARGE_PACKET_MAX;
#if LIBCURL_VERSION_NUM >= 0x070a06
#define LIBCURL_CAN_HANDLE_AUTH_ANY
@ -331,7 +331,9 @@ static int http_options(const char *var, const char *value, void *cb)
}
if (!strcmp("http.postbuffer", var)) {
http_post_buffer = git_config_int(var, value);
http_post_buffer = git_config_ssize_t(var, value);
if (http_post_buffer < 0)
warning(_("negative value for http.postbuffer; defaulting to %d"), LARGE_PACKET_MAX);
if (http_post_buffer < LARGE_PACKET_MAX)
http_post_buffer = LARGE_PACKET_MAX;
return 0;