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

Add workaround for long keys= in mqtt-publisher #3098

Closed

Conversation

ondras12345
Copy link
Contributor

This fixes #3084 (but I would prefer to see a better solution, this feels like an ugly workaround).

@ondras12345 ondras12345 marked this pull request as draft August 31, 2024 14:43
@petterreinholdtsen
Copy link
Collaborator

petterreinholdtsen commented Aug 31, 2024 via email

@ondras12345
Copy link
Contributor Author

ondras12345 commented Aug 31, 2024

Previously, the initialization of keys with an empty dict would be unused as keys was reassigned with a new list:

keys = extra.split('=')[1].split(',')

There should be no change in behavior regarding duplicates with my patch.

That being said, it might be a good idea to use a set instead of a list to drop duplicates (but that introduces a change in behavior).

The only warning I encountered was this:

warning: Missing pin halui.mist.is-o not sent to MQTT

It comes from the mqtt-publisher process and was only printed to my terminal. It might also happen that the list of keys will get cropped at the position of a comma. In that case, there would be no warning whatsoever.

@andypugh andypugh marked this pull request as ready for review September 1, 2024 15:08
@andypugh andypugh changed the base branch from master to 2.9 September 1, 2024 15:14
@andypugh andypugh changed the base branch from 2.9 to master September 1, 2024 15:15
@andypugh andypugh closed this in 9eb94c3 Sep 1, 2024
@andypugh
Copy link
Collaborator

andypugh commented Sep 1, 2024

I rebased this on 2.9 and committed as 317595e
And, then in master I committed what I think is a more elegant fix: 9eb94c3

I left in the ability to specify multiple keys= sections.

smoe pushed a commit to smoe/linuxcnc that referenced this pull request Sep 2, 2024
The length of any single token in HAL is limited to LINELEN (255 chars)
even though line continuation support means that individual commands can
be up to MAX_EXTEND_LINES (20) times this length.
This patch increments the buffer size by LINELEN until there is plenty of
space (to allow for tilde expansion)
Fixes LinuxCNC#3098
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.

Cannot use a long list of keys with mqtt-publisher
3 participants