X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/361928c9ad8945d525534e3d7178755f49ff6c1f..f0e5040e02adc26e25cb54cd345fd3989b25f0a3:/hotline/server.go diff --git a/hotline/server.go b/hotline/server.go index 8d6803b..164b93e 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -749,6 +749,10 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro delete(s.fileTransfers, t.ReferenceNumber) s.mux.Unlock() + // Wait a few seconds before closing the connection: this is a workaround for problems + // observed with Windows clients where the client must initiate close of the TCP connection before + // the server does. This is gross and seems unnecessary. TODO: Revisit? + time.Sleep(3 * time.Second) }() s.mux.Lock() @@ -783,7 +787,9 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro case FileDownload: s.Stats.DownloadCounter += 1 s.Stats.DownloadsInProgress += 1 - defer func() { s.Stats.DownloadsInProgress -= 1 }() + defer func() { + s.Stats.DownloadsInProgress -= 1 + }() var dataOffset int64 if fileTransfer.fileResumeData != nil {