未验证 提交 549e5911 编写于 作者: Y yapu.wang 提交者: GitHub

Merge pull request #1501 from wangjian1009/master

read http port from client.xml
......@@ -68,7 +68,15 @@ int parseCatClientConfig(ezxml_t f1) {
}
if (serverIndex == 0) {
const char * port;
g_config.serverHost = catsdsnew(ip);
port = ezxml_attr(server, "http-port");
if (port && port[0] != '\0') {
g_config.serverPort = atoi(port);
}
} else if (serverIndex >= g_config.serverNum) {
break;
}
......
......@@ -187,7 +187,7 @@ static sds inline _buildHttpHeader(
if (80 == port) {
return catsdscatprintf(buf, "Get http://%s%s HTTP/1.0\r\n", hostname, uri);
} else {
return catsdscatprintf(buf, "Get http://%s:%hd%s HTTP/1.0\r\n", hostname, port, uri);
return catsdscatprintf(buf, "Get http://%s:%u%s HTTP/1.0\r\n", hostname, port, uri);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册