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

ignore server message; handle SIGTERM #3

Merged
merged 2 commits into from Nov 12, 2017
Merged

ignore server message; handle SIGTERM #3

merged 2 commits into from Nov 12, 2017

Conversation

biergaizi
Copy link
Contributor

@biergaizi biergaizi commented Nov 11, 2017

chatlist.py: ignore message without an username

Ignore all messages received without an username, this type of messages
is often used in system notice and should be ignored. Especially, some
servers with mandatory OTR requirement send an error if a non-OTR message
is received, if we reply these automatic messages with an automatic response,
an infinite loop could start and exhaust all system resources.

Signed-off-by: Yifeng Li <tomli@tomli.me>

chatlist.py: handle SIGTERM signal

When using chatlist as a system daemon, a SIGTERM signal is used by
the daemon manager to stop a daemon, but it's not handled in chatlist
and causes chatlist to quit immediately without closing connection or
saving data.

This commit adds a signal handler to call sys.exit() if SIGTERM is
received, effectively converting a SIGTERM to a SystemExit exception.

Signed-off-by: Yifeng Li <tomli@tomli.me>

@m13253
Copy link
Owner

m13253 commented Nov 11, 2017

Conflict with master branch?

Ignore all messages received without an username, this type of messages
is often used in system notice and should be ignored. Especially, some
servers with mandatory OTR requirement send an error if a non-OTR message
is received, if we reply these automatic messages with an automatic response,
an infinite loop could start and exhaust all system resources.

Signed-off-by: Yifeng Li <tomli@tomli.me>
When using chatlist as a system daemon, a SIGTERM signal is used by
the daemon manager to stop a daemon, but it's not handled in chatlist
and causes chatlist to quit immediately without closing connection or
saving data.

This commit adds a signal handler to call sys.exit() if SIGTERM is
received, effectively converting a SIGTERM to a SystemExit exception.

Signed-off-by: Yifeng Li <tomli@tomli.me>
@biergaizi
Copy link
Contributor Author

Merge conflict is resolved.

@m13253 m13253 merged commit 83f3426 into m13253:master Nov 12, 2017
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