1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-28 01:16:10 +03:00

don't show error on 1005

This commit is contained in:
Zack Scholl 2018-09-21 21:40:39 -07:00
parent 24493cf7f5
commit b6b6b754c9
3 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ func (c *Croc) Receive(codephrase string) (err error) {
log.Debug(errDiscover) log.Debug(errDiscover)
} }
if len(discovered) > 0 { if len(discovered) > 0 {
log.Debugf("discovered %s on %s", discovered[0].Payload, discovered[0].Address) log.Debugf("discovered %s:%s", discovered[0].Address, discovered[0].Payload)
errChan <- c.sendReceive(fmt.Sprintf("ws://%s:%s", discovered[0].Address, discovered[0].Payload), "", codephrase, false) errChan <- c.sendReceive(fmt.Sprintf("ws://%s:%s", discovered[0].Address, discovered[0].Payload), "", codephrase, false)
} else { } else {
log.Debug("discovered no peers") log.Debug("discovered no peers")

View File

@ -28,7 +28,7 @@ func Receive(done chan struct{}, c *websocket.Conn, codephrase string) {
logger.SetLogLevel(DebugLevel) logger.SetLogLevel(DebugLevel)
err := receive(c, codephrase) err := receive(c, codephrase)
if err != nil { if err != nil {
if strings.HasPrefix(err.Error(), "websocket: close 1005") { if strings.HasPrefix(err.Error(), "websocket: close 100") {
return return
} }
log.Error(err) log.Error(err)

View File

@ -30,7 +30,7 @@ func Send(done chan struct{}, c *websocket.Conn, fname string, codephrase string
log.Debugf("sending %s", fname) log.Debugf("sending %s", fname)
err := send(c, fname, codephrase) err := send(c, fname, codephrase)
if err != nil { if err != nil {
if strings.HasPrefix(err.Error(), "websocket: close 1005") { if strings.HasPrefix(err.Error(), "websocket: close 100") {
return return
} }
log.Error(err) log.Error(err)