Skip to content

Commit 1bad339

Browse files
committed
fix trie match bug when topic contains root;
fix bytesMetrics wroteBytes always 0; fix startup shell can not run outside bin;
1 parent d2cce3f commit 1bad339

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

broker/src/main/java/io/moquette/broker/metrics/BytesMetricsHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
5454
@Override
5555
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
5656
BytesMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
57-
metrics.incrementWrote(((ByteBuf) msg).writableBytes());
57+
metrics.incrementWrote(((ByteBuf) msg).readableBytes());
5858
ctx.write(msg, promise).addListener(CLOSE_ON_FAILURE);
5959
}
6060

broker/src/main/java/io/moquette/broker/subscriptions/CTrie.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface IVisitor<T> {
1414
T getResult();
1515
}
1616

17-
private static final Token ROOT = new Token("root");
17+
private static final Token ROOT = new Token("+root");
1818
private static final INode NO_PARENT = null;
1919

2020
private enum Action {

distribution/src/main/scripts/moquette.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ echo " \_| |_/\___/ \__, |\__,_|\___|\__|\__\___| \_| |_/\_/\_\ \_/ \_/ "
1313
echo " | | "
1414
echo " |_| "
1515
echo " "
16-
echo " version: 0..13-SNAPSHOT "
16+
echo " version: 0.13-SNAPSHOT "
1717

1818

19-
cd "$(dirname "$0")"
20-
2119
# resolve links - $0 may be a softlink
2220
PRG="$0"
2321

@@ -39,7 +37,7 @@ PRGDIR=`dirname "$PRG"`
3937
export MOQUETTE_HOME
4038

4139
# Set JavaHome if it exists
42-
if [ -f "${JAVA_HOME}/bin/java" ]; then
40+
if [ -f "${JAVA_HOME}/bin/java" ]; then
4341
JAVA=${JAVA_HOME}/bin/java
4442
else
4543
JAVA=java

0 commit comments

Comments
 (0)