bugfix: connection forward

This commit is contained in:
云风
2012-08-14 23:16:40 +08:00
parent 25688fb49e
commit be0b4ee0db
5 changed files with 24 additions and 5 deletions

View File

@@ -394,7 +394,11 @@ remote_query_harbor(int harbor_id) {
char tmp2[sz+1];
memcpy(tmp2,zmq_msg_data(&reply),sz);
tmp2[sz] = '\0';
_remote_harbor_update(harbor_id, tmp2);
if (sz == 0) {
skynet_error(NULL,"Request harbor %d failed",harbor_id);
} else {
_remote_harbor_update(harbor_id, tmp2);
}
zmq_msg_close(&reply);
}

View File

@@ -263,6 +263,13 @@ skynet_command(struct skynet_context * context, const char * cmd , const char *
return skynet_handle_namehandle(context->handle, param + 1);
} else {
assert(context->handle!=0);
int i;
for (i=0;i<param[i];i++) {
if (!(param[i] >= '0' && param[i] <= '9')) {
break;
}
}
assert(param[i]);
skynet_harbor_register(param, context->handle);
return NULL;
}