diff options
author | Patrick Steinhardt <ps@pks.im> | 2020-03-05 04:47:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 04:47:44 +0100 |
commit | 76e459604b15e0c20d67f9e357e7f684dcbb027a (patch) | |
tree | 69e69d905e6f90fc8ff55ece4e682f1e2e008b08 | |
parent | cd6ed4e48c25ab75ba3acbc8f24b21ad66f2d8d6 (diff) | |
parent | 502e5d5126ff50775f9c9143e5b424f0aaef9c16 (diff) | |
download | libgit2-76e459604b15e0c20d67f9e357e7f684dcbb027a.tar.gz |
Merge pull request #5432 from libgit2/ethomson/sslread
httpclient: use a 16kb read buffer for macOS
-rw-r--r-- | src/transports/httpclient.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/transports/httpclient.c b/src/transports/httpclient.c index f5c2ce58d..3008aaaad 100644 --- a/src/transports/httpclient.c +++ b/src/transports/httpclient.c @@ -29,7 +29,18 @@ static git_http_auth_scheme auth_schemes[] = { { GIT_HTTP_AUTH_BASIC, "Basic", GIT_CREDENTIAL_USERPASS_PLAINTEXT, git_http_auth_basic }, }; -#define GIT_READ_BUFFER_SIZE 8192 +/* + * Use a 16kb read buffer to match the maximum size of a TLS packet. This + * is critical for compatibility with SecureTransport, which will always do + * a network read on every call, even if it has data buffered to return to + * you. That buffered data may be the _end_ of a keep-alive response, so + * if SecureTransport performs another network read, it will wait until the + * server ultimately times out before it returns that buffered data to you. + * Since SecureTransport only reads a single TLS packet at a time, by + * calling it with a read buffer that is the maximum size of a TLS packet, + * we ensure that it will never buffer. + */ +#define GIT_READ_BUFFER_SIZE (16 * 1024) typedef struct { git_net_url url; |