[
https://issues.apache.org/jira/browse/TS-3250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255372#comment-14255372
]
seven chen commented on TS-3250:
--------------------------------
/* RECORD_GET */ { 4, { MGMT_MARSHALL_INT, MGMT_MARSHALL_INT,
MGMT_MARSHALL_STRING, MGMT_MARSHALL_DATA } },
i follow this format to deserialize the response ,but got the wrong data。
> mgmtapisocket
> -------------
>
> Key: TS-3250
> URL: https://issues.apache.org/jira/browse/TS-3250
> Project: Traffic Server
> Issue Type: Bug
> Components: Management API
> Affects Versions: 5.1.2
> Reporter: daemon
> Assignee: James Peach
>
> This is my python code
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> import struct
> import socket
> query = 'proxy.process.cache.read.success'
> msg = struct.pack('h', 3)
> msg += struct.pack('i', len(query))
> msg += query
> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> s.connect("/opt/ats/var/trafficserver/mgmtapisocket")
> s.send(msg)
> data = s.recv(1024)
> s.close()
> # raw data
> print 'Received', repr(data)
> if data:
> offset = 0
> ret_stat, op_t = struct.unpack_from('hi', data, offset)
> offset += 2 + 4 + 2
> int_0, int_1 = struct.unpack_from('ii', data, offset)
> offset += 4 * 2
> msglen, = struct.unpack_from('i', data, offset)
> offset += 4
> msg = data[offset:msglen]
> offset += msglen
> dlen, = struct.unpack_from('i', data, offset)
> offset += 4
> d = data[offset:dlen]
> print ret_stat, op_t, int_0, int_1, msglen, msg, dlen, d
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Received '\x00\x00\x08\x00\x00\x00
> \x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00proxy.process.cache.read.success'
> ##############################################################
> What this data format , how do I solve the binary package, please help me
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)