fix timeout minimums

This commit is contained in:
idk
2019-05-11 22:35:04 -04:00
parent 1b0c4ad512
commit 2dda6d1197
3 changed files with 15 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package i2phttpproxy
import (
"fmt"
"log"
"strconv"
"strings"
)
@ -316,7 +317,7 @@ func SetReduceIdle(b bool) func(*SAMHTTPProxy) error {
//SetReduceIdleTime sets time to wait before the tunnel quantity is reduced
func SetReduceIdleTime(u uint) func(*SAMHTTPProxy) error {
return func(c *SAMHTTPProxy) error {
if u > 300000 {
if u > 299999 {
c.reduceIdleTime = u
return nil
}
@ -354,11 +355,12 @@ func SetCloseIdle(b bool) func(*SAMHTTPProxy) error {
//SetCloseIdleTime sets time to wait before the tunnel quantity is reduced
func SetCloseIdleTime(u uint) func(*SAMHTTPProxy) error {
return func(c *SAMHTTPProxy) error {
if u > 300000 {
log.Println("TEST CLOSE", u, (u > 299999))
if u > 299999 {
c.closeIdleTime = u
return nil
}
return fmt.Errorf("Invalid reduce idle time %v", u)
return fmt.Errorf("Invalid close idle time %v", u)
}
}

View File

@ -62,7 +62,7 @@ var Quiet bool
func plog(in ...interface{}) {
if !Quiet {
log.Println(in)
log.Println(in...)
}
}
@ -70,8 +70,16 @@ func (f *SAMHTTPProxy) print() []string {
return strings.Split(f.Print(), " ")
}
func (f *SAMHTTPProxy) GetType() string {
return "httpclient"
}
func (f *SAMHTTPProxy) ID() string {
return f.tunName
}
func (f *SAMHTTPProxy) Props() map[string]string {
var r map[string]string
r := make(map[string]string)
for _, prop := range f.print() {
k, v := sfi2pkeys.Prop(prop)
r[k] = v

0
index.html Normal file
View File