Skip to content

Implemented fix proposed by Kevalz95, Issue #564, in modbus_server.py#613

Open
MotherFraggr wants to merge 2 commits into
mushorg:mainfrom
MotherFraggr:main
Open

Implemented fix proposed by Kevalz95, Issue #564, in modbus_server.py#613
MotherFraggr wants to merge 2 commits into
mushorg:mainfrom
MotherFraggr:main

Conversation

@MotherFraggr

Copy link
Copy Markdown

This pull request implements a fix to the while-loop issue in modbus_server.py that was recommended inside of Issue #564. This has been tested within a Docker container given a public IP address and has alleviated the issue with crashing that was present before.

@glaslos

glaslos commented May 3, 2026

Copy link
Copy Markdown
Member

@MotherFraggr thank you for the contribution. Could you review the failing check?

@MotherFraggr

Copy link
Copy Markdown
Author

@glaslos - I reformatted the file based on the failing Black check, is there a way to run these checks locally if I have future contributions? Thanks!

# Adds stall counter to prevent infinite loop on malformed requests
while len(request) < (length + 6):
try:
if previous_request and len(previous_request) == len(request):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this will be always true on the second iteration.
Check request length before and after recv()

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.

2 participants