Refactor logrwc to wrappers

This commit is contained in:
9seconds
2018-06-05 10:52:50 +03:00
parent 65f8e2ac30
commit 26020fcd0c
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ func (s *Server) getClientStream(ctx context.Context, cancel context.CancelFunc,
return nil, 0, errors.Annotate(err, "Cannot create client stream")
}
wConn = newLogReadWriteCloser(wConn, s.logger, socketID, "client")
wConn = wrappers.NewLogRWC(wConn, s.logger, socketID, "client")
wConn = wrappers.NewStreamCipherRWC(wConn, obfs2.Encryptor, obfs2.Decryptor)
wConn = wrappers.NewCtxRWC(ctx, cancel, wConn)
@@ -144,7 +144,7 @@ func (s *Server) getTelegramStream(ctx context.Context, cancel context.CancelFun
return nil, errors.Annotate(err, "Cannot write hadnshake frame")
}
wConn = newLogReadWriteCloser(wConn, s.logger, socketID, "telegram")
wConn = wrappers.NewLogRWC(wConn, s.logger, socketID, "telegram")
wConn = wrappers.NewStreamCipherRWC(wConn, obfs2.Encryptor, obfs2.Decryptor)
wConn = wrappers.NewCtxRWC(ctx, cancel, wConn)