@@ -43,8 +43,8 @@ func NewClient(protoOptions protocol.ProtocolOptions, cfg *Config) *Client {
4343 }
4444 // Configure underlying Protocol
4545 protoConfig := protocol.ProtocolConfig {
46- Name : protocolName ,
47- ProtocolId : protocolId ,
46+ Name : ProtocolName ,
47+ ProtocolId : ProtocolId ,
4848 Muxer : protoOptions .Muxer ,
4949 ErrorChan : protoOptions .ErrorChan ,
5050 Mode : protoOptions .Mode ,
@@ -86,7 +86,7 @@ func (c *Client) handleMessage(msg protocol.Message, isResponse bool) error {
8686 case MessageTypeRefuse :
8787 err = c .handleRefuse (msg )
8888 default :
89- err = fmt .Errorf ("%s: received unexpected message type %d" , protocolName , msg .Type ())
89+ err = fmt .Errorf ("%s: received unexpected message type %d" , ProtocolName , msg .Type ())
9090 }
9191 return err
9292}
@@ -112,11 +112,11 @@ func (c *Client) handleRefuse(msgGeneric protocol.Message) error {
112112 var err error
113113 switch msg .Reason [0 ].(uint64 ) {
114114 case RefuseReasonVersionMismatch :
115- err = fmt .Errorf ("%s: version mismatch" , protocolName )
115+ err = fmt .Errorf ("%s: version mismatch" , ProtocolName )
116116 case RefuseReasonDecodeError :
117- err = fmt .Errorf ("%s: decode error: %s" , protocolName , msg .Reason [2 ].(string ))
117+ err = fmt .Errorf ("%s: decode error: %s" , ProtocolName , msg .Reason [2 ].(string ))
118118 case RefuseReasonRefused :
119- err = fmt .Errorf ("%s: refused: %s" , protocolName , msg .Reason [2 ].(string ))
119+ err = fmt .Errorf ("%s: refused: %s" , ProtocolName , msg .Reason [2 ].(string ))
120120 }
121121 return err
122122}
0 commit comments