mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-04 09:17:32 -05:00
fix lint warnings
This commit is contained in:
parent
519eb344db
commit
721bea5d54
@ -171,7 +171,7 @@ func (s *Server) handleConnect(ctx context.Context, request *http.Request, reade
|
|||||||
if reader.Buffered() > 0 {
|
if reader.Buffered() > 0 {
|
||||||
payload := buf.New()
|
payload := buf.New()
|
||||||
common.Must(payload.Reset(func(b []byte) (int, error) {
|
common.Must(payload.Reset(func(b []byte) (int, error) {
|
||||||
return reader.Read(b)
|
return reader.Read(b[:reader.Buffered()])
|
||||||
}))
|
}))
|
||||||
if err := ray.InboundInput().WriteMultiBuffer(buf.NewMultiBufferValue(payload)); err != nil {
|
if err := ray.InboundInput().WriteMultiBuffer(buf.NewMultiBufferValue(payload)); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -225,7 +225,7 @@ func WriteTCPResponse(request *protocol.RequestHeader, writer io.Writer) (buf.Wr
|
|||||||
account := rawAccount.(*ShadowsocksAccount)
|
account := rawAccount.(*ShadowsocksAccount)
|
||||||
|
|
||||||
iv := make([]byte, account.Cipher.IVSize())
|
iv := make([]byte, account.Cipher.IVSize())
|
||||||
rand.Read(iv)
|
common.Must2(rand.Read(iv))
|
||||||
_, err = writer.Write(iv)
|
_, err = writer.Write(iv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, newError("failed to write IV.").Base(err)
|
return nil, newError("failed to write IV.").Base(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user