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/11 00:12:35 UTC
thrift git commit: THRIFT-2812 Go server adding redundant buffering
layer Client: Go Patch: Craig Peterson
Repository: thrift
Updated Branches:
refs/heads/master 4c3309405 -> 6794c6248
THRIFT-2812 Go server adding redundant buffering layer
Client: Go
Patch: Craig Peterson
This closes #259
It has been pointed out to me that #249 was wrong. It was not needed to allow server sockets to use buffering. The correct way is to pass in a TBufferedTransportFactory to the server. This will create buffered sockets as the processor starts up.
This change creates extra buffering, and is actually a real pain to deactivate. Sorry.
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6794c624
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6794c624
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6794c624
Branch: refs/heads/master
Commit: 6794c624854e86fa9b73f36cac70b583a3629d02
Parents: 4c33094
Author: Jens Geyer <je...@apache.org>
Authored: Tue Nov 11 00:11:16 2014 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Nov 11 00:11:16 2014 +0100
----------------------------------------------------------------------
lib/go/thrift/server_socket.go | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/6794c624/lib/go/thrift/server_socket.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/server_socket.go b/lib/go/thrift/server_socket.go
index 936eb2e..4c80714 100644
--- a/lib/go/thrift/server_socket.go
+++ b/lib/go/thrift/server_socket.go
@@ -33,10 +33,6 @@ type TServerSocket struct {
// Protects the interrupted value to make it thread safe.
mu sync.RWMutex
interrupted bool
-
- //Size of buffer to use for socket. Defaults to 1024.
- //Set to 0 to disable bufferring server transport altogether.
- BufferSize int
}
func NewTServerSocket(listenAddr string) (*TServerSocket, error) {
@@ -48,7 +44,7 @@ func NewTServerSocketTimeout(listenAddr string, clientTimeout time.Duration) (*T
if err != nil {
return nil, err
}
- return &TServerSocket{addr: addr, clientTimeout: clientTimeout, BufferSize: 1024}, nil
+ return &TServerSocket{addr: addr, clientTimeout: clientTimeout}, nil
}
func (p *TServerSocket) Listen() error {
@@ -78,12 +74,7 @@ func (p *TServerSocket) Accept() (TTransport, error) {
if err != nil {
return nil, NewTTransportExceptionFromError(err)
}
- var trans TTransport
- trans = NewTSocketFromConnTimeout(conn, p.clientTimeout)
- if p.BufferSize != 0 {
- trans = NewTBufferedTransport(trans, p.BufferSize)
- }
- return trans, nil
+ return NewTSocketFromConnTimeout(conn, p.clientTimeout), nil
}
// Checks whether the socket is listening.