From 490948a0d52a3ad7b3f94525a982fc7012d06011 Mon Sep 17 00:00:00 2001 From: fujuntang <fujuntang@smartai.com> Date: 星期二, 30 十一月 2021 08:35:51 +0800 Subject: [PATCH] Fix the topic parsing issue. --- src/socket/shm_mod_socket.cpp | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/socket/shm_mod_socket.cpp b/src/socket/shm_mod_socket.cpp index 6058308..ababb7d 100644 --- a/src/socket/shm_mod_socket.cpp +++ b/src/socket/shm_mod_socket.cpp @@ -301,6 +301,7 @@ int ShmModSocket::pub(const char *topic, int topic_size, const void *content, int content_size, int key, const struct timespec *timeout, int flags) { int ret; bus_head_t head = {}; + topic = trim(const_cast<char *>(topic), 0); memcpy(head.action, "pub", sizeof(head.action)); head.topic_size = topic_size = strlen(topic) + 1; head.content_size = content_size; -- Gitblit v1.8.0