|
@@ -9,7 +9,6 @@ import (
|
9
|
9
|
"bufio"
|
10
|
10
|
"crypto/tls"
|
11
|
11
|
"fmt"
|
12
|
|
- "math/rand"
|
13
|
12
|
"net"
|
14
|
13
|
"net/http"
|
15
|
14
|
_ "net/http/pprof"
|
|
@@ -371,13 +370,7 @@ func (server *Server) createListener(addr string, tlsConfig *tls.Config, bindMod
|
371
|
370
|
|
372
|
371
|
// generateMessageID returns a network-unique message ID.
|
373
|
372
|
func (server *Server) generateMessageID() string {
|
374
|
|
- // we don't need the full like 30 chars since the unixnano below handles
|
375
|
|
- // most of our uniqueness requirements, so just truncate at 5
|
376
|
|
- lastbit := strconv.FormatInt(rand.Int63(), 36)
|
377
|
|
- if 5 < len(lastbit) {
|
378
|
|
- lastbit = lastbit[:4]
|
379
|
|
- }
|
380
|
|
- return fmt.Sprintf("%s%s", strconv.FormatInt(time.Now().UTC().UnixNano(), 36), lastbit)
|
|
373
|
+ return utils.GenerateSecretToken()
|
381
|
374
|
}
|
382
|
375
|
|
383
|
376
|
//
|