Updating vendored apache thrift library
This commit is contained in:
parent
a83956cb24
commit
155940c761
11 changed files with 34 additions and 43 deletions
48
vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol_test.go
generated
vendored
48
vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol_test.go
generated
vendored
|
@ -26,28 +26,28 @@ import (
|
||||||
|
|
||||||
func TestReadWriteCompactProtocol(t *testing.T) {
|
func TestReadWriteCompactProtocol(t *testing.T) {
|
||||||
ReadWriteProtocolTest(t, NewTCompactProtocolFactory())
|
ReadWriteProtocolTest(t, NewTCompactProtocolFactory())
|
||||||
transports := []TTransport{
|
transports := []TTransport{
|
||||||
NewTMemoryBuffer(),
|
NewTMemoryBuffer(),
|
||||||
NewStreamTransportRW(bytes.NewBuffer(make([]byte, 0, 16384))),
|
NewStreamTransportRW(bytes.NewBuffer(make([]byte, 0, 16384))),
|
||||||
NewTFramedTransport(NewTMemoryBuffer()),
|
NewTFramedTransport(NewTMemoryBuffer()),
|
||||||
}
|
}
|
||||||
for _, trans := range transports {
|
for _, trans := range transports {
|
||||||
p := NewTCompactProtocol(trans);
|
p := NewTCompactProtocol(trans)
|
||||||
ReadWriteBool(t, p, trans);
|
ReadWriteBool(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteByte(t, p, trans);
|
ReadWriteByte(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteI16(t, p, trans);
|
ReadWriteI16(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteI32(t, p, trans);
|
ReadWriteI32(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteI64(t, p, trans);
|
ReadWriteI64(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteDouble(t, p, trans);
|
ReadWriteDouble(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteString(t, p, trans);
|
ReadWriteString(t, p, trans)
|
||||||
p = NewTCompactProtocol(trans);
|
p = NewTCompactProtocol(trans)
|
||||||
ReadWriteBinary(t, p, trans);
|
ReadWriteBinary(t, p, trans)
|
||||||
trans.Close();
|
trans.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go
generated
vendored
|
@ -48,7 +48,7 @@ func NewTFramedTransportFactory(factory TTransportFactory) TTransportFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory {
|
func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory {
|
||||||
return &tFramedTransportFactory{factory: factory, maxLength: maxLength}
|
return &tFramedTransportFactory{factory: factory, maxLength: maxLength}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *tFramedTransportFactory) GetTransport(base TTransport) TTransport {
|
func (p *tFramedTransportFactory) GetTransport(base TTransport) TTransport {
|
||||||
|
@ -164,4 +164,3 @@ func (p *TFramedTransport) readFrameHeader() (uint32, error) {
|
||||||
func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) {
|
func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) {
|
||||||
return uint64(p.frameSize)
|
return uint64(p.frameSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go
generated
vendored
|
@ -209,6 +209,5 @@ func (p *StreamTransport) WriteString(s string) (n int, err error) {
|
||||||
|
|
||||||
func (p *StreamTransport) RemainingBytes() (num_bytes uint64) {
|
func (p *StreamTransport) RemainingBytes() (num_bytes uint64) {
|
||||||
const maxSize = ^uint64(0)
|
const maxSize = ^uint64(0)
|
||||||
return maxSize // the thruth is, we just don't know unless framed is used
|
return maxSize // the thruth is, we just don't know unless framed is used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go
generated
vendored
6
vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go
generated
vendored
|
@ -88,9 +88,9 @@ func SkipDefaultDepth(prot TProtocol, typeId TType) (err error) {
|
||||||
|
|
||||||
// Skips over the next data element from the provided input TProtocol object.
|
// Skips over the next data element from the provided input TProtocol object.
|
||||||
func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) {
|
func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) {
|
||||||
|
|
||||||
if maxDepth <= 0 {
|
if maxDepth <= 0 {
|
||||||
return NewTProtocolExceptionWithType( DEPTH_LIMIT, errors.New("Depth limit exceeded"))
|
return NewTProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded"))
|
||||||
}
|
}
|
||||||
|
|
||||||
switch fieldType {
|
switch fieldType {
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go
generated
vendored
|
@ -60,7 +60,7 @@ func NewTProtocolException(err error) TProtocolException {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if e,ok := err.(TProtocolException); ok {
|
if e, ok := err.(TProtocolException); ok {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
if _, ok := err.(base64.CorruptInputError); ok {
|
if _, ok := err.(base64.CorruptInputError); ok {
|
||||||
|
@ -75,4 +75,3 @@ func NewTProtocolExceptionWithType(errType int, err error) TProtocolException {
|
||||||
}
|
}
|
||||||
return &tProtocolException{errType, err.Error()}
|
return &tProtocolException{errType, err.Error()}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go
generated
vendored
1
vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go
generated
vendored
|
@ -66,4 +66,3 @@ func writeByte(w io.Writer, c byte) error {
|
||||||
_, err := w.Write(v[0:1])
|
_, err := w.Write(v[0:1])
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go
generated
vendored
2
vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go
generated
vendored
|
@ -27,7 +27,7 @@ import (
|
||||||
|
|
||||||
// Simple, non-concurrent server for testing.
|
// Simple, non-concurrent server for testing.
|
||||||
type TSimpleServer struct {
|
type TSimpleServer struct {
|
||||||
quit chan struct{}
|
quit chan struct{}
|
||||||
stopped int64
|
stopped int64
|
||||||
|
|
||||||
processorFactory TProcessorFactory
|
processorFactory TProcessorFactory
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go
generated
vendored
|
@ -161,6 +161,5 @@ func (p *TSocket) Interrupt() error {
|
||||||
|
|
||||||
func (p *TSocket) RemainingBytes() (num_bytes uint64) {
|
func (p *TSocket) RemainingBytes() (num_bytes uint64) {
|
||||||
const maxSize = ^uint64(0)
|
const maxSize = ^uint64(0)
|
||||||
return maxSize // the thruth is, we just don't know unless framed is used
|
return maxSize // the thruth is, we just don't know unless framed is used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go
generated
vendored
2
vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go
generated
vendored
|
@ -20,9 +20,9 @@
|
||||||
package thrift
|
package thrift
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
"crypto/tls"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TSSLServerSocket struct {
|
type TSSLServerSocket struct {
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go
generated
vendored
|
@ -166,6 +166,5 @@ func (p *TSSLSocket) Interrupt() error {
|
||||||
|
|
||||||
func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) {
|
func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) {
|
||||||
const maxSize = ^uint64(0)
|
const maxSize = ^uint64(0)
|
||||||
return maxSize // the thruth is, we just don't know unless framed is used
|
return maxSize // the thruth is, we just don't know unless framed is used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go
generated
vendored
3
vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go
generated
vendored
|
@ -34,7 +34,6 @@ type ReadSizeProvider interface {
|
||||||
RemainingBytes() (num_bytes uint64)
|
RemainingBytes() (num_bytes uint64)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Encapsulates the I/O layer
|
// Encapsulates the I/O layer
|
||||||
type TTransport interface {
|
type TTransport interface {
|
||||||
io.ReadWriteCloser
|
io.ReadWriteCloser
|
||||||
|
@ -52,7 +51,6 @@ type stringWriter interface {
|
||||||
WriteString(s string) (n int, err error)
|
WriteString(s string) (n int, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is "enchanced" transport with extra capabilities. You need to use one of these
|
// This is "enchanced" transport with extra capabilities. You need to use one of these
|
||||||
// to construct protocol.
|
// to construct protocol.
|
||||||
// Notably, TSocket does not implement this interface, and it is always a mistake to use
|
// Notably, TSocket does not implement this interface, and it is always a mistake to use
|
||||||
|
@ -65,4 +63,3 @@ type TRichTransport interface {
|
||||||
Flusher
|
Flusher
|
||||||
ReadSizeProvider
|
ReadSizeProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue