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

Conversation

Projects
None yet
2 participants
@biergaizi
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@m13253

m13253 Nov 11, 2017

Owner

Conflict with master branch?

Owner

m13253 commented Nov 11, 2017

Conflict with master branch?

biergaizi added some commits Nov 12, 2017

chatlist.py: ignore message without an username (server message)
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>
@biergaizi

This comment has been minimized.

Show comment
Hide comment
@biergaizi

biergaizi Nov 12, 2017

Contributor

Merge conflict is resolved.

Contributor

biergaizi commented Nov 12, 2017

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