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:
parent
790db40821
commit
b000850370
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user