diff options
author | 2018-07-17 10:17:33 -0700 | |
---|---|---|
committer | 2018-07-17 10:17:33 -0700 | |
commit | baaf4512a8e3c7064c505910bc18ea99e8d8ea1b (patch) | |
tree | 49a66813be670caca6af6dc867e81ea997cc2d4b /src/core | |
parent | c55026eee95ce24137c81194abdda2c8845e414d (diff) | |
parent | a93fdfce84533eeb26461d2d457256df43dd8078 (diff) |
Merge branch 'master' into fix-dns-job-2
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/tcp_posix.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 9df2e206b2..b53ffbf01c 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -26,6 +26,7 @@ #include "src/core/lib/iomgr/tcp_posix.h" #include <errno.h> +#include <limits.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> @@ -513,7 +514,11 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer, } /* returns true if done, false if pending; if returning true, *error is set */ +#if defined(IOV_MAX) && IOV_MAX < 1000 +#define MAX_WRITE_IOVEC IOV_MAX +#else #define MAX_WRITE_IOVEC 1000 +#endif static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) { struct msghdr msg; struct iovec iov[MAX_WRITE_IOVEC]; |