aboutsummaryrefslogtreecommitdiff
path: root/hotline/server.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2025-12-05 18:42:57 -0800
committerJeff Halter <868228+jhalter@users.noreply.github.com>2025-12-05 18:42:57 -0800
commit472ec3556a66530e7d2255f75ced81cbbf3a1c74 (patch)
treeb9c39907d0a9056cd706a9c6fcde534b6e065ac4 /hotline/server.go
parente4bdf40802188262c1049edfd41a19bbe76e632e (diff)
Improve error handling, logging, and fix race condition in Disconnect
- Add logging for unhandled transaction types in Client.HandleTransaction - Fix race condition in Client.Disconnect by protecting done channel with mutex - Add TranServerMsg to transaction type names map - Use Time type instead of raw byte array in File.flattenedFileObject - Improve error message in handleFileTransfer to include reference number - Simplify return statement in HandleGetFileInfo
Diffstat (limited to 'hotline/server.go')
-rw-r--r--hotline/server.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go
index 9b74d99..d797c1e 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -7,7 +7,6 @@ import (
"crypto/rand"
"crypto/tls"
"encoding/binary"
- "errors"
"fmt"
"io"
"log"
@@ -677,7 +676,7 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro
fileTransfer := s.FileTransferMgr.Get(t.ReferenceNumber)
if fileTransfer == nil {
- return errors.New("invalid transaction ID")
+ return fmt.Errorf("invalid transaction ID: %v", t.ReferenceNumber)
}
defer func() {