Skip to content

Commit

Permalink
exit on EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Nov 18, 2019
1 parent d0c2dc1 commit b9b3995
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/croc/croc.go
Expand Up @@ -282,6 +282,8 @@ func (c *Client) transferOverLocalRelay(options TransferOptions, errchan chan<-
data, _ := conn.Receive()
if bytes.Equal(data, []byte("handshake")) {
break
} else if bytes.Equal(data, []byte{1}) {
log.Debug("got ping")
} else {
log.Debugf("instead of handshake got: %s", data)
}
Expand Down Expand Up @@ -393,7 +395,7 @@ func (c *Client) Send(options TransferOptions) (err error) {
log.Debugf("error from errchan: %s", err.Error())
}
if !c.Options.DisableLocal {
if strings.Contains(err.Error(), "refusing files") {
if strings.Contains(err.Error(), "refusing files") || strings.Contains(err.Error(), "EOF") {
errchan <- err
}
err = <-errchan
Expand Down

0 comments on commit b9b3995

Please sign in to comment.