From 747ba55f12af7580fe2d00c1d409bde400fa7aab Mon Sep 17 00:00:00 2001 From: freeman Date: Wed, 25 Oct 2023 13:05:00 +0300 Subject: [PATCH 1/2] fix: Set id query param, according to the negotiateVersion --- httpconnection.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/httpconnection.go b/httpconnection.go index 83448b8..46f84e6 100644 --- a/httpconnection.go +++ b/httpconnection.go @@ -113,7 +113,13 @@ func NewHTTPConnection(ctx context.Context, address string, options ...func(*htt } q := reqURL.Query() - q.Set("id", negotiateResponse.ConnectionID) + switch negotiateResponse.NegotiateVersion { + case 0: + q.Set("id", negotiateResponse.ConnectionID) + case 1: + q.Set("id", negotiateResponse.ConnectionToken) + } + reqURL.RawQuery = q.Encode() // Select the best connection From 0480e2df2eb4a7912a85ecefd537b89718a20b8a Mon Sep 17 00:00:00 2001 From: freeman Date: Wed, 25 Oct 2023 14:49:54 +0300 Subject: [PATCH 2/2] fix: Set client status to Closed, when backoff exceeds --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index d92d8e0..4309993 100644 --- a/client.go +++ b/client.go @@ -204,6 +204,7 @@ func (c *client) Start() { nextBackoff := boff.NextBackOff() // Check for exceeded backoff if nextBackoff == backoff.Stop { + c.setState(ClientClosed) c.setErr(errors.New("backoff exceeded")) return }