1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-24 16:23:47 +03:00

exit on EOF

This commit is contained in:
Zack Scholl 2019-11-18 13:15:41 -08:00
parent d0c2dc1be8
commit b9b3995f02

View File

@ -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)
}
@ -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