mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
clean up variable initialization
This commit is contained in:
parent
edd02f7d3c
commit
c6df0fde19
@ -59,8 +59,7 @@ func (this *FreedomConnection) Dispatch(firstPacket v2net.Packet, ray ray.Outbou
|
||||
defer readMutex.Unlock()
|
||||
defer close(output)
|
||||
|
||||
var reader io.Reader
|
||||
reader = conn
|
||||
var reader io.Reader = conn
|
||||
|
||||
if firstPacket.Destination().IsUDP() {
|
||||
reader = v2net.NewTimeOutReader(16 /* seconds */, conn)
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func TestHopByHopHeadersStrip(t *testing.T) {
|
||||
var rawRequest = `GET /pkg/net/http/ HTTP/1.1
|
||||
rawRequest := `GET /pkg/net/http/ HTTP/1.1
|
||||
Host: golang.org
|
||||
Connection: keep-alive,Foo, Bar
|
||||
Foo: foo
|
||||
|
@ -127,8 +127,7 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.TCPConn) {
|
||||
data.Release()
|
||||
responseWriter.Write(buffer.Value)
|
||||
go func(finish *sync.Mutex) {
|
||||
var writer v2io.Writer
|
||||
writer = v2io.NewAdaptiveWriter(responseWriter)
|
||||
var writer v2io.Writer = v2io.NewAdaptiveWriter(responseWriter)
|
||||
if request.IsChunkStream() {
|
||||
writer = vmessio.NewAuthChunkWriter(writer)
|
||||
}
|
||||
|
@ -140,8 +140,7 @@ func (this *VMessOutboundHandler) handleRequest(conn net.Conn, request *protocol
|
||||
}
|
||||
|
||||
if moreChunks {
|
||||
var streamWriter v2io.Writer
|
||||
streamWriter = v2io.NewAdaptiveWriter(encryptRequestWriter)
|
||||
var streamWriter v2io.Writer = v2io.NewAdaptiveWriter(encryptRequestWriter)
|
||||
if request.IsChunkStream() {
|
||||
streamWriter = vmessio.NewAuthChunkWriter(streamWriter)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user