13
13
*
14
14
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
15
15
*
16
- * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.43 2003/08/12 16: 21:18 tgl Exp $
16
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.43.2.1 2003/09/07 21:44:30 momjian Exp $
17
17
* ----------
18
18
*/
19
19
#include "postgres.h"
@@ -1591,8 +1591,6 @@ pgstat_recvbuffer(void)
1591
1591
int msg_send = 0 ; /* next send index in buffer */
1592
1592
int msg_recv = 0 ; /* next receive index */
1593
1593
int msg_have = 0 ; /* number of bytes stored */
1594
- struct sockaddr_storage fromaddr ;
1595
- int fromlen ;
1596
1594
bool overflow = false;
1597
1595
1598
1596
/*
@@ -1702,10 +1700,8 @@ pgstat_recvbuffer(void)
1702
1700
*/
1703
1701
if (FD_ISSET (pgStatSock , & rfds ))
1704
1702
{
1705
- fromlen = sizeof (fromaddr );
1706
- len = recvfrom (pgStatSock , (char * ) & input_buffer ,
1707
- sizeof (PgStat_Msg ), 0 ,
1708
- (struct sockaddr * ) & fromaddr , & fromlen );
1703
+ len = recv (pgStatSock , (char * ) & input_buffer ,
1704
+ sizeof (PgStat_Msg ), 0 );
1709
1705
if (len < 0 )
1710
1706
{
1711
1707
ereport (LOG ,
@@ -1726,16 +1722,6 @@ pgstat_recvbuffer(void)
1726
1722
if (input_buffer .msg_hdr .m_size != len )
1727
1723
continue ;
1728
1724
1729
- /*
1730
- * The source address of the packet must be our own socket.
1731
- * This ensures that only real hackers or our own backends
1732
- * tell us something. (This should be redundant with a
1733
- * kernel-level check due to having used connect(), but let's
1734
- * do it anyway.)
1735
- */
1736
- if (memcmp (& fromaddr , & pgStatAddr , fromlen ))
1737
- continue ;
1738
-
1739
1725
/*
1740
1726
* O.K. - we accept this message. Copy it to the circular
1741
1727
* msgbuffer.
0 commit comments