Skip to content

Commit

Permalink
MB-23346 - cbgt/cbdatasource should support XATTRS
Browse files Browse the repository at this point in the history
Adding DataType Bytes to dcp connection 'Helo' handshake

Change-Id: Ia8af6b57fde8803c191ecc613f1d632c475d3f1a
Reviewed-on: http://review.couchbase.org/75660
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Sreekanth Sivasankaran
  • Loading branch information
sreekanth-cb authored and Sreekanth Sivasankaran committed Mar 24, 2017
1 parent c3f13ec commit e324a42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cbdatasource/cbdatasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (

const FlagOpenProducer = uint32(1)
const FlagOpenIncludeXattrs = uint32(4)
const FeatureEnabledDataType = uint16(0x01)
const FeatureEnabledXAttrs = uint16(0x06)

var ErrXAttrsNotSupported = fmt.Errorf("xattrs not supported by server")
Expand Down Expand Up @@ -1741,9 +1742,9 @@ func ConnectBucket(serverURL, poolName, bucketName string,
}

func xAttrsSupported(mc *memcached.Client) (bool, error) {
payload := make([]byte, 2)
binary.BigEndian.PutUint16(payload, FeatureEnabledXAttrs)

payload := make([]byte, 4)
binary.BigEndian.PutUint16(payload[0:2], FeatureEnabledDataType)
binary.BigEndian.PutUint16(payload[2:4], FeatureEnabledXAttrs)
res, err := mc.Send(&gomemcached.MCRequest{
Opcode: gomemcached.HELLO,
Key: []byte("GoMemcached"),
Expand Down

0 comments on commit e324a42

Please sign in to comment.