Changeset 761 in code for trunk/upstream.go
- Timestamp:
- Dec 10, 2021, 9:46:41 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r759 r761 620 620 } 621 621 622 // TODO: send response in multiple chunks if >= 400 bytes 623 var respStr = "+" 624 if len(resp) != 0 { 625 respStr = base64.StdEncoding.EncodeToString(resp) 626 } 627 628 uc.SendMessage(ctx, &irc.Message{ 629 Command: "AUTHENTICATE", 630 Params: []string{respStr}, 631 }) 622 // <= instead of < because we need to send a final empty response if 623 // the last chunk is exactly 400 bytes long 624 for i := 0; i <= len(resp); i += maxSASLLength { 625 j := i + maxSASLLength 626 if j > len(resp) { 627 j = len(resp) 628 } 629 630 chunk := resp[i:j] 631 632 var respStr = "+" 633 if len(chunk) != 0 { 634 respStr = base64.StdEncoding.EncodeToString(chunk) 635 } 636 637 uc.SendMessage(ctx, &irc.Message{ 638 Command: "AUTHENTICATE", 639 Params: []string{respStr}, 640 }) 641 } 632 642 case irc.RPL_LOGGEDIN: 633 643 if err := parseMessageParams(msg, nil, nil, &uc.account); err != nil {
Note:
See TracChangeset
for help on using the changeset viewer.