This is an automated email from the ASF dual-hosted git repository.
doleyzi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 8fb2b49ab0 [INLONG-12010][SDK] Fix the problem of truncated string
data containing Chinese characters when reporting using Dataproxy Python SDK
(#12011)
8fb2b49ab0 is described below
commit 8fb2b49ab0d2cfe65891330948f88bbee14641f9
Author: yfsn666 <[email protected]>
AuthorDate: Sun Sep 28 11:37:35 2025 +0800
[INLONG-12010][SDK] Fix the problem of truncated string data containing
Chinese characters when reporting using Dataproxy Python SDK (#12011)
---
.../dataproxy-sdk-twins/dataproxy-sdk-python/inlong_dataproxy.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/inlong_dataproxy.cpp
b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/inlong_dataproxy.cpp
index 4c2972ff19..257fb40958 100644
--- a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/inlong_dataproxy.cpp
+++ b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/inlong_dataproxy.cpp
@@ -65,13 +65,16 @@ PYBIND11_MODULE(inlong_dataproxy, m) {
return result;
})
.def("send", [](inlong::InLongApi& self, const char* groupId, const
char* streamId, const char* msg, int32_t msgLen, py::object pyCallback =
py::none()) {
+ // Recalculate the message length by C++ rules
+ int32_t sendLen = static_cast<int32_t>(strlen(msg));
+
if (!pyCallback.is(py::none())) {
g_py_callbacks[UserCallBackBridge] =
pyCallback.cast<py::function>();
py::gil_scoped_release release;
- int result = self.Send(groupId, streamId, msg, msgLen,
UserCallBackBridge);
+ int result = self.Send(groupId, streamId, msg, sendLen,
UserCallBackBridge);
return result;
} else {
- int result = self.Send(groupId, streamId, msg, msgLen,
nullptr);
+ int result = self.Send(groupId, streamId, msg, sendLen,
nullptr);
return result;
}
})