mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
add ipv6 host support to service_gate.c
service_gate的地址解析用strchr找到第一个':',并将后续的字符串作为 端口号解析。填ipv6地址"0:0:0:0:0:0:0:0:9999"的时候会出错,现在改成 strrchr,从右面找到的第一个':'
This commit is contained in:
@@ -313,7 +313,7 @@ _cb(struct skynet_context * ctx, void * ud, int type, int session, uint32_t sour
|
||||
static int
|
||||
start_listen(struct gate *g, char * listen_addr) {
|
||||
struct skynet_context * ctx = g->ctx;
|
||||
char * portstr = strchr(listen_addr,':');
|
||||
char * portstr = strrchr(listen_addr,':');
|
||||
const char * host = "";
|
||||
int port;
|
||||
if (portstr == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user