Skip to content

Answer a moderator lookup that finds nothing - #64

Open
tomjn wants to merge 1 commit into
ScarylePoo:masterfrom
tomjn:fix/answer-empty-mod-lookups
Open

tomjn wants to merge 1 commit into
ScarylePoo:masterfrom
tomjn:fix/answer-empty-mod-lookups

Conversation

@tomjn

@tomjn tomjn commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

GETIP, FINDIP, SETBOTMODE and GETUSERINFO each answered with silence in some cases: an IP nobody has used, a name that does not exist, a lookup the caller is not allowed to make. A client cannot tell silence from a lost reply, so it waits out its own timeout and then has to guess, which is a poor way to be told "nothing found".

Each case now gets a line. FINDIP also gets a closing line after a non-empty list, in the shape LISTBANS already uses, so a client knows when the list has ended rather than guessing from a gap in the stream.

The one judgement call is in get_ip, which returned None both for a user who does not exist and for one with no stored address. It now reports the two apart, so GETIP can say which happened without a second query on the reactor thread. The wording of the new lines is not protocol, and I am happy to change any of it.

Fixes #61.

…g to report

Each sent nothing in some cases, so a client could only give up on its own timeout. FINDIP also gains a closing line, so a client knows when the list has ended. get_ip now returns whether the user exists alongside the IP, because a NULL last_ip and a missing user were both None. Fixes ScarylePoo#61.
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.

GETIP, FINDIP, SETBOTMODE and GETUSERINFO send nothing when there is nothing to report

1 participant