mirror of
https://github.com/v2ray/v2ray-core.git
synced 2024-04-21 12:31:52 +00:00
simplify task execution
This commit is contained in:
@@ -64,7 +64,7 @@ func (server *Server) handleConnection(conn net.Conn) {
|
||||
}
|
||||
|
||||
pReader, pWriter := pipe.New(pipe.WithoutSizeLimit())
|
||||
err := task.Run(task.Parallel(func() error {
|
||||
err := task.Run(context.Background(), func() error {
|
||||
defer pWriter.Close() // nolint: errcheck
|
||||
|
||||
for {
|
||||
@@ -96,7 +96,7 @@ func (server *Server) handleConnection(conn net.Conn) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}))()
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("failed to transfer data: ", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user