Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
c68d6ea3
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c68d6ea3
编写于
6月 25, 2016
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better message when listen_host is IPv6 address and IPv6 is disabled [#METR-21842].
上级
bd74c2bd
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
2 deletion
+25
-2
contrib/libpoco/Net/src/DNS.cpp
contrib/libpoco/Net/src/DNS.cpp
+5
-1
dbms/src/Server/Server.cpp
dbms/src/Server/Server.cpp
+20
-1
未找到文件。
contrib/libpoco/Net/src/DNS.cpp
浏览文件 @
c68d6ea3
...
...
@@ -419,7 +419,11 @@ void DNS::aierror(int code, const std::string& arg)
throw
HostNotFoundException
(
arg
);
#endif
default:
throw
DNSException
(
"EAI"
,
NumberFormatter
::
format
(
code
));
#if defined(POCO_HAVE_ADDRINFO)
throw
DNSException
(
gai_strerror
(
code
),
NumberFormatter
::
format
(
code
),
code
);
#else
throw
DNSException
(
"EAI"
,
NumberFormatter
::
format
(
code
),
code
);
#endif
}
#endif // POCO_HAVE_IPv6 || defined(POCO_HAVE_ADDRINFO)
}
...
...
dbms/src/Server/Server.cpp
浏览文件 @
c68d6ea3
...
...
@@ -2,6 +2,7 @@
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/DNS.h>
#include <Poco/Net/NetException.h>
#include <Poco/Util/XMLConfiguration.h>
#include <Poco/DirectoryIterator.h>
...
...
@@ -371,7 +372,25 @@ int Server::main(const std::vector<std::string> & args)
http_params
->
setKeepAliveTimeout
(
keep_alive_timeout
);
/// HTTP
Poco
::
Net
::
ServerSocket
http_socket
(
Poco
::
Net
::
SocketAddress
(
listen_host
,
config
().
getInt
(
"http_port"
)));
Poco
::
Net
::
SocketAddress
http_socket_address
;
try
{
http_socket_address
=
Poco
::
Net
::
SocketAddress
(
listen_host
,
config
().
getInt
(
"http_port"
));
}
catch
(
const
Poco
::
Net
::
DNSException
&
e
)
{
/// Better message when IPv6 is disabled on host.
if
(
e
.
code
()
==
EAI_ADDRFAMILY
)
{
LOG_ERROR
(
log
,
"Cannot resolve listen_host ("
<<
listen_host
+
"), error: "
<<
e
.
message
()
<<
". "
"If it is an IPv6 address and your host has disabled IPv6, then consider to specify IPv4 address to listen in <listen_host> element of configuration file. Example: <listen_host>0.0.0.0</listen_host>"
);
}
throw
;
}
Poco
::
Net
::
ServerSocket
http_socket
(
http_socket_address
);
http_socket
.
setReceiveTimeout
(
settings
.
receive_timeout
);
http_socket
.
setSendTimeout
(
settings
.
send_timeout
);
Poco
::
Net
::
HTTPServer
http_server
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录