From 014cbb9676946f0830f10daf78ce4ef2092f882c Mon Sep 17 00:00:00 2001 From: DeanHH <532171255@qq.com> Date: Thu, 31 Dec 2015 17:31:08 +0800 Subject: [PATCH 1/5] Update skynet_mq.c Comment error:-) --- skynet-src/skynet_mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skynet-src/skynet_mq.c b/skynet-src/skynet_mq.c index 157f33d8..0ddd9ee9 100644 --- a/skynet-src/skynet_mq.c +++ b/skynet-src/skynet_mq.c @@ -84,7 +84,7 @@ skynet_mq_create(uint32_t handle) { SPIN_INIT(q) // When the queue is create (always between service create and service init) , // set in_global flag to avoid push it to global queue . - // If the service init success, skynet_context_new will call skynet_mq_force_push to push it to global queue. + // If the service init success, skynet_context_new will call skynet_mq_push to push it to global queue. q->in_global = MQ_IN_GLOBAL; q->release = 0; q->overload = 0; From 645ce72e7e0bb5aec9ae607059cc44cd121bd1e3 Mon Sep 17 00:00:00 2001 From: fztcjjl Date: Mon, 4 Jan 2016 14:55:28 +0800 Subject: [PATCH 2/5] fix comment error --- skynet-src/socket_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skynet-src/socket_server.h b/skynet-src/socket_server.h index 41ef9cca..96e38980 100644 --- a/skynet-src/socket_server.h +++ b/skynet-src/socket_server.h @@ -16,7 +16,7 @@ struct socket_server; struct socket_message { int id; uintptr_t opaque; - int ud; // for accept, ud is listen id ; for data, ud is size of data + int ud; // for accept, ud is new connection id ; for data, ud is size of data char * data; }; From 141a4d0992dc1a074467a0589f2207583d49767e Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 4 Jan 2016 15:57:03 +0800 Subject: [PATCH 3/5] lua 5.3.2 bugfix,see http://lua-users.org/lists/lua-l/2016-01/msg00000.html --- 3rd/lua/lvm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/3rd/lua/lvm.c b/3rd/lua/lvm.c index 58ba7f29..3fa87cb1 100644 --- a/3rd/lua/lvm.c +++ b/3rd/lua/lvm.c @@ -200,18 +200,19 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, for (loop = 0; loop < MAXTAGLOOP; loop++) { const TValue *tm; if (oldval != NULL) { - lua_assert(ttistable(t) && ttisnil(oldval)); + Table *h = hvalue(t); + lua_assert(ttisnil(oldval)); /* must check the metamethod */ - if ((tm = fasttm(L, hvalue(t)->metatable, TM_NEWINDEX)) == NULL && + if ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && /* no metamethod; is there a previous entry in the table? */ (oldval != luaO_nilobject || /* no previous entry; must create one. (The next test is always true; we only need the assignment.) */ - (oldval = luaH_newkey(L, hvalue(t), key), 1))) { + (oldval = luaH_newkey(L, h, key), 1))) { /* no metamethod and (now) there is an entry with given key */ setobj2t(L, cast(TValue *, oldval), val); - invalidateTMcache(hvalue(t)); - luaC_barrierback(L, hvalue(t), val); + invalidateTMcache(h); + luaC_barrierback(L, h, val); return; } /* else will try the metamethod */ From 64c2cb1b5165db5a483cc94862842f3c136162a8 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 5 Jan 2016 16:06:20 +0800 Subject: [PATCH 4/5] sproto dispatch support ud --- lualib/sproto.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lualib/sproto.lua b/lualib/sproto.lua index 9c6524b2..f6338008 100644 --- a/lualib/sproto.lua +++ b/lualib/sproto.lua @@ -197,6 +197,7 @@ function host:dispatch(...) local bin = core.unpack(...) header_tmp.type = nil header_tmp.session = nil + header_tmp.ud = nil local header, size = core.decode(self.__package, bin, header_tmp) local content = bin:sub(size + 1) if header.type then @@ -207,9 +208,9 @@ function host:dispatch(...) result = core.decode(proto.request, content) end if header_tmp.session then - return "REQUEST", proto.name, result, gen_response(self, proto.response, header_tmp.session) + return "REQUEST", proto.name, result, gen_response(self, proto.response, header_tmp.session), header.ud else - return "REQUEST", proto.name, result + return "REQUEST", proto.name, result, nil, header.ud end else -- response @@ -217,10 +218,10 @@ function host:dispatch(...) local response = assert(self.__session[session], "Unknown session") self.__session[session] = nil if response == true then - return "RESPONSE", session + return "RESPONSE", session, nil, header.ud else local result = core.decode(response, content) - return "RESPONSE", session, result + return "RESPONSE", session, result, header.ud end end end From 05003e3e2abb9e6dc302fdb155fc27cf0b51e3a7 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 5 Jan 2016 17:51:48 +0800 Subject: [PATCH 5/5] sproto.attach also need ud --- lualib/sproto.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lualib/sproto.lua b/lualib/sproto.lua index f6338008..3ae114bd 100644 --- a/lualib/sproto.lua +++ b/lualib/sproto.lua @@ -227,10 +227,11 @@ function host:dispatch(...) end function host:attach(sp) - return function(name, args, session) + return function(name, args, session, ud) local proto = queryproto(sp, name) header_tmp.type = proto.tag header_tmp.session = session + header_tmp.ud = ud local header = core.encode(self.__package, header_tmp) if session then