start of DCC implementation

(server side)

small refactoring and added speed calculation

fixup! small refactoring and added speed calculation

download progress

fixup! download progress
This commit is contained in:
Dario Piombo 2020-05-03 17:00:41 +02:00
parent 9581a63e81
commit ed2e56948e
7 changed files with 248 additions and 1 deletions

View file

@ -70,6 +70,9 @@ func connectIRC(server *storage.Server, state *State, srcIP []byte) *irc.Client
}
}
i.DownloadFolder = cfg.DownloadFolder
i.Autoget = cfg.Autoget
state.setIRC(server.Host, i)
i.Connect(address)
go newIRCHandler(i, state).run()

View file

@ -63,6 +63,8 @@ func (i *ircHandler) run() {
} else if state.Connected {
i.log("Connected")
}
case progress := <-i.client.Progress:
i.state.sendJSON("progress", progress.ToJSON())
}
}
}