<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Publish error (-2) with large payloads]]></title>
		<link>https://www.wolfssl.com/forums/topic1814-publish-error-2-with-large-payloads.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1814.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Publish error (-2) with large payloads.]]></description>
		<lastBuildDate>Tue, 05 Oct 2021 13:17:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Publish error (-2) with large payloads]]></title>
			<link>https://www.wolfssl.com/forums/post6294.html#p6294</link>
			<description><![CDATA[<p>Hi Kelvin,</p><p>Thanks for your post. We did fix a chunked publish issue since the v1.9.0 release:<br /><a href="https://github.com/wolfSSL/wolfMQTT/pull/230">https://github.com/wolfSSL/wolfMQTT/pull/230</a></p><p>Would you mind checking with the latest revision from GitHub? If the issue persists, we can open an issue for better tracking.</p><p>Thanks,<br />Eric @ wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Tue, 05 Oct 2021 13:17:17 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6294.html#p6294</guid>
		</item>
		<item>
			<title><![CDATA[Publish error (-2) with large payloads]]></title>
			<link>https://www.wolfssl.com/forums/post6293.html#p6293</link>
			<description><![CDATA[<p>I came across this issue as I was trying to hunt down a different potential issue in the library.<br />Normally, I would not bother the MQTT guys about a configuration issue, <br />except for the fact that the other potential issue also manifests itself when using large payloads.<br />So there may be an associated aspect (concerning client buffers) between this issue and the more serious potential issue that I am encountering.</p><p>Back to this issue:<br />I was testing the new non-blocking &quot;Publish Continue&quot; feature in the MQTT v1.9.0 release.<br />This feature allows the application to identify when more tx data is pending for transmission to the network.</p><p>Some buffer sizes were changed to help invoke the new feature.<br />1. network maximum tx size&nbsp; (defined by application stacks)<br />2. client tx buffer length&nbsp; &nbsp; &nbsp; &nbsp; (defined by library&#039;s MAX_BUFFER_SIZE)<br />3. publish payload size&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (test publish message, with a large amount of data)</p><p>The full transfer size is mqtt header (40bytes) + payload (2000 bytes).</p><p>Summary of investigation:<br />Net size&nbsp; &nbsp;Buf len&nbsp; &nbsp;Payload&nbsp; &nbsp;Transfer sequence<br />1024&nbsp; &nbsp; &nbsp; &nbsp;1000&nbsp; &nbsp; &nbsp; 2000&nbsp; &nbsp; &nbsp; 1000 + 1000 + pubContinue + 40<br />1000&nbsp; &nbsp; &nbsp; &nbsp;1000&nbsp; &nbsp; &nbsp; 2000&nbsp; &nbsp; &nbsp; 1000 + 1000 + pubContinue + 40<br />980&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1000&nbsp; &nbsp; &nbsp; 2000&nbsp; &nbsp; &nbsp; 980 + 20 + 980 + pubContinue + error(-2)</p><p>With certain buffer sizes and large payload sizes, the library returned error (-2), created at line 155 in the mqtt_socket.c file.<br />I retested the above conditions with the MQTT v1.8.0 library, which also exhibited the same results (with pubContinue replaced with the normal Continue).</p><p>The simple solution is to ensure that the &quot;Network Tx Size is large enough to consume the entire Client Buffer Size&quot;.<br />It could be a Feature Request, but I doubt if it is really worthwhile modifying the library to deal with the small &quot;Network Tx Size&quot; case.</p><p>So this post is just an Advisory Note for users to &quot;carefully&quot; configure their system with this aspect in mind, when sending large payloads.<br />Kelvin</p>]]></description>
			<author><![CDATA[null@example.com (Kelvin)]]></author>
			<pubDate>Tue, 05 Oct 2021 10:41:21 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6293.html#p6293</guid>
		</item>
	</channel>
</rss>
