mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-09 08:40:12 +00:00
fix pipe closing logic for inbound proxies.
This commit is contained in:
10 files changed
+16
-17
No files matched your search
@@ -5,8 +5,8 @@ import "v2ray.com/core/common"
|
||||
// Task is a function that may return an error.
|
||||
type Task func() error
|
||||
|
||||
// CloseOnSuccess returns a Task to run a follow task if pre-condition passes, otherwise the error in pre-condition is returned.
|
||||
func CloseOnSuccess(pre func() error, followup Task) Task {
|
||||
// OnSuccess returns a Task to run a follow task if pre-condition passes, otherwise the error in pre-condition is returned.
|
||||
func OnSuccess(pre func() error, followup Task) Task {
|
||||
return func() error {
|
||||
if err := pre(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user