Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for non-blocking with larger payload and improvements to the test and examples #373

Merged
merged 9 commits into from
Nov 28, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Nov 22, 2023

  • Fix for continue during variable part of the header. A continue in the middle of variable would not correctly process for large messages.
  • Fixed issue with QoS2 on received publish ACK getting skipped if write is already locked.
  • Further improve WOLFMQTT_TEST_NONBLOCK.
  • Added logic for detection of active read or write to return MQTT_CODE_CONTINUE.
  • By default keep mutex locked if we tried to write. The wolfSSL TLS engine requires an SSL_Write that returns WANT_WRITE to be called with the same buffer/sz, not a different one, even if no data was sent. If user wants to enable the feature anyways they can use WOLFMQTT_ALLOW_NODATA_UNLOCK. Only the write has this logic as the issue doesn't exist for an SSL_Read.
  • Fixes for using the -f [file] option with examples.
  • Allow build-time override of MAX_BUFFER_SIZE in examples.
  • Add packet_id to the publish log message in examples.
  • Add test case for trying to send multiple publishes in the same thread.
    ZD 16769

@dgarske dgarske self-assigned this Nov 22, 2023
@dgarske
Copy link
Contributor Author

dgarske commented Nov 22, 2023

FYI: I can reproduce the error locally. Getting a disconnected due to protocol error from broker, which for some reason leaves the local broker instance running still:

Broker PID is 29060
1700688555: mosquitto version 2.0.11 starting
1700688555: Config loaded from scripts/broker_test/mosquitto.conf.
1700688555: Opening ipv4 listen socket on port 11883.
1700688555: Opening ipv6 listen socket on port 11883.
1700688555: Opening ipv4 listen socket on port 18883.
1700688555: Opening ipv6 listen socket on port 18883.
1700688555: mosquitto version 2.0.11 running
Base args: -T -C 2000 -h localhost -p 11883
1700688555: New connection from 127.0.0.1:39066 on port 11883.
1700688555: Client <unknown> disconnected due to protocol error.
MQTT Client: QoS 0, Use TLS 0
MQTT Net Init: Success (0)
MQTT Init: Success (0)
NetConnect: Host localhost, Port 11883, Timeout 5000 ms, Use TLS 0
MQTT Socket Connect: Success (0)
MQTT Connect: Proto (v3.1.1), Continue (-101)
MQTT Disconnect: Success (0)
MQTT Socket Disconnect: Success (0)
1700688555: New connection from 127.0.0.1:39072 on port 11883.
1700688555: Client <unknown> disconnected due to protocol error.

Will investigate on Friday.

@dgarske
Copy link
Contributor Author

dgarske commented Nov 24, 2023

Tests with TLS and non-block are failing due to this bug -> wolfSSL/wolfssl#7001

…gine requires an SSL_Write that returns WANT_WRITE to be called with the same buffer/sz, not a different one, even if no data was sent. If user wants to enable the feature anyways they can use `WOLFMQTT_ALLOW_NODATA_UNLOCK`. Only the write that has this logic as the issue doesn't exist for an SSL_Read.
…r trying to send multiple publishes in the same thread.
@dgarske dgarske requested a review from embhorn November 27, 2023 22:12
Copy link
Member

@embhorn embhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update - needed to update wolfSSL first!

-----Ignore----
Seeing failures with
./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK"

ASS: scripts/client.test
FAIL: scripts/multithread.test
PASS: scripts/firmware.test
PASS: scripts/awsiot.test
FAIL: scripts/nbclient.test
PASS: scripts/azureiothub.test

@embhorn embhorn self-requested a review November 27, 2023 22:27
@dgarske dgarske assigned embhorn and unassigned dgarske Nov 28, 2023
@dgarske
Copy link
Contributor Author

dgarske commented Nov 28, 2023

Customer is fully happy. No outstanding issues. This PR is ready for merge.

@embhorn embhorn merged commit 3b93bdb into wolfSSL:master Nov 28, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants