• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4829

30 Oct 2025 09:25AM UTC coverage: 49.734% (-11.3%) from 61.071%
#4829

push

travis-ci

web-flow
Merge pull request #33435 from taosdata/3.0

merge 3.0

123072 of 323930 branches covered (37.99%)

Branch coverage included in aggregate %.

7 of 25 new or added lines in 3 files covered. (28.0%)

35232 existing lines in 327 files now uncovered.

172062 of 269495 relevant lines covered (63.85%)

70709785.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/source/dnode/bnode/src/bnode.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "libs/tmqtt/tmqtt.h"
17
#include "bndInt.h"
18

UNCOV
19
int32_t bndOpen(const SBnodeOpt *pOption, SBnode **pBnode) {
×
UNCOV
20
  int32_t code = 0;
×
21

UNCOV
22
  *pBnode = taosMemoryCalloc(1, sizeof(SBnode));
×
UNCOV
23
  if (NULL == *pBnode) {
×
24
    bndError("calloc SBnode failed");
×
25
    code = terrno;
×
26
    TAOS_RETURN(code);
×
27
  }
28

UNCOV
29
  (*pBnode)->msgCb = pOption->msgCb;
×
UNCOV
30
  (*pBnode)->dnodeId = pOption->dnodeId;
×
UNCOV
31
  (*pBnode)->protocol = (int8_t)pOption->proto;
×
32

UNCOV
33
  if (TSDB_BNODE_OPT_PROTO_MQTT == (*pBnode)->protocol) {
×
UNCOV
34
    if ((code = mqttMgmtStartMqttd((*pBnode)->dnodeId)) != 0) {
×
35
      bndError("failed to start taosudf since %s", tstrerror(code));
×
36
      taosMemoryFree(*pBnode);
×
37
      *pBnode = NULL;
×
38
      TAOS_RETURN(code);
×
39
    }
40
  } else {
41
    bndError("Unknown bnode proto: %hhd.", (*pBnode)->protocol);
×
42
    taosMemoryFree(*pBnode);
×
43
    *pBnode = NULL;
×
44
    TAOS_RETURN(code);
×
45
  }
46

UNCOV
47
  bndInfo("Bnode opened.");
×
48

UNCOV
49
  return TSDB_CODE_SUCCESS;
×
50
}
51

UNCOV
52
void bndClose(SBnode *pBnode) {
×
UNCOV
53
  mqttMgmtStopMqttd();
×
54

UNCOV
55
  taosMemoryFree(pBnode);
×
56

UNCOV
57
  bndInfo("Bnode closed.");
×
UNCOV
58
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc