Security Update #6
|
@ -132,10 +132,18 @@ func populateChat(conn net.Conn) {
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
for scanner.Scan() {
|
// For WHATEVER reason, writing to a TLS-based conn here appends newlines by default,
|
||||||
conn.Write([]byte(fmt.Sprintln(scanner.Text())))
|
// so we have to split it off here to avoid ending up with chat logs full of
|
||||||
|
// unnecessary newlines
|
||||||
|
if servInsecure == true {
|
||||||
|
for scanner.Scan() {
|
||||||
|
conn.Write([]byte(fmt.Sprintln(scanner.Text())))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for scanner.Scan() {
|
||||||
|
conn.Write([]byte(fmt.Sprint(scanner.Text())))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPasswd(conn net.Conn) error {
|
func getPasswd(conn net.Conn) error {
|
||||||
|
|
Loading…
Reference in New Issue