Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
09a6c909
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
09a6c909
编写于
8月 25, 2005
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bogus freeaddrinfo() call in WIN32 code, extend gai_strerror to
cover more error codes. Per Petr Jelinek.
上级
1a334362
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
9 deletion
+49
-9
src/include/getaddrinfo.h
src/include/getaddrinfo.h
+14
-2
src/port/getaddrinfo.c
src/port/getaddrinfo.c
+35
-7
未找到文件。
src/include/getaddrinfo.h
浏览文件 @
09a6c909
...
...
@@ -15,7 +15,7 @@
*
* Copyright (c) 2003-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.1
5 2005/07/27 12:44:10 neilc
Exp $
* $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.1
6 2005/08/25 17:50:59 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,6 +31,7 @@
/* Various macros that ought to be in <netdb.h>, but might not be */
#ifndef EAI_FAIL
#ifndef WIN32
#define EAI_BADFLAGS (-1)
#define EAI_NONAME (-2)
#define EAI_AGAIN (-3)
...
...
@@ -40,7 +41,18 @@
#define EAI_SERVICE (-8)
#define EAI_MEMORY (-10)
#define EAI_SYSTEM (-11)
#endif
#else
/* WIN32 */
#define EAI_AGAIN WSATRY_AGAIN
#define EAI_BADFLAGS WSAEINVAL
#define EAI_FAIL WSANO_RECOVERY
#define EAI_FAMILY WSAEAFNOSUPPORT
#define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
#define EAI_NODATA WSANO_DATA
#define EAI_NONAME WSAHOST_NOT_FOUND
#define EAI_SERVICE WSATYPE_NOT_FOUND
#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
#endif
/* !WIN32 */
#endif
/* !EAI_FAIL */
#ifndef AI_PASSIVE
#define AI_PASSIVE 0x0001
...
...
src/port/getaddrinfo.c
浏览文件 @
09a6c909
...
...
@@ -16,7 +16,7 @@
* Copyright (c) 2003-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.1
8 2005/08/24 22:13:23
tgl Exp $
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.1
9 2005/08/25 17:51:01
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -103,9 +103,12 @@ haveNativeWindowsIPv6routines(void)
{
/* We found a dll, so now get the addresses of the routines */
getaddrinfo_ptr
=
GetProcAddress
(
hLibrary
,
"getaddrinfo"
);
freeaddrinfo_ptr
=
GetProcAddress
(
hLibrary
,
"freeaddrinfo"
);
getnameinfo_ptr
=
GetProcAddress
(
hLibrary
,
"getnameinfo"
);
getaddrinfo_ptr
=
(
getaddrinfo_ptr_t
)
GetProcAddress
(
hLibrary
,
"getaddrinfo"
);
freeaddrinfo_ptr
=
(
freeaddrinfo_ptr_t
)
GetProcAddress
(
hLibrary
,
"freeaddrinfo"
);
getnameinfo_ptr
=
(
getnameinfo_ptr_t
)
GetProcAddress
(
hLibrary
,
"getnameinfo"
);
/*
* If any one of the routines is missing, let's play it safe and
...
...
@@ -277,7 +280,7 @@ freeaddrinfo(struct addrinfo * res)
*/
if
(
haveNativeWindowsIPv6routines
())
{
(
*
freeaddrinfo_ptr
)
(
node
,
service
,
hintp
,
res
);
(
*
freeaddrinfo_ptr
)
(
res
);
return
;
}
#endif
...
...
@@ -310,7 +313,8 @@ gai_strerror(int errcode)
}
return
hstrerror
(
hcode
);
#else
/* !HAVE_HSTRERROR */
#else
/* !HAVE_HSTRERROR */
switch
(
errcode
)
{
...
...
@@ -318,7 +322,31 @@ gai_strerror(int errcode)
return
"Unknown host"
;
case
EAI_AGAIN
:
return
"Host name lookup failure"
;
case
EAI_FAIL
:
/* Errors below are probably WIN32 only */
#ifdef EAI_BADFLAGS
case
EAI_BADFLAGS
:
return
"Invalid argument"
;
#endif
#ifdef EAI_FAMILY
case
EAI_FAMILY
:
return
"Address family not supported"
;
#endif
#ifdef EAI_MEMORY
case
EAI_MEMORY
:
return
"Not enough memory"
;
#endif
#ifdef EAI_NODATA
case
EAI_NODATA
:
return
"No host data of that type was found"
;
#endif
#ifdef EAI_SERVICE
case
EAI_SERVICE
:
return
"Class type not found"
;
#endif
#ifdef EAI_SOCKTYPE
case
EAI_SOCKTYPE
:
return
"Socket type not supported"
;
#endif
default:
return
"Unknown server error"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录