You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2014/11/25 21:46:12 UTC
thrift git commit: THRIFT-2851 Remove strange public Peek() from Go
transports Client: Go Patch: Chi Vinh Le
Repository: thrift
Updated Branches:
refs/heads/master 740db54d1 -> 1e7971cff
THRIFT-2851 Remove strange public Peek() from Go transports
Client: Go
Patch: Chi Vinh Le
This closes #283
In its current form Peek() is not only useless, but misleading.
If anyone can provide a better implementation, please do.
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/1e7971cf
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/1e7971cf
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/1e7971cf
Branch: refs/heads/master
Commit: 1e7971cfff020be14bd30114f0dfe264797f259a
Parents: 740db54
Author: Jens Geyer <je...@apache.org>
Authored: Tue Nov 25 21:43:54 2014 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Nov 25 21:43:54 2014 +0100
----------------------------------------------------------------------
lib/go/thrift/http_client.go | 4 ----
lib/go/thrift/iostream_transport.go | 4 ----
lib/go/thrift/memory_buffer.go | 4 ----
lib/go/thrift/socket.go | 4 ----
lib/go/thrift/ssl_socket.go | 6 +-----
5 files changed, 1 insertion(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/1e7971cf/lib/go/thrift/http_client.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/http_client.go b/lib/go/thrift/http_client.go
index df66897..2bce078 100644
--- a/lib/go/thrift/http_client.go
+++ b/lib/go/thrift/http_client.go
@@ -129,10 +129,6 @@ func (p *THttpClient) IsOpen() bool {
return p.response != nil || p.requestBuffer != nil
}
-func (p *THttpClient) Peek() bool {
- return p.IsOpen()
-}
-
func (p *THttpClient) Close() error {
if p.response != nil && p.response.Body != nil {
err := p.response.Body.Close()
http://git-wip-us.apache.org/repos/asf/thrift/blob/1e7971cf/lib/go/thrift/iostream_transport.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/iostream_transport.go b/lib/go/thrift/iostream_transport.go
index cdff544..8fc0214 100644
--- a/lib/go/thrift/iostream_transport.go
+++ b/lib/go/thrift/iostream_transport.go
@@ -106,10 +106,6 @@ func (p *StreamTransport) Open() error {
}
}
-// func (p *StreamTransport) Peek() bool {
-// return p.IsOpen()
-// }
-
// Closes both the input and output streams.
func (p *StreamTransport) Close() error {
if p.closed {
http://git-wip-us.apache.org/repos/asf/thrift/blob/1e7971cf/lib/go/thrift/memory_buffer.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/memory_buffer.go b/lib/go/thrift/memory_buffer.go
index c48e089..59e4542 100644
--- a/lib/go/thrift/memory_buffer.go
+++ b/lib/go/thrift/memory_buffer.go
@@ -64,10 +64,6 @@ func (p *TMemoryBuffer) Open() error {
return nil
}
-func (p *TMemoryBuffer) Peek() bool {
- return p.IsOpen()
-}
-
func (p *TMemoryBuffer) Close() error {
p.Buffer.Reset()
return nil
http://git-wip-us.apache.org/repos/asf/thrift/blob/1e7971cf/lib/go/thrift/socket.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/socket.go b/lib/go/thrift/socket.go
index 5b3944d..6c24748 100644
--- a/lib/go/thrift/socket.go
+++ b/lib/go/thrift/socket.go
@@ -148,10 +148,6 @@ func (p *TSocket) Write(buf []byte) (int, error) {
return p.conn.Write(buf)
}
-func (p *TSocket) Peek() bool {
- return p.IsOpen()
-}
-
func (p *TSocket) Flush() error {
return nil
}
http://git-wip-us.apache.org/repos/asf/thrift/blob/1e7971cf/lib/go/thrift/ssl_socket.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/ssl_socket.go b/lib/go/thrift/ssl_socket.go
index d28975e..38f66c4 100644
--- a/lib/go/thrift/ssl_socket.go
+++ b/lib/go/thrift/ssl_socket.go
@@ -20,9 +20,9 @@
package thrift
import (
+ "crypto/tls"
"net"
"time"
- "crypto/tls"
)
type TSSLSocket struct {
@@ -145,10 +145,6 @@ func (p *TSSLSocket) Write(buf []byte) (int, error) {
return p.conn.Write(buf)
}
-func (p *TSSLSocket) Peek() bool {
- return p.IsOpen()
-}
-
func (p *TSSLSocket) Flush() error {
return nil
}