Skip to content

Commit 15a163e

Browse files
committed
Don't enforce receive-maximum on the broker
1 parent fed19b5 commit 15a163e

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

ChangeLog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- Fix $SYS load values not being published initially. Closes #3459.
1313
- Fix max_connections not being honoured on libwebsockets listeners. This does
1414
not affect the built-in websockets support. Closes #3455.
15+
- Don't enforce receive-maximum, just log a warning. This allows badly
16+
behaving clients to be fixed. Closes #3471.
1517

1618
# Plugins
1719
- Fix incorrect linking of libmosquitto_common.so for the acl and password

src/handle_publish.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,15 @@ int handle__accepted_publish(struct mosquitto *context, struct mosquitto__base_m
108108

109109
if(!cmsg_stored){
110110
if(base_msg->data.qos > 0 && context->msgs_in.inflight_quota == 0){
111+
log__printf(NULL, MOSQ_LOG_WARNING, "Client %s has exceeded its receive-maximum quota. This behaviour must be fixed on the client.", context->id);
112+
#if 0
113+
/* Badly behaving clients like on the esp32 fall foul of this
114+
* check, so report it for now but don't disconnect, to give chance
115+
* for the bad behaviour to be fixed. */
111116
/* Client isn't allowed any more incoming messages, so fail early */
112117
db__msg_store_free(base_msg);
113118
return MOSQ_ERR_RECEIVE_MAXIMUM_EXCEEDED;
119+
#endif
114120
}
115121

116122
if(base_msg->data.qos == 0

test/broker/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ list(APPEND PY_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/msg_sequence_test.py")
88
set(PERSIST_LIST
99
persist_sqlite
1010
)
11-
set(PERSIST_LMDB_EXCLUDE_LIST
12-
15-persist-migrate-db
13-
15-persist-migrate-db
14-
)
15-
1611
set(EXCLUDE_LIST
1712
01-connect-uname-password-success-no-tls
1813
03-publish-qos1-queued-bytes
14+
03-publish-qos2-max-inflight-exceeded
1915
09-extended-auth-single2
2016
# Not a test
2117
06-bridge-clean-session-core
@@ -44,9 +40,6 @@ endforeach()
4440
foreach(PERSIST_TYPE ${PERSIST_LIST})
4541
foreach(PY_TEST_FILE ${PY_PERSIST_TEST_FILES})
4642
get_filename_component(PY_TEST_NAME ${PY_TEST_FILE} NAME_WE)
47-
if("${PERSIST_TYPE}" STREQUAL "persist_lmdb" AND ${PY_TEST_NAME} IN_LIST PERSIST_LMDB_EXCLUDE_LIST)
48-
continue()
49-
endif()
5043
add_test(NAME broker-${PY_TEST_NAME}-${PERSIST_TYPE}
5144
COMMAND ${PY_TEST_FILE} ${PERSIST_TYPE}
5245
)

test/broker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ msg_sequence_test:
9696
./03-publish-qos1-retain-disabled.py
9797
./03-publish-qos1.py
9898
./03-publish-qos2-dup.py
99-
./03-publish-qos2-max-inflight-exceeded.py
99+
#./03-publish-qos2-max-inflight-exceeded.py
100100
./03-publish-qos2-max-inflight.py
101101
./03-publish-qos2-reuse-mid.py
102102
./03-publish-qos2.py

test/broker/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
(1, './03-publish-qos1-retain-disabled.py'),
7878
(1, './03-publish-qos1.py'),
7979
(1, './03-publish-qos2-dup.py'),
80-
(1, './03-publish-qos2-max-inflight-exceeded.py'),
80+
#(1, './03-publish-qos2-max-inflight-exceeded.py'),
8181
(1, './03-publish-qos2-max-inflight.py'),
8282
(1, './03-publish-qos2-reuse-mid.py'),
8383
(1, './03-publish-qos2.py'),

0 commit comments

Comments
 (0)