fix pipe closing logic for inbound proxies.

This commit is contained in:
Darien Raymond committed 2018-05-27 11:42:01 +02:00
1 parent cad07c3a83
commit 7fa4bb434b
10 files changed
+16 -17

No files matched your search

+2 -2
View File
@@ -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