@@ -129,9 +129,9 @@ type ShadowsocksTCPMetrics interface {
129
129
// TODO(fortuna): Offer alternative transports.
130
130
func NewShadowsocksStreamAuthenticator (ciphers CipherList , replayCache * ReplayCache , metrics ShadowsocksTCPMetrics ) StreamAuthenticateFunc {
131
131
return func (clientConn transport.StreamConn ) (string , transport.StreamConn , * onet.ConnectionError ) {
132
- bufConn := onet .NewBufferedConn (clientConn )
132
+ bufConn := onet .NewBufConn (clientConn )
133
133
// 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 )
135
135
metrics .AddTCPCipherSearch (keyErr == nil , timeToCipher )
136
136
if keyErr != nil {
137
137
const status = "ERR_CIPHER"
@@ -279,7 +279,7 @@ func (h *tcpHandler) Handle(ctx context.Context, clientConn transport.StreamConn
279
279
logger .Debugf ("Done with status %v, duration %v" , status , connDuration )
280
280
}
281
281
282
- func getProxyRequest (bufConn onet.BufferedConn ) (string , error ) {
282
+ func getProxyRequest (bufConn onet.BufConn ) (string , error ) {
283
283
firstByte , err := bufConn .Peek (1 )
284
284
if err != nil {
285
285
return "" , fmt .Errorf ("reading header failed: %w" , err )
@@ -365,7 +365,7 @@ func (h *tcpHandler) handleConnection(ctx context.Context, listenerPort int, cli
365
365
}
366
366
h .m .AddAuthenticatedTCPConnection (outerConn .RemoteAddr (), id )
367
367
368
- bufConn := onet .NewBufferedConn (innerConn )
368
+ bufConn := onet .NewBufConn (innerConn )
369
369
// Read target address and dial it.
370
370
tgtAddr , err := getProxyRequest (bufConn )
371
371
// Clear the deadline for the target address
0 commit comments