Changeset 125 in code for trunk/downstream.go
- Timestamp:
- Mar 19, 2020, 1:51:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r124 r125 398 398 if !dc.caps["sasl"] { 399 399 return ircError{&irc.Message{ 400 Command: err_saslfail,400 Command: irc.ERR_SASLFAIL, 401 401 Params: []string{"*", "AUTHENTICATE requires the \"sasl\" capability to be enabled"}, 402 402 }} … … 404 404 if len(msg.Params) == 0 { 405 405 return ircError{&irc.Message{ 406 Command: err_saslfail,406 Command: irc.ERR_SASLFAIL, 407 407 Params: []string{"*", "Missing AUTHENTICATE argument"}, 408 408 }} … … 410 410 if dc.nick == "" { 411 411 return ircError{&irc.Message{ 412 Command: err_saslfail,412 Command: irc.ERR_SASLFAIL, 413 413 Params: []string{"*", "Expected NICK command before AUTHENTICATE"}, 414 414 }} … … 425 425 default: 426 426 return ircError{&irc.Message{ 427 Command: err_saslfail,427 Command: irc.ERR_SASLFAIL, 428 428 Params: []string{"*", fmt.Sprintf("Unsupported SASL mechanism %q", mech)}, 429 429 }} … … 432 432 dc.saslServer = nil 433 433 return ircError{&irc.Message{ 434 Command: err_saslaborted,434 Command: irc.ERR_SASLABORTED, 435 435 Params: []string{"*", "SASL authentication aborted"}, 436 436 }} … … 444 444 dc.saslServer = nil 445 445 return ircError{&irc.Message{ 446 Command: err_saslfail,446 Command: irc.ERR_SASLFAIL, 447 447 Params: []string{"*", "Invalid base64-encoded response"}, 448 448 }} … … 455 455 if ircErr, ok := err.(ircError); ok && ircErr.Message.Command == irc.ERR_PASSWDMISMATCH { 456 456 return ircError{&irc.Message{ 457 Command: err_saslfail,457 Command: irc.ERR_SASLFAIL, 458 458 Params: []string{"*", ircErr.Message.Params[1]}, 459 459 }} … … 461 461 dc.SendMessage(&irc.Message{ 462 462 Prefix: dc.srv.prefix(), 463 Command: err_saslfail,463 Command: irc.ERR_SASLFAIL, 464 464 Params: []string{"*", "SASL error"}, 465 465 }) … … 469 469 dc.SendMessage(&irc.Message{ 470 470 Prefix: dc.srv.prefix(), 471 Command: rpl_loggedin,471 Command: irc.RPL_LOGGEDIN, 472 472 Params: []string{dc.nick, dc.nick, dc.user.Username, "You are now logged in"}, 473 473 }) 474 474 dc.SendMessage(&irc.Message{ 475 475 Prefix: dc.srv.prefix(), 476 Command: rpl_saslsuccess,476 Command: irc.RPL_SASLSUCCESS, 477 477 Params: []string{dc.nick, "SASL authentication successful"}, 478 478 })
Note:
See TracChangeset
for help on using the changeset viewer.