/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2019 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2020 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
sdsp["size"] = int64(ourSize)
sdsp["fullsize"] = fullSize
if state.Ctx.ShowPrgrs {
- Progress(sdsp)
+ Progress("Tx", sdsp)
}
state.Lock()
if len(state.queueTheir) > 0 && *state.queueTheir[0].freq.Hash == *freq.Hash {
conn.SetReadDeadline(time.Now().Add(DefaultDeadline * time.Second))
payload, err := state.ReadSP(conn)
if err != nil {
+ if err == io.EOF {
+ break
+ }
unmarshalErr := err.(*xdr.UnmarshalError)
netErr, ok := unmarshalErr.Err.(net.Error)
if ok && netErr.Timeout() {
sdsp["size"] = int64(ourSize)
sdsp["fullsize"] = int64(state.infosTheir[*file.Hash].Size)
if state.Ctx.ShowPrgrs {
- Progress(sdsp)
+ Progress("Rx", sdsp)
}
if state.infosTheir[*file.Hash].Size != ourSize {
state.RUnlock()