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

taosdata / TDengine / #4513

17 Jul 2025 02:02AM UTC coverage: 31.359% (-31.1%) from 62.446%
#4513

push

travis-ci

web-flow
Merge pull request #31914 from taosdata/fix/3.0/compare-ans-failed

fix:Convert line endings from LF to CRLF for ans file

68541 of 301034 branches covered (22.77%)

Branch coverage included in aggregate %.

117356 of 291771 relevant lines covered (40.22%)

602262.98 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

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

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

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

33
  if (TSDB_BNODE_OPT_PROTO_MQTT == (*pBnode)->protocol) {
×
34
    if ((code = mqttMgmtStartMqttd((*pBnode)->dnodeId)) != 0) {
×
35
      bndError("failed to start taosudf since %s", tstrerror(code));
×
36

37
      taosMemoryFree(*pBnode);
×
38
      TAOS_RETURN(code);
×
39
    }
40
  } else {
41
    bndError("Unknown bnode proto: %hhd.", (*pBnode)->protocol);
×
42

43
    taosMemoryFree(*pBnode);
×
44
    TAOS_RETURN(code);
×
45
  }
46

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

49
  return TSDB_CODE_SUCCESS;
×
50
}
51

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

55
  taosMemoryFree(pBnode);
×
56

57
  bndInfo("Bnode closed.");
×
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