mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43: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);
|
printf("=== %d protocol ===\n", s->protocol_n);
|
||||||
for (i=0;i<s->protocol_n;i++) {
|
for (i=0;i<s->protocol_n;i++) {
|
||||||
struct protocol *p = &s->proto[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]) {
|
if (p->p[SPROTO_RESPONSE]) {
|
||||||
printf(" response:%s", p->p[SPROTO_RESPONSE]->name);
|
printf(" response:%s", p->p[SPROTO_RESPONSE]->name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ local function check_protocol(r)
|
|||||||
local request = v.request
|
local request = v.request
|
||||||
local response = v.response
|
local response = v.response
|
||||||
local p = map[tag]
|
local p = map[tag]
|
||||||
|
|
||||||
if p then
|
if p then
|
||||||
error(string.format("redefined protocol tag %d at %s", tag, name))
|
error(string.format("redefined protocol tag %d at %s", tag, name))
|
||||||
end
|
end
|
||||||
@@ -340,9 +340,6 @@ local function packtype(name, t, alltypes)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function packproto(name, p, alltypes)
|
local function packproto(name, p, alltypes)
|
||||||
-- if p.request == nil then
|
|
||||||
-- error(string.format("Protocol %s need request", name))
|
|
||||||
-- end
|
|
||||||
if p.request then
|
if p.request then
|
||||||
local request = alltypes[p.request]
|
local request = alltypes[p.request]
|
||||||
if request == nil then
|
if request == nil then
|
||||||
|
|||||||
Reference in New Issue
Block a user