Skip to content

Commit

Permalink
Merge e1b175a into e640f4d
Browse files Browse the repository at this point in the history
  • Loading branch information
dencoded committed Oct 4, 2018
2 parents e640f4d + e1b175a commit 2d99829
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 40 deletions.
4 changes: 2 additions & 2 deletions api_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (ln *customListener) Init(addr string) (err error) {
return
}

func (ln *customListener) Accept() (conn io.ReadWriteCloser, clientAddr string, err error) {
func (ln *customListener) Accept() (conn net.Conn, err error) {
c, err := ln.L.Accept()
if err != nil {
return
Expand All @@ -419,7 +419,7 @@ func (ln *customListener) Accept() (conn io.ReadWriteCloser, clientAddr string,
return
}

return c, string(id), nil
return c, nil
}

func (ln *customListener) Close() error {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import (
graylogHook "github.com/gemnasium/logrus-graylog-hook"
"github.com/gorilla/mux"
"github.com/justinas/alice"
"github.com/lonelycode/gorpc"
"github.com/lonelycode/osin"
"github.com/rs/cors"
"github.com/satori/go.uuid"
"rsc.io/letsencrypt"

"github.com/TykTechnologies/goagain"
"github.com/TykTechnologies/gorpc"
"github.com/TykTechnologies/tyk/apidef"
"github.com/TykTechnologies/tyk/certs"
cli "github.com/TykTechnologies/tyk/cli"
Expand Down
13 changes: 8 additions & 5 deletions rpc/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package rpc
import (
"crypto/tls"
"errors"
"io"
"net"
"strconv"
"strings"
Expand All @@ -13,8 +12,9 @@ import (

"github.com/Sirupsen/logrus"
"github.com/gocraft/health"
"github.com/lonelycode/gorpc"
"github.com/satori/go.uuid"

"github.com/TykTechnologies/gorpc"
)

var (
Expand Down Expand Up @@ -174,7 +174,7 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin
clientSingleton.Conns = 20
}

clientSingleton.Dial = func(addr string) (conn io.ReadWriteCloser, err error) {
clientSingleton.Dial = func(addr string) (conn net.Conn, err error) {
dialer := &net.Dialer{
Timeout: 10 * time.Second,
KeepAlive: 30 * time.Second,
Expand Down Expand Up @@ -349,12 +349,15 @@ func FuncClientSingleton(funcName string, request interface{}) (interface{}, err
return funcClientSingleton.CallTimeout(funcName, request, GlobalRPCCallTimeout)
}

func onConnectFunc(remoteAddr string, rwc io.ReadWriteCloser) (io.ReadWriteCloser, error) {
func onConnectFunc(conn net.Conn) (net.Conn, string, error) {
clientSingletonMu.Lock()
defer clientSingletonMu.Unlock()

clientIsConnected = true
return rwc, nil
remoteAddr := conn.RemoteAddr().String()
Log.WithField("remoteAddr", remoteAddr).Debug("connected to RPC server")

return conn, remoteAddr, nil
}

func Disconnect() bool {
Expand Down
3 changes: 1 addition & 2 deletions rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"testing"
"time"

"github.com/lonelycode/gorpc"

"github.com/TykTechnologies/gorpc"
"github.com/TykTechnologies/tyk/config"
"github.com/TykTechnologies/tyk/rpc"
"github.com/TykTechnologies/tyk/test"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

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

File renamed without changes.

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

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

12 changes: 6 additions & 6 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"revision": "dcb3e4bb79906c5695321440deca10592f4eeb2d",
"revisionTime": "2017-02-22T15:40:38Z"
},
{
"checksumSHA1": "pk+Fj0KfcNdwugEfI9657E7flgI=",
"path": "github.com/TykTechnologies/gorpc",
"revision": "2fd6ca5242c4dbee5ab151010ee844f3fb5507a8",
"revisionTime": "2018-09-28T16:00:09Z"
},
{
"checksumSHA1": "FEq3KG6Kgarh8P5XIUx3bH13zDM=",
"path": "github.com/TykTechnologies/goverify",
Expand Down Expand Up @@ -296,12 +302,6 @@
"revision": "ed3ca8a15a931b141440a7e98e4f716eec255f7d",
"revisionTime": "2014-12-02T16:54:02Z"
},
{
"checksumSHA1": "OQ6h/9ehSr5avWJD3CbaZdZ8pwU=",
"path": "github.com/lonelycode/gorpc",
"revision": "5108a99af7137601fdc00c899caa4a3f0a8b31ef",
"revisionTime": "2015-06-11T14:24:37Z"
},
{
"checksumSHA1": "5OpChAvGZcoxGkZAp3qf5ZxKR84=",
"path": "github.com/lonelycode/osin",
Expand Down

0 comments on commit 2d99829

Please sign in to comment.