mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
update sproto, bugfix sproto_dump
This commit is contained in:
@@ -500,7 +500,11 @@ sproto_dump(struct sproto *s) {
|
||||
printf("=== %d protocol ===\n", s->protocol_n);
|
||||
for (i=0;i<s->protocol_n;i++) {
|
||||
struct protocol *p = &s->proto[i];
|
||||
printf("\t%s (%d) request:%s", p->name, p->tag, p->p[SPROTO_REQUEST]->name);
|
||||
if (p->p[SPROTO_REQUEST]) {
|
||||
printf("\t%s (%d) request:%s", p->name, p->tag, p->p[SPROTO_REQUEST]->name);
|
||||
} else {
|
||||
printf("\t%s (%d) request:(null)", p->name, p->tag);
|
||||
}
|
||||
if (p->p[SPROTO_RESPONSE]) {
|
||||
printf(" response:%s", p->p[SPROTO_RESPONSE]->name);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ local function check_protocol(r)
|
||||
local request = v.request
|
||||
local response = v.response
|
||||
local p = map[tag]
|
||||
|
||||
|
||||
if p then
|
||||
error(string.format("redefined protocol tag %d at %s", tag, name))
|
||||
end
|
||||
@@ -340,9 +340,6 @@ local function packtype(name, t, alltypes)
|
||||
end
|
||||
|
||||
local function packproto(name, p, alltypes)
|
||||
-- if p.request == nil then
|
||||
-- error(string.format("Protocol %s need request", name))
|
||||
-- end
|
||||
if p.request then
|
||||
local request = alltypes[p.request]
|
||||
if request == nil then
|
||||
|
||||
Reference in New Issue
Block a user