1
0
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:
v2ray 2016-02-03 21:36:52 +01:00
parent edd02f7d3c
commit c6df0fde19
4 changed files with 4 additions and 7 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)
}

View File

@ -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)
}