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

a question in AMI about can't receive EventList data #35

Open
niaiai opened this issue Mar 10, 2017 · 0 comments · May be fixed by #49
Open

a question in AMI about can't receive EventList data #35

niaiai opened this issue Mar 10, 2017 · 0 comments · May be fixed by #49

Comments

@niaiai
Copy link

niaiai commented Mar 10, 2017

EventList: start judgment conditions have problems .
You should not start with "status will follow" end with "statuscomplete"
I think a good judgment is to start with EventList: start, EventList: Complete end

your code in manager.py 336 line
` if 'status will follow' in line:
status = True
wait_for_marker = True
lines.append(line)

                # line not ending in \r\n or without ':' isn't a
                # valid header and starts multiline response
                if not line.endswith('\r\n') or ':' not in line:
                    multiline = True
                # Response: Follows indicates we should wait for end
                # marker --END COMMAND--
                if not (multiline or status) and line.startswith('Response') and \
                        line.split(':', 1)[1].strip() == 'Follows':
                    wait_for_marker = True
                # same when seeing end of multiline response
                if multiline and (line.startswith('--END COMMAND--') or line.strip().endswith('--END COMMAND--')):
                    wait_for_marker = False
                    multiline = False
                # same when seeing end of status response
                if status and 'StatusComplete' in line:
                    wait_for_marker = False
                    status = False
                if not self._connected.isSet():
                    break`

My advice
` if 'EventList: start' in line:
status = True
wait_for_marker = True
lines.append(line)

                # line not ending in \r\n or without ':' isn't a
                # valid header and starts multiline response
                if not line.endswith('\r\n') or ':' not in line:
                    multiline = True
                # Response: Follows indicates we should wait for end
                # marker --END COMMAND--
                if not (multiline or status) and line.startswith('Response') and \
                        line.split(':', 1)[1].strip() == 'Follows':
                    wait_for_marker = True
                # same when seeing end of multiline response
                if multiline and (line.startswith('--END COMMAND--') or line.strip().endswith('--END COMMAND--')):
                    wait_for_marker = False
                    multiline = False
                # same when seeing end of status response
                if status and 'EventList: Complete' in line:
                    wait_for_marker = False
                    status = False
                if not self._connected.isSet():
                    break`
@j0hen j0hen linked a pull request Jul 10, 2020 that will close this issue
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 a pull request may close this issue.

1 participant