server shouldn't crash when a user connects with no nick

master
Jordan Orelli 10 years ago
parent 5c131aabd2
commit 56bdc5e6b0

@ -72,7 +72,7 @@ func (s *serverConnection) handleAuthRequest(requestId int, body json.RawMessage
s.key = auth.Key s.key = auth.Key
// s.sendMeta("hello, %s", auth.Nick) // s.sendMeta("hello, %s", auth.Nick)
if err := s.openDB(); err != nil { if err := s.openDB(); err != nil {
error_log.Printf("failed to open database: %v", err) return fmt.Errorf("failed to open user database: %v", err)
} }
b, err := s.db.Get([]byte("public_key"), nil) b, err := s.db.Get([]byte("public_key"), nil)
switch err { switch err {

@ -8,7 +8,7 @@ import (
"os" "os"
) )
const keyLength = 4096 const keyLength = 2048
var ( var (
info_log *log.Logger info_log *log.Logger

Loading…
Cancel
Save