mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 23:09:08 +01:00
[client] Bind the file drop receiver only while receiving is enabled
The receiver was bound on every engine start regardless of the profile's receiving mode, and a failed bind also left the manager without a tunnel dialer, which took sending down with it. Set the tunnel dialer before the bind so sending no longer depends on it, and gate the bind on the receiving mode. A mode change now notifies the engine, which binds or unbinds accordingly: turning receiving off releases the listeners and the offer store, empties the spool and settles unfinished incoming transfers as cancelled. Also log file drop send and receive failures with the peer and the step that broke, so a failure can be read from the client log alone.
This commit is contained in:
@@ -176,7 +176,8 @@ func (r *receiver) upload(sender senderIdentity, id OfferID, index int, offset i
|
||||
if err != nil {
|
||||
r.offers.SetState(id, StateFailed)
|
||||
r.notifyFailed(offer, err)
|
||||
log.Debugf("stage payload for offer %s file %d: %v", id, index, err)
|
||||
log.Warnf("file drop receive %s from %s: stage payload %d (%s): %v",
|
||||
id, offer.SenderName, index, offer.Files[index].Name, err)
|
||||
return fmt.Errorf("%w: stage payload", ErrStorage)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user