Roger A. Light
c1b009e4df
Fix memory leak on handling QoS 2 PUBLISH.
...
In some circumstances, Mosquitto could leak memory when handling PUBLISH messages. This is limited to incoming QoS 2 messages, and is related to the combination of the broker having persistence enabled, a clean session=false client, which was connected prior to the broker restarting, then has reconnected and has now sent messages at a sufficiently high rate that the incoming queue at the broker has filled up and hence messages are being dropped. This is more likely to have an effect where max_queued_messages is a small value. This has now been fixed.
Closes #1793 . Thanks to mbates14.
2020-08-19 14:38:57 +01:00
Roger A. Light
b3b58cc635
Build warning fixes.
2020-08-19 14:04:02 +01:00
Roger A. Light
4dc835b73d
Fix possible memory leaks on errors during persistence write.
2020-08-19 11:12:05 +01:00
Roger A. Light
32ed4809ed
Build fix for NetBSD.
...
Thanks to Greg Troxel.
2020-08-11 16:21:19 +01:00
Roger Light
60dc8f5e4c
Fix service path quoting on Windows.
...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=565671
2020-08-11 09:09:31 +01:00
Roger Light
3eb60e2e6a
Fix some winsock argument types.
2020-08-11 08:43:24 +01:00
Roger A. Light
43df213ecb
Merge branch 'improve-client-store' of git://github.com/dbeinder/mosquitto into dbeinder-improve-client-store
2020-08-07 09:11:43 +01:00
david-beinder
212fd8635f
Store username and listener of persistent clients
...
Signed-off-by: david-beinder <david.beinder@mce.li>
2020-08-07 08:32:14 +02:00
Roger A. Light
94d04136f8
Fix potential memory leaks.
...
Closes #1773 . Closes #1774 . Thanks to Yingpei Zeng.
2020-08-06 21:28:09 +01:00
Roger A. Light
618cd7006b
Don't try to start DLT logging if DLT unavailable.
...
This is to avoid a long delay when shutting down the broker.
Closes #1735 . Thanks to Colin Law.
2020-08-04 11:17:04 +01:00
Roger A. Light
1f717873d6
Log protocol error message where appropriate from a bad UNSUBSCRIBE
...
Rather than the generic "socket error".
Related to #1765 .
2020-07-31 23:01:15 +01:00
Roger A. Light
2b1a22776b
Only call setvbuf on open files.
2020-07-19 21:59:28 +01:00
Roger A. Light
54f3b686dc
Fix "slow" file based logging by switching to line based buffering.
...
Closes #1689 . Closes #1741 . Thanks to Brett M. Gordon and tt92.
2020-07-15 22:28:19 +01:00
Roger A. Light
8234d24b1b
Fix websockets clients sometimes not being disconnected promptly.
...
Closes #1718 . Thanks to Luca Casonato.
2020-07-15 22:06:29 +01:00
Roger A. Light
b4e0dfa598
Fix autosave_interval
not being triggered by messages being delivered.
...
Closes #1726 . Thanks to nduhme.
2020-07-15 19:29:40 +01:00
Roger A. Light
4e0312c55f
Fix messages being queued for disconnected bridges
...
This occurred incorrectly when clean start was set to true.
Closes #1729 . Thanks to Andreyooo.
2020-07-15 17:08:00 +01:00
Roger A. Light
1d66d3e443
Fix bridge topic remapping when using "" as the topic.
...
Closes #1749 . Thanks to cieslarchristian.
2020-07-15 00:19:44 +01:00
Roger A. Light
5a56f066a8
Change systemd unit files to create /var/log/mosquitto
...
This happens before starting the broker.
Also don't quit with an error if opening the log file isn't possible.
Closes #821 .
2020-07-14 20:10:54 +01:00
Roger A. Light
abb31ffe8d
Fix broker refusing to start if only websockets listeners were defined.
...
Closes #1740 . Thanks to OkenKhuman.
2020-07-14 17:27:57 +01:00
Sigmund Vik
5481575f8b
Fix FormatMessage warnings for Windows.
...
From the FormatMessage() Win32 API documentation: "The lpBuffer
parameter is a pointer to an LPTSTR; you must cast the pointer
to an LPTSTR (for example, (LPTSTR)&lpBuffer)."
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessage#parameters
This commit fixes warnings like these:
warning C4047: 'function': 'LPSTR' differs in levels of indirection from 'char **'
warning C4024: 'FormatMessageA': different types for formal and actual parameter 5
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
2020-07-12 22:34:20 +01:00
Sigmund Vik
a75d574870
Fix sys_tree macro stubs with no arguments.
...
This fixes Visual Studio compiler warnings like this one:
"warning C4003: not enough arguments for function-like
macro invocation 'G_MSGS_DROPPED_INC'"
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
2020-07-12 22:26:00 +01:00
Sigmund Vik
20972a2819
Add broker ready message.
...
Before this commit there was no good way to detect that the
Mosquitto broker was done with its startup phase on systems
without systemd.
On such systems it was tricky to e.g. start the broker from
a test where ports are dynamically assigned and one have to
deal with potential port conflicts. Without a way to know
that the broker is done with its startup phase, there was no
way to know if the broker was able to acquire the port (for
both IPv4 and IPv6) without waiting for some unknown period
of time (when many tests are run in parallel a single process
might be starved for resources).
With this new broker ready message it is easy for the parent
process to monitor the broker output and figure out when the
port was successfully acquired.
Signed-off-by: Sigmund Vik <sigmund_vik@yahoo.com>
2020-07-10 22:48:58 +01:00
Jasper Lievisse Adriaanse
2758401829
only link with libm on OpenBSD
...
fixes "ld: error: unable to find library -ldl"
Signed-off-by: Jasper Lievisse Adriaanse <jasper@humppa.nl>
2020-06-17 15:54:24 +01:00
Roger A. Light
4b541ad5ca
Fix usage message not mentioning v5.0.
...
Closes #1713 . Thanks to whnr.
2020-06-09 15:42:51 +01:00
Roger A. Light
6bd435d721
Fix possible assert crash associated with bridge reconnecting.
...
This only occurs when compiled without epoll support.
Closes #1700 . Thanks to Matthias Urlichs.
2020-05-25 23:38:13 +01:00
Roger A. Light
eae8c9aab4
Fix check when loading persistence file of a different version
...
Closes #1684 . Thanks to grekhss.
2020-05-15 22:11:26 +01:00
Roger A. Light
762ad432e8
Fix support for openssl 3.0
2020-05-12 13:39:49 +01:00
Roger A. Light
bfc82ea91a
Fix incorrect check.
2020-05-05 13:13:24 +01:00
Roger A. Light
4960fc0702
Don't disconnect clients that are already disconnected.
...
This prevents the session expiry being extended on SIGHUP.
Closes #1521 . Thanks to Christoph Krey.
2020-05-01 22:45:40 +01:00
Roger A. Light
eeaafed485
Fix memory leak when connecting clients rejected.
2020-04-30 17:31:13 +01:00
Roger A. Light
5908585afd
Fix mosquitto_passwd -b not updating passwords for existing users
...
Closes #1664 . Thanks to Leon Kiefer.
2020-04-26 22:44:57 +01:00
Roger A. Light
3758e0c328
Fix mosquitto_passwd not being able to create pwfile with -b.
2020-04-08 12:38:15 +01:00
Roger A. Light
de25ff694e
Report invalid bridge prefix+pattern combinations at config parsing time
...
Rather than letting the bridge fail later.
Issue #1635 . Thanks to pokerazor.
2020-03-28 22:44:35 +00:00
Roger A. Light
4ab0f4bd39
Fix bundled deps option not being propagated to library.
...
Issue #1641 .
2020-03-27 21:44:19 +00:00
Michael
24e34434a4
Move SSL prepare and accept operations out of deep loop
...
Since all resources are ready, do not need lookup again.
Signed-off-by: Michael Liu <michael.liu.point@gmail.com>
2020-03-12 12:25:24 +00:00
Michael Liu
7953649b1c
Fix potential memory leak.
...
WebSocket context may lost since db->ll_for_free = NULL; operation on the bottom of context__free_disused() function.
Signed-off-by: Michael Liu <michael.liu.point@gmail.com>
2020-03-12 12:09:00 +00:00
Roger A. Light
c84d175b3d
Fixes for the poor souls stuck on <c99.
...
Closes #1622 .
2020-03-12 10:29:11 +00:00
Roger A. Light
c175e836a7
Print openssl error when unable to load server key.
2020-03-05 10:54:13 +00:00
Roger A. Light
b0a065f790
Update changelog. Release page. Bump copyright.
2020-02-27 23:26:58 +00:00
Roger A. Light
0c68c20d2b
Fix mosquitto_client_protocol()
returning incorrect values.
2020-02-27 15:01:41 +00:00
Roger A. Light
db02c9162d
Add plugin that prints out calls, to help debugging.
2020-02-27 15:01:41 +00:00
Roger A. Light
032af6bf69
Add missing header
2020-02-27 15:01:41 +00:00
Roger A. Light
c4e41f3444
Back port db_dump from develop.
...
Closes #1519 . Thanks to Christoph Krey.
2020-02-06 16:44:04 +00:00
Roger A. Light
2a8c1d03f5
Merge branch 'coverity-fixes' into fixes
2020-02-06 16:20:52 +00:00
Gianfranco Costamagna
078ad752cd
cmake: add ADNS enable/disable dynamic support
...
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
2020-02-06 15:24:09 +00:00
Gianfranco Costamagna
e9a7150031
Bugfix: enabling DLT was overriding everything else on linker flags because of error in cmake set keyword
...
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
2020-02-06 15:21:40 +00:00
Roger A. Light
07c54627e9
Print OpenSSL errors in more situations
...
Covers when loading certificates fails, or there are ENGINE problems.
Closes #1552 . Thanks to Michael Richardson.
2020-02-04 16:59:29 +00:00
Roger A. Light
27b4518d7e
Improve password file parsing in the broker and mosqitto_passwd.
...
Closes #1584 . Thanks to panava.
2020-02-04 16:38:51 +00:00
Roger A. Light
ed5db1bd6b
Fix bind_interface
not working for the default listener.
...
Closes #1533 . Thanks to Markus Gothe.
2020-01-30 22:48:15 +00:00
Roger A. Light
e188a6b500
More whitespace trimming fixes/consolidation.
2020-01-30 22:26:13 +00:00