1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-15 08:46:34 -05:00

format code

This commit is contained in:
V2Ray 2015-09-18 12:31:42 +02:00
parent 790db40821
commit b000850370
2 changed files with 13 additions and 13 deletions

View File

@ -84,9 +84,9 @@ func (handler *VMessInboundHandler) HandleConnection(connection net.Conn) error
if data, open := <-output; open {
buffer = append(buffer, data...)
responseWriter.Write(buffer)
go handleOutput(request, responseWriter, output, writeFinish)
<-writeFinish
responseWriter.Write(buffer)
go handleOutput(request, responseWriter, output, writeFinish)
<-writeFinish
}
if tcpConn, ok := connection.(*net.TCPConn); ok {

View File

@ -109,18 +109,18 @@ func handleRequest(conn *net.TCPConn, request *vmessio.VMessRequest, input <-cha
log.Error("VMessOut: Failed to serialize VMess request: %v", err)
}
// Send first packet of payload together with request, in favor of small requests.
// Send first packet of payload together with request, in favor of small requests.
payload, open := <-input
if open {
encryptRequestWriter.Crypt(payload)
buffer = append(buffer, payload...)
_, err = conn.Write(buffer)
if err != nil {
log.Error("VMessOut: Failed to write VMess request: %v", err)
}
_, err = conn.Write(buffer)
if err != nil {
log.Error("VMessOut: Failed to write VMess request: %v", err)
}
v2net.ChanToWriter(encryptRequestWriter, input)
v2net.ChanToWriter(encryptRequestWriter, input)
}
return nil
}