This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch tmp_disable_reading
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/tmp_disable_reading by this 
push:
     new 05450b5  rebuild the connection when have update
05450b5 is described below

commit 05450b528a990df60ad0cae60008c2fb975ed014
Author: mrproliu <[email protected]>
AuthorDate: Sun Dec 22 10:18:26 2024 +0800

    rebuild the connection when have update
---
 pkg/accesslog/common/connection.go | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/pkg/accesslog/common/connection.go 
b/pkg/accesslog/common/connection.go
index 2a98326..5559761 100644
--- a/pkg/accesslog/common/connection.go
+++ b/pkg/accesslog/common/connection.go
@@ -21,7 +21,6 @@ import (
        "context"
        "errors"
        "fmt"
-       "github.com/gogo/protobuf/proto"
        "sync"
        "time"
 
@@ -352,10 +351,15 @@ func (c *ConnectionManager) 
connectionPostHandle(connection *ConnectionInfo, eve
 // so, we need to clone the message and change it before sending it to the 
channel
 func (c *ConnectionManager) 
rebuildRPCConnectionWithTLSModeAndProtocol(connection *ConnectionInfo,
        tls v3.AccessLogConnectionTLSMode, protocol v3.AccessLogProtocolType) {
-       logConnection := 
proto.Clone(connection.RPCConnection).(*v3.AccessLogConnection)
-       logConnection.TlsMode = tls
-       logConnection.Protocol = protocol
-       connection.RPCConnection = logConnection
+       original := connection.RPCConnection
+       connection.RPCConnection = &v3.AccessLogConnection{
+               Local:      original.Local,
+               Remote:     original.Remote,
+               Role:       original.Role,
+               TlsMode:    tls,
+               Protocol:   protocol,
+               Attachment: original.Attachment,
+       }
 }
 
 func (c *ConnectionManager) ProcessIsMonitor(pid uint32) bool {

Reply via email to