Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
6afa2ae4
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,发现更多精彩内容 >>
提交
6afa2ae4
编写于
10月 25, 2000
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up broken test for whether to wait for input in SSL case.
Per discussion with Magnus Hagander.
上级
87968e30
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
27 deletion
+34
-27
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+34
-27
未找到文件。
src/backend/postmaster/postmaster.c
浏览文件 @
6afa2ae4
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.17
4 2000/10/24 21:33:52
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.17
5 2000/10/25 22:27:25
tgl Exp $
*
* NOTES
*
...
...
@@ -262,7 +262,7 @@ static void InitSSL(void);
#endif
#ifdef CYR_RECODE
void
GetCharSetByHost
(
char
*
,
int
,
char
*
);
extern
void
GetCharSetByHost
(
char
*
,
int
,
char
*
);
#endif
...
...
@@ -803,34 +803,38 @@ ServerLoop(void)
Port
*
port
;
fd_set
rmask
,
wmask
;
struct
timeval
*
timeout
=
(
struct
timeval
*
)
NULL
;
#ifdef USE_SSL
bool
no_select
=
false
;
#endif
struct
timeval
timeout_tv
;
/*
* Wait for something to happen.
* If we are using SSL, there may be input data already read and
* pending in SSL's input buffers. If so, check for additional
* input from other clients, but don't delay before processing.
*/
memcpy
((
char
*
)
&
rmask
,
(
char
*
)
&
readmask
,
sizeof
(
fd_set
));
memcpy
((
char
*
)
&
wmask
,
(
char
*
)
&
writemask
,
sizeof
(
fd_set
));
#ifdef USE_SSL
for
(
curr
=
DLGetHead
(
PortList
);
curr
;
curr
=
DLGetSucc
(
curr
))
{
if
(((
Port
*
)
DLE_VAL
(
curr
))
->
ssl
&&
SSL_pending
(((
Port
*
)
DLE_VAL
(
curr
))
->
ssl
)
>
0
)
Port
*
port
=
(
Port
*
)
DLE_VAL
(
curr
);
if
(
port
->
ssl
&&
SSL_pending
(
port
->
ssl
))
{
no_select
=
true
;
timeout_tv
.
tv_sec
=
0
;
timeout_tv
.
tv_usec
=
0
;
timeout
=
&
timeout_tv
;
break
;
}
}
if
(
no_select
)
FD_ZERO
(
&
rmask
);
/* So we don't accept() anything below */
#endif
/*
* Wait for something to happen.
*/
memcpy
((
char
*
)
&
rmask
,
(
char
*
)
&
readmask
,
sizeof
(
fd_set
));
memcpy
((
char
*
)
&
wmask
,
(
char
*
)
&
writemask
,
sizeof
(
fd_set
));
PG_SETMASK
(
&
UnBlockSig
);
if
(
select
(
nSockets
,
&
rmask
,
&
wmask
,
(
fd_set
*
)
NULL
,
(
struct
timeval
*
)
NULL
)
<
0
)
if
(
select
(
nSockets
,
&
rmask
,
&
wmask
,
(
fd_set
*
)
NULL
,
timeout
)
<
0
)
{
if
(
errno
==
EINTR
||
errno
==
EWOULDBLOCK
)
continue
;
...
...
@@ -894,8 +898,10 @@ ServerLoop(void)
(
void
*
)
port
);
}
/* Build up new masks for select(). */
/*
* Scan active ports, processing any available input. While we
* are at it, build up new masks for next select().
*/
nSockets
=
initMasks
(
&
readmask
,
&
writemask
);
curr
=
DLGetHead
(
PortList
);
...
...
@@ -946,7 +952,7 @@ ServerLoop(void)
/*
* Can't start backend if max backend count is exceeded.
*
* The same when
shutdowning data bas
e.
* The same when
data base is in startup/shutdown mod
e.
*/
if
(
Shutdown
>
NoShutdown
)
PacketSendError
(
&
port
->
pktInfo
,
...
...
@@ -966,8 +972,8 @@ ServerLoop(void)
/*
* If the backend start fails then keep the connection
* open to report it. Otherwise, pretend there is an
* error to close
the connection which will now be
* managed by the backend.
* error to close
our descriptor for the connection,
*
which will now be
managed by the backend.
*/
if
(
BackendStartup
(
port
)
!=
STATUS_OK
)
PacketSendError
(
&
port
->
pktInfo
,
...
...
@@ -1067,22 +1073,23 @@ readStartupPacket(void *arg, PacketLen len, void *pkt)
char
SSLok
;
#ifdef USE_SSL
if
(
!
EnableSSL
||
port
->
laddr
.
sa
.
sa_family
!=
AF_INET
)
/* No SSL when disabled or on Unix sockets */
SSLok
=
'N'
;
/* No SSL when disabled or on Unix sockets */
if
(
!
EnableSSL
||
port
->
laddr
.
sa
.
sa_family
!=
AF_INET
)
SSLok
=
'N'
;
else
SSLok
=
'S'
;
/* Support for SSL */
SSLok
=
'S'
;
/* Support for SSL */
#else
SSLok
=
'N'
;
/* No support for SSL */
#endif
if
(
send
(
port
->
sock
,
&
SSLok
,
1
,
0
)
!=
1
)
{
perror
(
"Failed to send SSL negotiation response"
);
return
STATUS_ERROR
;
/* Close connection */
return
STATUS_ERROR
;
/* Close connection */
}
#ifdef USE_SSL
if
(
SSLok
==
'S'
)
{
if
(
SSLok
==
'S'
)
{
if
(
!
(
port
->
ssl
=
SSL_new
(
SSL_context
))
||
!
SSL_set_fd
(
port
->
ssl
,
port
->
sock
)
||
SSL_accept
(
port
->
ssl
)
<=
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录