1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-02 15:25:28 -05:00
This commit is contained in:
v2ray
2016-07-17 12:18:34 +02:00
parent 089de290ad
commit 7e499ee0b6
2 changed files with 9 additions and 20 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"net"
v2io "github.com/v2ray/v2ray-core/common/io"
v2net "github.com/v2ray/v2ray-core/common/net"
)
@@ -44,13 +43,13 @@ func (server *Server) acceptConnections(listener *net.TCPListener) {
}
func (server *Server) handleConnection(conn net.Conn) {
request := make([]byte, 4096)
for true {
request, err := v2io.ReadFrom(conn, nil)
nBytes, err := conn.Read(request)
if err != nil {
break
}
response := server.MsgProcessor(request.Value)
request.Release()
response := server.MsgProcessor(request[:nBytes])
conn.Write(response)
}
conn.Close()