From 05f5a7e176014209b1a88a28a5c433dd9f3a249c Mon Sep 17 00:00:00 2001 From: Gareth George Date: Thu, 24 Jul 2025 22:56:19 -0700 Subject: [PATCH] working tunneling --- internal/api/syncapi/handler_test.go | 1 - internal/api/syncapi/tunnel/connstate.go | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/api/syncapi/handler_test.go b/internal/api/syncapi/handler_test.go index af32eaed..3234a33a 100644 --- a/internal/api/syncapi/handler_test.go +++ b/internal/api/syncapi/handler_test.go @@ -66,7 +66,6 @@ func TestHandler(t *testing.T) { } t.Log("Connection is ready") - client := v1syncconnect.NewSyncPeerServiceClient(tunnel.NewWrappedStreamClient(wrapped), "https://localhost:80") resp, err := client.GetOperationMetadata(ctx, connect.NewRequest(&v1.OpSelector{ OriginalInstanceKeyid: proto.String("test-instance-key-id"), diff --git a/internal/api/syncapi/tunnel/connstate.go b/internal/api/syncapi/tunnel/connstate.go index c52f4e9b..dac40aee 100644 --- a/internal/api/syncapi/tunnel/connstate.go +++ b/internal/api/syncapi/tunnel/connstate.go @@ -195,8 +195,7 @@ func (c *connState) SetReadDeadline(t time.Time) error { if c.readDeadlineTimer != nil { c.readDeadlineTimer.Stop() } - if t.IsZero() { - c.readDeadlineTimer = nil + if t.Before(time.Now()) { return nil } c.readDeadlineTimer = time.AfterFunc(time.Until(t), func() {