/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2023 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
return nil
}
-func (state *SPState) Wait() {
+func (state *SPState) Wait() bool {
state.wg.Wait()
close(state.payloads)
close(state.pings)
if txDuration > 0 {
state.TxSpeed = state.TxBytes / txDuration
}
+ nothingLeft := len(state.queueTheir) == 0
for _, s := range state.fds {
+ nothingLeft = false
s.fd.Close()
}
for pktName := range state.progressBars {
ProgressKill(pktName)
}
+ return nothingLeft
}
func (state *SPState) ProcessSP(payload []byte) ([][]byte, error) {