You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Data races on shared conn/reader; GUI transfer blocks the message loop and cannot be cancelled #22
the "connection refused" branch (around line 125) re-assigns the shared conn variable and re-dials while the background resend goroutine (started around line 96) still uses the old conn and the same bufio.Reader — unsynchronized read/write on conn and concurrent use of one bufio.Reader. Running with -race will flag this.
GUI side (ui/main.go):
the wait case runs waiter.Start(msg) synchronously inside w.OnMessage(...) — the message handler blocks until the whole transfer finishes, so the window cannot process any further messages meanwhile,
stopWait is explicitly unimplemented (fmt.Println("not support stop wait")), so a running receive/send cannot be cancelled from the UI at all.
Suggested fix
give each goroutine its own conn/reader, or guard them with a mutex; re-create the bufio.Reader after Seek (or use f.ReadAt, which needs no reader state),
run transfers in their own goroutine with a context.Context; implement stopWait by cancelling that context.
Activity