Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
725bbde0
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,发现更多精彩内容 >>
提交
725bbde0
编写于
11月 10, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up indenting.
上级
baeb8790
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
77 addition
and
69 deletion
+77
-69
src/backend/libpq/be-pqexec.c
src/backend/libpq/be-pqexec.c
+2
-2
src/backend/libpq/hba.c
src/backend/libpq/hba.c
+4
-4
src/backend/libpq/portal.c
src/backend/libpq/portal.c
+2
-2
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+64
-56
src/backend/libpq/pqpacket.c
src/backend/libpq/pqpacket.c
+5
-5
未找到文件。
src/backend/libpq/be-pqexec.c
浏览文件 @
725bbde0
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.
8 1997/10/25 01:09:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.
9 1997/11/10 05:15:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -241,7 +241,7 @@ strmake(char *str, int len)
...
@@ -241,7 +241,7 @@ strmake(char *str, int len)
len
=
strlen
(
str
);
len
=
strlen
(
str
);
newstr
=
(
char
*
)
palloc
((
unsigned
)
len
+
1
);
newstr
=
(
char
*
)
palloc
((
unsigned
)
len
+
1
);
StrNCpy
(
newstr
,
str
,
len
+
1
);
StrNCpy
(
newstr
,
str
,
len
+
1
);
newstr
[
len
]
=
(
char
)
0
;
newstr
[
len
]
=
(
char
)
0
;
return
newstr
;
return
newstr
;
}
}
...
...
src/backend/libpq/hba.c
浏览文件 @
725bbde0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.2
3 1997/11/07 20:51:27
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.2
4 1997/11/10 05:15:52
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -907,10 +907,10 @@ hba_recvauth(const Port *port, const char database[], const char user[],
...
@@ -907,10 +907,10 @@ hba_recvauth(const Port *port, const char database[], const char user[],
int
retvalue
;
int
retvalue
;
/* UNIX socket always OK, for now */
/* UNIX socket always OK, for now */
if
(
port
->
raddr
.
in
.
sin_family
==
AF_UNIX
)
if
(
port
->
raddr
.
in
.
sin_family
==
AF_UNIX
)
return
STATUS_OK
;
return
STATUS_OK
;
/* Our eventual return value */
/* Our eventual return value */
find_hba_entry
(
DataDir
,
port
->
raddr
.
in
.
sin_addr
,
database
,
find_hba_entry
(
DataDir
,
port
->
raddr
.
in
.
sin_addr
,
database
,
&
host_ok
,
&
userauth
,
usermap_name
,
&
host_ok
,
&
userauth
,
usermap_name
,
...
...
src/backend/libpq/portal.c
浏览文件 @
725bbde0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.1
0 1997/10/25 01:09:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.1
1 1997/11/10 05:15:54
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -154,7 +154,7 @@ PQpnames(char **pnames, int rule_p)
...
@@ -154,7 +154,7 @@ PQpnames(char **pnames, int rule_p)
{
{
if
(
!
rule_p
||
portals
[
i
]
->
portal
->
rule_p
)
if
(
!
rule_p
||
portals
[
i
]
->
portal
->
rule_p
)
{
{
strncpy
(
pnames
[
cur_pname
],
portals
[
i
]
->
name
,
PortalNameLength
+
1
);
strncpy
(
pnames
[
cur_pname
],
portals
[
i
]
->
name
,
PortalNameLength
+
1
);
++
cur_pname
;
++
cur_pname
;
}
}
}
}
...
...
src/backend/libpq/pqcomm.c
浏览文件 @
725bbde0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.2
5 1997/11/10 02:21:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.2
6 1997/11/10 05:15:56
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -574,20 +574,25 @@ pq_async_notify()
...
@@ -574,20 +574,25 @@ pq_async_notify()
static
char
sock_path
[
100
]
=
""
;
static
char
sock_path
[
100
]
=
""
;
static
void
do_unlink
()
static
void
do_unlink
()
{
{
if
(
sock_path
[
0
])
unlink
(
sock_path
);
if
(
sock_path
[
0
])
unlink
(
sock_path
);
}
}
int
int
StreamServerPort
(
char
*
hostName
,
short
portName
,
int
*
fdP
)
StreamServerPort
(
char
*
hostName
,
short
portName
,
int
*
fdP
)
{
{
union
{
union
struct
sockaddr_in
in
;
{
struct
sockaddr_un
un
;
struct
sockaddr_in
in
;
}
saddr
;
struct
sockaddr_un
un
;
int
fd
,
err
,
family
;
}
saddr
;
size_t
len
;
int
fd
,
err
,
family
;
size_t
len
;
int
one
=
1
;
int
one
=
1
;
family
=
hostName
!=
NULL
?
AF_INET
:
AF_UNIX
;
family
=
hostName
!=
NULL
?
AF_INET
:
AF_UNIX
;
...
@@ -601,7 +606,8 @@ StreamServerPort(char *hostName, short portName, int *fdP)
...
@@ -601,7 +606,8 @@ StreamServerPort(char *hostName, short portName, int *fdP)
pqdebug
(
"%s"
,
PQerrormsg
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
(
STATUS_ERROR
);
return
(
STATUS_ERROR
);
}
}
if
(
family
==
AF_UNIX
)
on_exitpg
(
do_unlink
,
(
caddr_t
)
0
);
if
(
family
==
AF_UNIX
)
on_exitpg
(
do_unlink
,
(
caddr_t
)
0
);
if
((
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
one
,
if
((
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
one
,
sizeof
(
one
)))
==
-
1
)
sizeof
(
one
)))
==
-
1
)
{
{
...
@@ -614,19 +620,19 @@ StreamServerPort(char *hostName, short portName, int *fdP)
...
@@ -614,19 +620,19 @@ StreamServerPort(char *hostName, short portName, int *fdP)
}
}
bzero
(
&
saddr
,
sizeof
(
saddr
));
bzero
(
&
saddr
,
sizeof
(
saddr
));
if
(
family
==
AF_UNIX
)
if
(
family
==
AF_UNIX
)
{
{
saddr
.
un
.
sun_family
=
family
;
saddr
.
un
.
sun_family
=
family
;
len
=
UNIXSOCK_PATH
(
saddr
.
un
,
portName
);
len
=
UNIXSOCK_PATH
(
saddr
.
un
,
portName
);
strcpy
(
sock_path
,
saddr
.
un
.
sun_path
);
strcpy
(
sock_path
,
saddr
.
un
.
sun_path
);
}
}
else
else
{
{
saddr
.
in
.
sin_family
=
family
;
saddr
.
in
.
sin_family
=
family
;
saddr
.
in
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
saddr
.
in
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
saddr
.
in
.
sin_port
=
htons
(
portName
);
saddr
.
in
.
sin_port
=
htons
(
portName
);
len
=
sizeof
saddr
.
in
;
len
=
sizeof
saddr
.
in
;
}
}
err
=
bind
(
fd
,
(
struct
sockaddr
*
)
&
saddr
,
len
);
err
=
bind
(
fd
,
(
struct
sockaddr
*
)
&
saddr
,
len
);
if
(
err
<
0
)
if
(
err
<
0
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
...
@@ -664,21 +670,22 @@ StreamServerPort(char *hostName, short portName, int *fdP)
...
@@ -664,21 +670,22 @@ StreamServerPort(char *hostName, short portName, int *fdP)
int
int
StreamConnection
(
int
server_fd
,
Port
*
port
)
StreamConnection
(
int
server_fd
,
Port
*
port
)
{
{
int
len
,
addrlen
;
int
len
,
int
family
=
port
->
raddr
.
in
.
sin_family
;
addrlen
;
int
family
=
port
->
raddr
.
in
.
sin_family
;
/* accept connection (and fill in the client (remote) address) */
/* accept connection (and fill in the client (remote) address) */
len
=
family
==
AF_INET
?
len
=
family
==
AF_INET
?
sizeof
(
struct
sockaddr_in
)
:
sizeof
(
struct
sockaddr_un
);
sizeof
(
struct
sockaddr_in
)
:
sizeof
(
struct
sockaddr_un
);
addrlen
=
len
;
addrlen
=
len
;
if
((
port
->
sock
=
accept
(
server_fd
,
if
((
port
->
sock
=
accept
(
server_fd
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
&
addrlen
))
<
0
)
&
addrlen
))
<
0
)
{
{
elog
(
WARN
,
"postmaster: StreamConnection: accept: %m"
);
elog
(
WARN
,
"postmaster: StreamConnection: accept: %m"
);
return
(
STATUS_ERROR
);
return
(
STATUS_ERROR
);
}
}
/* fill in the server (local) address */
/* fill in the server (local) address */
addrlen
=
len
;
addrlen
=
len
;
if
(
getsockname
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
laddr
,
if
(
getsockname
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
laddr
,
...
@@ -737,50 +744,51 @@ StreamClose(int sock)
...
@@ -737,50 +744,51 @@ StreamClose(int sock)
int
int
StreamOpen
(
char
*
hostName
,
short
portName
,
Port
*
port
)
StreamOpen
(
char
*
hostName
,
short
portName
,
Port
*
port
)
{
{
int
len
,
err
;
int
len
,
err
;
struct
hostent
*
hp
;
struct
hostent
*
hp
;
extern
int
errno
;
extern
int
errno
;
/* set up the server (remote) address */
/* set up the server (remote) address */
MemSet
((
char
*
)
&
port
->
raddr
,
0
,
sizeof
(
port
->
raddr
));
MemSet
((
char
*
)
&
port
->
raddr
,
0
,
sizeof
(
port
->
raddr
));
if
(
hostName
)
if
(
hostName
)
{
{
if
(
!
(
hp
=
gethostbyname
(
hostName
))
||
hp
->
h_addrtype
!=
AF_INET
)
if
(
!
(
hp
=
gethostbyname
(
hostName
))
||
hp
->
h_addrtype
!=
AF_INET
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
"FATAL: StreamOpen: unknown hostname: %s
\n
"
,
"FATAL: StreamOpen: unknown hostname: %s
\n
"
,
hostName
);
hostName
);
fputs
(
PQerrormsg
,
stderr
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
(
STATUS_ERROR
);
return
(
STATUS_ERROR
);
}
}
memmove
((
char
*
)
&
(
port
->
raddr
.
in
.
sin_addr
),
memmove
((
char
*
)
&
(
port
->
raddr
.
in
.
sin_addr
),
(
char
*
)
hp
->
h_addr
,
(
char
*
)
hp
->
h_addr
,
hp
->
h_length
);
hp
->
h_length
);
port
->
raddr
.
in
.
sin_family
=
AF_INET
;
port
->
raddr
.
in
.
sin_family
=
AF_INET
;
port
->
raddr
.
in
.
sin_port
=
htons
(
portName
);
port
->
raddr
.
in
.
sin_port
=
htons
(
portName
);
len
=
sizeof
(
struct
sockaddr_in
);
len
=
sizeof
(
struct
sockaddr_in
);
}
}
else
else
{
{
port
->
raddr
.
un
.
sun_family
=
AF_UNIX
;
port
->
raddr
.
un
.
sun_family
=
AF_UNIX
;
len
=
UNIXSOCK_PATH
(
port
->
raddr
.
un
,
portName
);
len
=
UNIXSOCK_PATH
(
port
->
raddr
.
un
,
portName
);
}
}
/* connect to the server */
/* connect to the server */
if
((
port
->
sock
=
socket
(
port
->
raddr
.
in
.
sin_family
,
SOCK_STREAM
,
0
))
<
0
)
if
((
port
->
sock
=
socket
(
port
->
raddr
.
in
.
sin_family
,
SOCK_STREAM
,
0
))
<
0
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
"FATAL: StreamOpen: socket() failed: errno=%d
\n
"
,
"FATAL: StreamOpen: socket() failed: errno=%d
\n
"
,
errno
);
errno
);
fputs
(
PQerrormsg
,
stderr
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
(
STATUS_ERROR
);
return
(
STATUS_ERROR
);
}
}
err
=
connect
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
len
);
err
=
connect
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
len
);
if
(
err
<
0
)
if
(
err
<
0
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
"FATAL: StreamOpen: connect() failed: errno=%d
\n
"
,
"FATAL: StreamOpen: connect() failed: errno=%d
\n
"
,
errno
);
errno
);
fputs
(
PQerrormsg
,
stderr
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
@@ -789,7 +797,7 @@ StreamOpen(char *hostName, short portName, Port *port)
...
@@ -789,7 +797,7 @@ StreamOpen(char *hostName, short portName, Port *port)
/* fill in the client address */
/* fill in the client address */
if
(
getsockname
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
laddr
,
if
(
getsockname
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
laddr
,
&
len
)
<
0
)
&
len
)
<
0
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
"FATAL: StreamOpen: getsockname() failed: errno=%d
\n
"
,
"FATAL: StreamOpen: getsockname() failed: errno=%d
\n
"
,
...
...
src/backend/libpq/pqpacket.c
浏览文件 @
725bbde0
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.
9 1997/11/07 20:51:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.
10 1997/11/10 05:16:00
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -85,9 +85,9 @@ PacketReceive(Port *port, /* receive port */
...
@@ -85,9 +85,9 @@ PacketReceive(Port *port, /* receive port */
/*
/*
* Assume port->nBytes is zero unless we were interrupted during
* Assume port->nBytes is zero unless we were interrupted during
* non-blocking I/O. This first recv() is to get the hdr
* non-blocking I/O. This first recv() is to get the hdr
information
*
information so we know how many bytes to read. Life would be very
*
so we know how many bytes to read. Life would be very complicated
*
complicated
if we read too much data (buffering).
* if we read too much data (buffering).
*/
*/
tmp
=
((
Addr
)
buf
)
+
port
->
nBytes
;
tmp
=
((
Addr
)
buf
)
+
port
->
nBytes
;
...
@@ -227,7 +227,7 @@ PacketSend(Port *port,
...
@@ -227,7 +227,7 @@ PacketSend(Port *port,
Assert
(
!
nonBlocking
);
Assert
(
!
nonBlocking
);
Assert
(
buf
);
Assert
(
buf
);
doneLen
=
write
(
port
->
sock
,
buf
,
len
);
doneLen
=
write
(
port
->
sock
,
buf
,
len
);
if
(
doneLen
<
len
)
if
(
doneLen
<
len
)
{
{
sprintf
(
PQerrormsg
,
sprintf
(
PQerrormsg
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录