From 570a8356e608d2c8af6801c9474dcf076e5335c9 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Sat, 25 Mar 2017 15:05:39 +0800 Subject: [PATCH] add comment --- lualib-src/lua-cluster.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lualib-src/lua-cluster.c b/lualib-src/lua-cluster.c index ce54df45..7975c020 100644 --- a/lualib-src/lua-cluster.c +++ b/lualib-src/lua-cluster.c @@ -37,7 +37,9 @@ fill_header(lua_State *L, uint8_t *buf, int sz) { } /* - The request package : + The request package : + first WORD is size of the package with big-endian + DWORD in content is small-endian size <= 0x8000 (32K) and address is id WORD sz+9 BYTE 0 @@ -45,7 +47,7 @@ fill_header(lua_State *L, uint8_t *buf, int sz) { DWORD session PADDING msg(sz) size > 0x8000 and address is id - DWORD 13 + WORD 13 BYTE 1 ; multireq , 0x41: multi push DWORD addr DWORD session @@ -59,7 +61,7 @@ fill_header(lua_State *L, uint8_t *buf, int sz) { DWORD session PADDING msg(sz) size > 0x8000 and address is string - DWORD 10 + namelen + WORD 10 + namelen BYTE 0x81 ; 0xc1 : multi push BYTE namelen STRING name @@ -335,6 +337,8 @@ lunpackrequest(lua_State *L) { } /* + The response package : + WORD size (big endian) DWORD session BYTE type 0: error