Commit Graph

1292 Commits

Author SHA1 Message Date
Roger A. Light
45fa820989 Anonymous clients are no longer accidently disconnected from the broker after a SIGHUP. 2014-07-13 14:11:43 +01:00
Roger A. Light
8b2effcc36 Don't check for POLLERR or POLLNVAL.
Errors will be caught when trying to read anyway, and doing these checks
here means that sockets may be closed prematurely.
2014-07-08 23:43:21 +01:00
Roger A. Light
0ff0cfb3d3 Need to include bridges here. 2014-07-08 23:29:16 +01:00
Roger A. Light
9bb336bbf3 Use do_disconnect() for websockets. 2014-07-08 23:18:11 +01:00
Roger A. Light
95a4ec431d Don't try to disconnect twice. 2014-07-08 23:16:34 +01:00
Roger A. Light
bb1a69b7d7 Disconnect clients consistently. 2014-07-08 23:07:19 +01:00
Roger A. Light
22094aa00d Memory checks. 2014-07-04 21:32:27 +01:00
Roger A. Light
3fd1dc477f Fix defects identified by Coverity. 2014-07-03 21:55:25 +01:00
Roger A. Light
5ac576f2ab Request write callback if there is still more to send. 2014-07-03 18:48:40 +01:00
Roger A. Light
405b7f0aab Don't free here, leads to potential double free. 2014-07-03 17:37:31 +01:00
Roger A. Light
0856e9519d Need to assign ws_context here. 2014-07-03 11:32:54 +01:00
Roger A. Light
399453837d Log websockets listeners being opened. 2014-07-03 11:32:29 +01:00
Roger A. Light
13f94f3511 More reconnect fixes. 2014-07-03 01:00:57 +01:00
Roger A. Light
2b300b718b Fix double free for websockets with bad auth. 2014-07-02 20:57:04 +01:00
Roger A. Light
0fb064e0b4 Fix clean session for reconnecting clients. 2014-07-02 20:44:08 +01:00
Roger A. Light
fe5dba5887 Add use_username_as_clientid. 2014-07-02 00:09:50 +01:00
Roger A. Light
864f1f0d23 Initialise variable. 2014-06-30 23:37:37 +01:00
Roger A. Light
84619c296d Fix building for WITH_BRIDGE=no. 2014-06-30 23:37:03 +01:00
Roger A. Light
d75903b0ae Fix reconnect support for websockets. 2014-06-30 23:30:43 +01:00
Roger A. Light
d60e44ec1b Handle reconnects for websockets. 2014-06-30 06:58:56 +01:00
Roger A. Light
542ebb2480 Free peer certificate after use. 2014-06-30 05:33:41 +01:00
Roger A. Light
bdb3e74100 More memory fixes. 2014-06-29 23:16:10 +01:00
Roger A. Light
15efd2d072 Various memory fixes. 2014-06-28 01:38:58 +01:00
Roger A. Light
ff5fd26e13 Free base64 memory properly. 2014-06-27 22:59:50 +01:00
Roger A. Light
7f18ced0b4 Close websockets connection if we are set to disconnecting. 2014-06-26 22:13:22 +01:00
Roger A. Light
482d604598 Only remove from hash if a valid socket (i.e. if present) 2014-06-23 23:51:16 +01:00
Roger A. Light
3577dbf332 Add sock hash earlier to avoid crashes. 2014-06-23 23:47:48 +01:00
Roger A. Light
0fc0e13a8f Can't access mosq after free. 2014-06-23 18:44:42 +01:00
Roger A. Light
19056e6d4c Removed $SYS/broker/changeset. 2014-06-23 18:37:15 +01:00
Roger A. Light
480d8a08d0 Count disconnected clients on persistence restore. 2014-06-23 18:29:25 +01:00
Roger A. Light
749ea76678 Typo. 2014-06-23 18:20:32 +01:00
Roger A. Light
cc33a6e5af Do proper cleanup, including websockets. 2014-06-23 18:18:29 +01:00
Roger A. Light
764b7e0a91 Use hash functions to store client data. 2014-06-23 17:57:35 +01:00
Roger A. Light
7911db1a1e Simplify. 2014-06-23 09:43:32 +01:00
Roger A. Light
bd2aa2f426 Add batch mode to mosquitto_passwd. 2014-06-20 20:59:04 +01:00
Roger A. Light
9a9dba6cd5 Support for mqttv3.1 subprotocol string. 2014-06-20 10:52:10 +01:00
Roger A. Light
29e65e4965 Anonymous clients are no longer accidently disconnected from the broker after a SIGHUP. 2014-06-18 23:17:40 +01:00
Roger A. Light
4025fad5aa libuuid is used to generate client ids, where it is available, when an MQTT v3.1.1 client connects with a zero length client id. 2014-06-15 01:07:05 +01:00
Roger A. Light
731391bcb3 Separate function for generating a random client id. 2014-06-15 00:37:30 +01:00
Roger A. Light
0461c08fdf use_identity_as_username now no longer affects non-TLS listeners. 2014-06-14 23:42:24 +01:00
Roger A. Light
af49fc556a When a durable client reconnects, its queued messages are now checked against ACLs in case of a change in username/ACL state since it last connected.
Thanks to "web1".
2014-06-13 23:07:00 +01:00
Roger A. Light
930b917217 Save disconnect_t for connected clients when the broker exits. 2014-06-13 22:34:04 +01:00
Roger A. Light
11631d8d92 Add local_clientid for bridges. 2014-06-10 23:30:15 +01:00
Roger A. Light
aca67a2170 Better function names. 2014-06-08 22:51:36 +01:00
Roger A. Light
e221b37658 Add stats mode for db_dump. 2014-06-05 11:56:32 +01:00
Roger A. Light
7b62bfd7da Use time() for disconnect_t, CLOCK_MONOTONIC isn't useful over reboots. 2014-06-04 22:14:16 +01:00
Roger A. Light
1ef8575a35 Reset disconnect_t on client reconnect. 2014-06-04 22:13:19 +01:00
Roger A. Light
ad43754b62 Log username in single quotes. 2014-06-03 17:06:11 +01:00
Roger A. Light
4430228855 Be consistent about removing listener counts on socket close. 2014-06-03 16:21:46 +01:00
Roger A. Light
7cef936ba6 Logging fixes. 2014-06-03 15:16:27 +01:00
Roger A. Light
c8a0786dea TLS websockets support. 2014-06-03 02:10:55 +01:00
Roger A. Light
6a7f77d2a8 More intelligent client counting. 2014-06-02 22:08:40 +01:00
Roger A. Light
0d80800786 Don't refuse clients with will topic that isn't allowed by acl. 2014-06-02 01:19:48 +01:00
Roger A. Light
ef4b7a52a0 Fix missing headers for WITH_TLS=no. 2014-06-02 01:01:29 +01:00
Roger A. Light
fd7d5ebbb9 Change $SYS/broker/clients/[in]active -> $SYS/broker/clients/[dis]connected 2014-06-02 00:51:40 +01:00
Roger A. Light
e4ddc31295 Fix for MQTT-3.8.4-3. 2014-05-31 23:26:46 +01:00
Roger A. Light
85af9bdd9a Simplify. 2014-05-31 22:12:20 +01:00
Roger A. Light
87579e0cac Remove STRICT_PROTOCOL #ifdefs. 2014-05-31 21:53:35 +01:00
Roger A. Light
1984e2e37d v3.1.1 requires websockets protocol to be mqtt. 2014-05-31 21:24:16 +01:00
Roger A. Light
c13f4c7931 Close config files on error. 2014-05-31 21:12:39 +01:00
Roger A. Light
5da25ae5d9 Add support for "session present" in CONNACK messages for MQTT v3.1.1. 2014-05-31 15:20:40 +01:00
Roger A. Light
0224db85c4 Fix bug #1324411 2014-05-29 15:22:48 +01:00
Roger A. Light
6cc3e7999e Tidy up. 2014-05-27 22:02:52 +01:00
Roger A. Light
859224224a Fix potential memory leak. 2014-05-27 21:11:05 +01:00
Roger A. Light
6a03972507 Default to websockets off for cmake. 2014-05-27 19:49:33 +01:00
Roger A. Light
be0cfff969 Fix possible leaks. 2014-05-26 21:23:19 +01:00
Roger A. Light
7d197563bc Fix for non-lws compilation. 2014-05-26 19:16:59 +01:00
Roger A. Light
1148cdae23 Loop fix. 2014-05-26 18:01:24 +01:00
Roger A. Light
063928bbfe Merge websockets -> 1.4. 2014-05-26 17:22:52 +01:00
Roger A. Light
e8f07d706d Per-listener processing of websockets contexts. 2014-05-26 17:09:44 +01:00
Roger A. Light
2db22f3abd Merge 1.3.2 branch in 1.4 branch. 2014-05-26 13:21:20 +01:00
Roger A. Light
330a7a882e Add CROSS_COMPILE to Makefiles. 2014-05-25 23:36:38 +01:00
Roger A. Light
58891769c1 Quicker to return here. 2014-05-18 22:45:09 +01:00
Roger A. Light
5ca13a82f9 No need for pthreads in broker code. 2014-05-18 22:44:02 +01:00
Roger A. Light
175299c872 Guard for incomplete code when using websockets. 2014-05-18 22:43:24 +01:00
Roger A. Light
50f9b6bd7a Enable partial writes for mqtt websockets. 2014-05-18 22:41:22 +01:00
Roger A. Light
7316742cf4 Config support for websockets. 2014-05-18 22:40:20 +01:00
Roger A. Light
9ea161f90e Return success on libwebsocket_write==0. 2014-05-18 20:54:44 +01:00
Roger A. Light
06625420e2 Fix for local_username/password bridge checks. 2014-05-08 23:27:35 +01:00
Roger A. Light
7b5b5cf43e Add local_username, local_password for bridge connections to authenticate to the local broker. 2014-05-08 23:27:11 +01:00
Roger A. Light
dc71f9157d Use $(STRIP) for stripping binaries when installing, to allow easier cross compilation.
Thanks to Frank Pagliughi.
2014-05-08 23:18:50 +01:00
Bart Van Der Meerssche
59eb5a65bf include a switch to disable elliptic curve support in the broker
Change-Id: Ic874a92b79b32b4ebd2b8130fefe2b31fddd43b6
Signed-off-by: Bart Van Der Meerssche <bart@flukso.net>
2014-07-03 22:21:40 +02:00
Roger A. Light
fb7dd42e5d Support for ECDHE-ECDSA family ciphers. 2014-07-03 19:35:37 +01:00
Roger A. Light
40818619fd Deduplicate tls context code. 2014-07-03 19:33:36 +01:00
Roger A. Light
ae6baad2fa Default TLS mode now accepts TLS v1.2, v1.1 and v1.0. 2014-05-24 23:18:54 +01:00
Roger Light
e5cc63a89b Fix subscriptions sometimes being deleted.
Fix subscriptions being deleted when clients subscribed to a topic
beginning with a $ but that is not $SYS.

Thanks to David Woodward.
2014-05-08 23:05:34 +01:00
Roger Light
ab15557931 Fix possible crash when using pattern ACLs.
Crash may occur for ACLs that do not include a %u and clients that
connect without a username.

Thanks to Karl Palsson.
2014-05-08 23:03:15 +01:00
Roger Light
b8e34b0b05 Ensure that bridges verify certificates by default when using TLS.
Thanks to Stefan Borsje.
2014-05-08 22:48:13 +01:00
Roger A. Light
62171a381e Fix for local_username/password bridge checks. 2014-05-08 19:24:58 +01:00
Roger A. Light
968004d9d8 Add local_username, local_password for bridge connections to authenticate to the local broker. 2014-05-08 18:45:34 +01:00
Roger Light
0364bd1be7 Initial contribution. 2014-05-07 23:27:00 +01:00
Roger A. Light
4bb7a45b71 Crude, hard coded websockets support. No TLS. 2014-05-06 10:47:00 +01:00