Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
rui.zheng committed Mar 3, 2017
1 parent 26f4e49 commit 72f0548
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 31 deletions.
14 changes: 0 additions & 14 deletions cmd/gost/vendor/github.com/ginuerzh/gost/kcp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cmd/gost/vendor/github.com/ginuerzh/gost/signal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions cmd/gost/vendor/github.com/ginuerzh/gost/signal_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/gost/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"revisionTime": "2017-01-19T05:34:58Z"
},
{
"checksumSHA1": "FiAXa5vUbpoqK2lhegpc9lOpumk=",
"checksumSHA1": "90Nj9KD5KzY15ZBn95Coz7G85+0=",
"path": "github.com/ginuerzh/gost",
"revision": "d98860877d6952f26974ebaa044b29af05528f46",
"revisionTime": "2017-03-03T07:45:56Z"
"revision": "26f4e49f0538177eb5ec33c84a280afe2ae16042",
"revisionTime": "2017-03-03T13:33:05Z"
},
{
"checksumSHA1": "+XIOnTW0rv8Kr/amkXgMraNeUr4=",
Expand Down
14 changes: 0 additions & 14 deletions kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
"gopkg.in/xtaci/smux.v1"
"net"
"os"
"os/signal"
"syscall"
"time"
)

Expand Down Expand Up @@ -250,18 +248,6 @@ func snmpLogger(path string, interval int) {
}
}

func kcpSigHandler() {
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGUSR1)

for {
switch <-ch {
case syscall.SIGUSR1:
glog.V(LINFO).Infof("[kcp] SNMP: %+v", kcp.DefaultSnmp.Copy())
}
}
}

type KCPSession struct {
conn net.Conn
session *smux.Session
Expand Down
5 changes: 5 additions & 0 deletions signal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +build windows

package gost

func kcpSigHandler() {}
23 changes: 23 additions & 0 deletions signal_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// +build !windows

package gost

import (
"github.com/golang/glog"
"gopkg.in/xtaci/kcp-go.v2"
"os"
"os/signal"
"syscall"
)

func kcpSigHandler() {
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGUSR1)

for {
switch <-ch {
case syscall.SIGUSR1:
glog.V(LINFO).Infof("[kcp] SNMP: %+v", kcp.DefaultSnmp.Copy())
}
}
}

0 comments on commit 72f0548

Please sign in to comment.