-
Notifications
You must be signed in to change notification settings - Fork 999
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix clickhouse-cpp build on i686/aarch64
Fixes: #4550
- Loading branch information
1 parent
4f419e6
commit e96d2e3
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
deps/clickhouse-cpp/0001-fix-recv_timeout-and-send_timeout-initialization.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From cfb12800e698a0e7273a9cb007d0d1658c1689f2 Mon Sep 17 00:00:00 2001 | ||
From: Jia Yue Hua <[email protected]> | ||
Date: Tue, 3 Oct 2023 15:24:35 +0800 | ||
Subject: [PATCH] fix recv_timeout and send_timeout initialization | ||
|
||
--- | ||
clickhouse/base/socket.cpp | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/clickhouse/base/socket.cpp b/clickhouse/base/socket.cpp | ||
index 28be7b6..3c86629 100644 | ||
--- a/clickhouse/base/socket.cpp | ||
+++ b/clickhouse/base/socket.cpp | ||
@@ -129,10 +129,10 @@ void SetNonBlock(SOCKET fd, bool value) { | ||
|
||
void SetTimeout(SOCKET fd, const SocketTimeoutParams& timeout_params) { | ||
#if defined(_unix_) | ||
- timeval recv_timeout{ timeout_params.recv_timeout.count() / 1000, static_cast<int>(timeout_params.recv_timeout.count() % 1000 * 1000) }; | ||
+ timeval recv_timeout{ static_cast<time_t>(timeout_params.recv_timeout.count() / 1000), static_cast<suseconds_t>(timeout_params.recv_timeout.count() % 1000 * 1000) }; | ||
auto recv_ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &recv_timeout, sizeof(recv_timeout)); | ||
|
||
- timeval send_timeout{ timeout_params.send_timeout.count() / 1000, static_cast<int>(timeout_params.send_timeout.count() % 1000 * 1000) }; | ||
+ timeval send_timeout{ static_cast<time_t>(timeout_params.send_timeout.count() / 1000), static_cast<suseconds_t>(timeout_params.send_timeout.count() % 1000 * 1000) }; | ||
auto send_ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &send_timeout, sizeof(send_timeout)); | ||
|
||
if (recv_ret == -1 || send_ret == -1) { | ||
-- | ||
2.45.0 | ||
|