Skip to content

_updateMaxLineLength() can be called before 001#286

Closed
bcome wants to merge 1 commit intomartynsmith:masterfrom
bcome:fixUpdateMaxLineLength
Closed

_updateMaxLineLength() can be called before 001#286
bcome wants to merge 1 commit intomartynsmith:masterfrom
bcome:fixUpdateMaxLineLength

Conversation

@bcome
Copy link
Copy Markdown
Contributor

@bcome bcome commented Jan 10, 2015

Fix _updateMaxLineLength() to not crash when this.hostMask is not set yet.

@jirwin
Copy link
Copy Markdown
Collaborator

jirwin commented Jan 10, 2015

It may be better to default the hostmask to an empty string for any other places that assume it's type.

@ghost ghost changed the title Fix _updateMaxLineLength() _updateMaxLineLength() can be called before 001 Jan 11, 2015
@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2015

The semantics here are:

  • client connects to IRC and requests botNick
  • botNick is in use, server sends 433
  • client receives 433, appends self.opt.nickmod, calls _updateMaxLineLength()
  • since this happens before the client receives 001, the client has not set self.hostMask
  • kaboom

A separate, unrelated issue discovered while troubleshooting this is that many ircds do not send a meaningful hostname as part of their 001, so we'll need to think of a proper way of handling that.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2015

Per @jirwin's suggestion, I implemented this as an empty string assignment.

@ghost ghost closed this Jan 11, 2015
@bcome bcome deleted the fixUpdateMaxLineLength branch January 11, 2015 13:34
This pull request was closed.
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.

3 participants