You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2017/09/05 20:20:17 UTC
thrift git commit: THRIFT-4307: Make ssl-open timeout effective in
golang client Client: go
Repository: thrift
Updated Branches:
refs/heads/master 9235bec08 -> 78b71851f
THRIFT-4307: Make ssl-open timeout effective in golang client
Client: go
This closes #1341
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/78b71851
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/78b71851
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/78b71851
Branch: refs/heads/master
Commit: 78b71851fc7ee797a80bbe925bc8cbff77cf339c
Parents: 9235bec
Author: tudyzhb <tu...@gmail.com>
Authored: Mon Sep 4 10:37:10 2017 +0800
Committer: James E. King, III <jk...@apache.org>
Committed: Tue Sep 5 13:19:39 2017 -0700
----------------------------------------------------------------------
lib/go/thrift/ssl_socket.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/78b71851/lib/go/thrift/ssl_socket.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/ssl_socket.go b/lib/go/thrift/ssl_socket.go
index 8272703..c3bd72c 100644
--- a/lib/go/thrift/ssl_socket.go
+++ b/lib/go/thrift/ssl_socket.go
@@ -90,7 +90,8 @@ func (p *TSSLSocket) Open() error {
// If we have a hostname, we need to pass the hostname to tls.Dial for
// certificate hostname checks.
if p.hostPort != "" {
- if p.conn, err = tls.Dial("tcp", p.hostPort, p.cfg); err != nil {
+ if p.conn, err = tls.DialWithDialer(&net.Dialer{
+ Timeout: p.timeout}, "tcp", p.hostPort, p.cfg); err != nil {
return NewTTransportException(NOT_OPEN, err.Error())
}
} else {
@@ -106,7 +107,8 @@ func (p *TSSLSocket) Open() error {
if len(p.addr.String()) == 0 {
return NewTTransportException(NOT_OPEN, "Cannot open bad address.")
}
- if p.conn, err = tls.Dial(p.addr.Network(), p.addr.String(), p.cfg); err != nil {
+ if p.conn, err = tls.DialWithDialer(&net.Dialer{
+ Timeout: p.timeout}, p.addr.Network(), p.addr.String(), p.cfg); err != nil {
return NewTTransportException(NOT_OPEN, err.Error())
}
}