Closed Fryyyyy closed 5 years ago
Can you provide any code than can easily reproduce this?
Minimal test case:
import (
"flag"
"fmt"
"time"
hbot "github.com/whyrusleeping/hellabot"
log "gopkg.in/inconshreveable/log15.v2"
)
func main() {
noHijackSession := func(bot *hbot.Bot) {
bot.HijackSession = false
}
prodChannels := func(bot *hbot.Bot) {
bot.Channels = []string{"#frybottest"}
}
yesSSLOptions := func(bot *hbot.Bot) {
bot.SSL = true
}
saslOptions := func(bot *hbot.Bot) {
bot.SASL = true
bot.Password = "<REDACTED>"
}
timeOut := func(bot *hbot.Bot) {
bot.ThrottleDelay = 300 * time.Millisecond
}
sslServ := flag.String("server", "irc.freenode.net:6697", "hostname and port for irc server to connect to")
nick := flag.String("nick", "Fryatog", "nickname for the bot")
bot, err := hbot.NewBot(*sslServ, *nick, noHijackSession, prodChannels, yesSSLOptions, saslOptions, timeOut)
if err != nil {
panic(err)
}
bot.Logger.SetHandler(log.StdoutHandler)
bot.Run()
fmt.Println("Bot shutting down.")
}
Gives the following output:
DBUG[01-05|19:09:22] Connecting id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog
INFO[01-05|19:09:23] Connected successfully! id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog
DBUG[01-05|19:09:23] Beginning SASL Authentication id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog
DBUG[01-05|19:09:23] Outgoing id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog data="CAP RE Q :sasl"
DBUG[01-05|19:09:23] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw=":watson .freenode.net NOTICE * :*** Looking up your hostname..." msg.To=* msg.From=watson.freenode.net msg.Params=[*] msg.Trailing="*** Lookin g up your hostname..."
DBUG[01-05|19:09:23] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw=":watson .freenode.net NOTICE * :*** Checking Ident" msg.To=* msg.From=watson.freenode.net msg.Params=[*] msg.Trailing="*** Checking Ident"
DBUG[01-05|19:09:23] Outgoing id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog data="NICK F ryatog"
DBUG[01-05|19:09:24] Outgoing id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog data="USER F ryatog 8 * :Fryatog"
DBUG[01-05|19:09:24] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw=":watson .freenode.net NOTICE * :*** Found your hostname" msg.To=* msg.From=watson.freenode.net msg.Params=[*] msg.Trailing="*** Found your hos tname"
DBUG[01-05|19:09:32] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw=":watson .freenode.net NOTICE * :*** No Ident response" msg.To=* msg.From=watson.freenode.net msg.Params=[*] msg.Trailing="*** No Ident respons e"
DBUG[01-05|19:09:32] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw=":watson .freenode.net CAP * ACK :sasl " msg.To=* msg.From=watson.freenode.net msg.Params="[* ACK]" msg.Trailing="sasl "
DBUG[01-05|19:10:00] Incoming id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog raw="ERROR :Closing Link:hostname.com.au (Connection timed out)" msg.To= msg.From= msg.Params=[] msg.Trailing="Closing Link: hostname.com.au (Connection timed out)"
DBUG[01-05|19:10:00] Recieved SASL ACK id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog
DBUG[01-05|19:10:00] Got auth message! id=08d1618e9c28aa61 host=irc.freenode.net:6697 nick=Fryatog
Bot shutting down.
Were you able to repro?
@Fryyyyy Haven't had a chance to check this out yet.
@icholy Ping for the pull request that we've tested works
While trying to connect to Freenode using SSL and SASL, it seems the server times out and closes our link - and then we realise we actually did receive the ACK packet: