Commit Graph

88 Commits

Author SHA1 Message Date
Roger A. Light
c07ba2a3da Experimental fix for poor websockets performance. 2017-06-18 12:52:59 +01:00
Roger A. Light
91b308a11d Merge branch 'master' into develop 2017-03-06 21:19:53 +00:00
Roger A. Light
433ee5c4d6 [344] Don't compile in async dns support by default for makefiles. 2017-02-20 23:48:30 +00:00
Roger A. Light
6f45ab9624 [344] Only do async dns on glibc. 2017-02-20 23:48:30 +00:00
Roger A. Light
e13af18ed9 Start of fix for [344]. 2017-02-20 23:48:30 +00:00
Karl Palsson
c6aac741c2 broker: support byte based queueing
Limiting queued message depth purely based on message count is hard to
control for memory constrained devices.  The size of messages can vary
wildly, from a few bytes, to a few kilobytes.  Support a new
max_queued_bytes option, and drop packets when the first limit is
reached.  Option defaults to 0 (disabled) by default.
Support also a max_inflight_bytes variable, with similar behaviour.

Fixes (partof) https://github.com/eclipse/mosquitto/issues/100

This pulls up some helper routines for calculating whether to allow
inflight or queuing, resolving some inconsistences in connection
resumption.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-09-09 17:27:39 +00:00
Roger A. Light
8378fe44cf Update copyrights. 2016-07-08 09:42:24 +01:00
Roger A. Light
1c3988a397 Merge branch 'master' into develop 2016-06-21 23:33:58 +01:00
Roger A. Light
e8185ddaa7 [166] Don't cancel external threads.
libmosquitto shouldn't cancel threads it didn't create. This change
allows us to keep track of whether threads were created by the library
or by external code.

Thanks to Josip Ćavar.

Bug: https://github.com/eclipse/mosquitto/issues/166
2016-05-18 14:05:08 +01:00
Pierre Fersing
44f23252a0 Improve performance with lots of queued message
Split message queue in two queues: in-flight and queued to avoid the
need to iterate over all messages.

Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2016-04-18 16:24:13 +02:00
Roger A. Light
556c629ab5 Don't use reserved names in header guards.
Closes #3.
2016-03-13 18:43:13 +00:00
Roger A. Light
af995d211d Fix client library keepalive handling.
Fix the case where a message received just before the keepalive timer
expired would cause the client to miss the keepalive timer.

Thanks to Graham Benton.
2016-02-28 17:24:43 +00:00
Roger A. Light
fca9ac84f7 Merge fixes into develop. 2016-01-06 21:10:34 +00:00
Roger A. Light
7aa653c42f Add support for libwebsockets 1.6. 2015-12-19 01:21:17 +00:00
Roger Light
e2324ff9bb Merge remote-tracking branch 'remotes/origin/master' into develop
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	THANKS.txt
	appveyor.yml
	config.mk
	installer/mosquitto-cygwin.nsi
	installer/mosquitto.nsi
	lib/messages_mosq.c
	lib/messages_mosq.h
	lib/mosquitto.c
	lib/mosquitto.h
	lib/net_mosq.c
	lib/net_mosq.h
	lib/send_client_mosq.c
	lib/send_mosq.c
	lib/socks_mosq.c
	lib/will_mosq.c
	src/bridge.c
	src/conf.c
	src/context.c
	src/database.c
	src/loop.c
	src/mosquitto.c
	src/mosquitto_broker.h
	src/net.c
	src/read_handle.c
	src/read_handle_server.c
	src/subs.c
2015-09-09 22:02:46 +01:00
Anmol Sarma
13d869b8df Avoid calls to strlen() when checking for empty strings.
Change-Id: I3de322006623483cbf20218da071a9da5d7b2e2b
Signed-off-by: Anmol Sarma <me@anmolsarma.in>
2015-08-17 16:00:16 -04:00
Roger A. Light
cdbe62c2bb Outgoing messages with QoS>0 are no longer retried after a timeout.
This change in behaviour can be justified by considering when the
timeout may have occurred.

* If a connection is unreliable and has dropped, but without one end
  noticing, the messages will be retried on reconnection. Sending
  additional PUBLISH or PUBREL would not have changed anything.

* If a client is overloaded/unable to respond/has a slow connection then
  sending additional PUBLISH or PUBREL would not help the client catch
  up. Once the backlog has cleared the client will respond. If it is not
  able to catch up, sending additional duplicates would not help either.
2015-05-24 11:59:53 +01:00
Roger A. Light
b67c90ec02 Rename internal datatypes. 2015-05-16 19:03:12 +01:00
Roger A. Light
b598aec385 Sys -> user includes. 2015-04-29 21:37:47 +01:00
Roger A. Light
11756d24c8 Change internal funcs _foo_bar() to foo__bar(). 2015-04-19 22:10:59 +01:00
Roger A. Light
46ccc2efe9 [463479] Make _mosquitto_mid_generate() thread safe.
Thanks to bdwalker.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463479
2015-04-03 07:48:55 +01:00
Roger A. Light
dacee786be [463000] Use own type to simplify socket handling.
Means that SOCKET is used as the socket type everywhere on Windows.
2015-03-29 10:43:08 +01:00
Roger A. Light
35b729909c [463241] Fix possible crash under heavy network load.
Thanks to Alexandre Zia.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463241
2015-03-27 01:07:48 +00:00
Roger A. Light
3ed5c94038 Struct optimisations. 2015-02-13 21:17:11 +00:00
Roger A. Light
39ffd6fa36 Handle "error" codes from SSL_connect() correctly. 2015-01-27 23:33:36 +00:00
Roger A. Light
aca979a473 [457371] Fix building for WITH_TLS=no
Thanks to Micheal Laing.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=457371
2015-01-15 20:11:14 +00:00
Roger A. Light
f8f794c531 Allow expiring clients to be cleaned up. 2015-01-06 17:35:12 +00:00
Roger A. Light
db3c016fdd Don't use bridge hash in each client.
Store a DB wide array of bridges. There shouldn't be many of them, so
iterating/searching isn't a problem. Saves 56 bytes in the client
struct.
2014-11-18 23:34:54 +00:00
Roger A. Light
d30d711c3b Improve struct layouts for memory usage. 2014-11-18 07:42:49 +00:00
Roger A. Light
5603d6a44d Remove unused struct members. 2014-10-16 21:47:49 +01:00
Roger A. Light
d2dbe16d68 Client structs store sub information to make _subs_clean_session more efficient. 2014-10-09 23:28:16 +01:00
Roger A. Light
42420cae46 Add experimental SOCKS5 support for the clients. 2014-09-30 00:56:57 +01:00
Roger A. Light
dcd469c177 Use own linked list for storing disused contexts for freeing.
Seemed to be a problem with getting it to work under a hash and there
isn't really any need for a hash.
2014-09-22 23:35:09 +01:00
Roger A. Light
95a4ec431d Don't try to disconnect twice. 2014-07-08 23:16:34 +01:00
Roger A. Light
bdb3e74100 More memory fixes. 2014-06-29 23:16:10 +01:00
Roger A. Light
764b7e0a91 Use hash functions to store client data. 2014-06-23 17:57:35 +01:00
Roger A. Light
4bb7a45b71 Crude, hard coded websockets support. No TLS. 2014-05-06 10:47:00 +01:00
Roger Light
0364bd1be7 Initial contribution. 2014-05-07 23:27:00 +01:00