Fix the topic parsing issue.
| | |
| | | strncpy(buf_temp, topic, topic_size > (sizeof(buf_temp) - 1) ? (sizeof(buf_temp) - 1) : topic_size); |
| | | data_ptr = strtok(const_cast<char *>(buf_temp), STR_MAGIC); |
| | | while(data_ptr) { |
| | | data_ptr = trim(data_ptr, 0); |
| | | TcsSub_ele->insert(data_ptr); |
| | | if ((svr_tcs_iter = SvrData->find(data_ptr)) != SvrData->end()) { |
| | | SvrSub_ele = svr_tcs_iter->second; |
| | |
| | | strncpy(buf_temp, topic, topic_size > (sizeof(buf_temp) - 1) ? (sizeof(buf_temp) - 1) : topic_size); |
| | | data_ptr = strtok(const_cast<char *>(buf_temp), STR_MAGIC); |
| | | while(data_ptr) { |
| | | data_ptr = trim(data_ptr, 0); |
| | | ret = Qurey_object(data_ptr, &len); |
| | | if (ret != NULL) { |
| | | |
| | |
| | | ProcZone *proc = shm_mm_attach<ProcZone>(SHM_BUS_PROC_MAP_KEY); |
| | | |
| | | strncpy(buf_temp, topic, topic_size > (sizeof(buf_temp) - 1) ? (sizeof(buf_temp) - 1) : topic_size); |
| | | if ((svr_tcs_iter = SvrData->find(buf_temp)) != SvrData->end()) { |
| | | if ((svr_tcs_iter = SvrData->find(trim(buf_temp, 0))) != SvrData->end()) { |
| | | SvrSub_ele = svr_tcs_iter->second; |
| | | |
| | | for(svr_proc_iter = SvrSub_ele->begin(); svr_proc_iter != SvrSub_ele->end(); ++svr_proc_iter) { |
| | |
| | | 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; |