@@ -129,9 +129,9 @@ type ShadowsocksTCPMetrics interface {
129129// TODO(fortuna): Offer alternative transports.
130130func NewShadowsocksStreamAuthenticator (ciphers CipherList , replayCache * ReplayCache , metrics ShadowsocksTCPMetrics ) StreamAuthenticateFunc {
131131 return func (clientConn transport.StreamConn ) (string , transport.StreamConn , * onet.ConnectionError ) {
132- bufConn := onet .NewBufferedConn (clientConn )
132+ bufConn := onet .NewBufConn (clientConn )
133133 // Find the cipher and acess key id.
134- cipherEntry , clientSalt , timeToCipher , keyErr := findAccessKey (bufConn .R , remoteIP (bufConn ), ciphers )
134+ cipherEntry , clientSalt , timeToCipher , keyErr := findAccessKey (bufConn .Reader , remoteIP (bufConn ), ciphers )
135135 metrics .AddTCPCipherSearch (keyErr == nil , timeToCipher )
136136 if keyErr != nil {
137137 const status = "ERR_CIPHER"
@@ -279,7 +279,7 @@ func (h *tcpHandler) Handle(ctx context.Context, clientConn transport.StreamConn
279279 logger .Debugf ("Done with status %v, duration %v" , status , connDuration )
280280}
281281
282- func getProxyRequest (bufConn onet.BufferedConn ) (string , error ) {
282+ func getProxyRequest (bufConn onet.BufConn ) (string , error ) {
283283 firstByte , err := bufConn .Peek (1 )
284284 if err != nil {
285285 return "" , fmt .Errorf ("reading header failed: %w" , err )
@@ -365,7 +365,7 @@ func (h *tcpHandler) handleConnection(ctx context.Context, listenerPort int, cli
365365 }
366366 h .m .AddAuthenticatedTCPConnection (outerConn .RemoteAddr (), id )
367367
368- bufConn := onet .NewBufferedConn (innerConn )
368+ bufConn := onet .NewBufConn (innerConn )
369369 // Read target address and dial it.
370370 tgtAddr , err := getProxyRequest (bufConn )
371371 // Clear the deadline for the target address
0 commit comments