1313 *
1414 * Copyright (c) 2001-2003, PostgreSQL Global Development Group
1515 *
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 $
1717 * ----------
1818 */
1919#include "postgres.h"
@@ -1591,8 +1591,6 @@ pgstat_recvbuffer(void)
15911591 int msg_send = 0 ; /* next send index in buffer */
15921592 int msg_recv = 0 ; /* next receive index */
15931593 int msg_have = 0 ; /* number of bytes stored */
1594- struct sockaddr_storage fromaddr ;
1595- int fromlen ;
15961594 bool overflow = false;
15971595
15981596 /*
@@ -1702,10 +1700,8 @@ pgstat_recvbuffer(void)
17021700 */
17031701 if (FD_ISSET (pgStatSock , & rfds ))
17041702 {
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 );
17091705 if (len < 0 )
17101706 {
17111707 ereport (LOG ,
@@ -1726,16 +1722,6 @@ pgstat_recvbuffer(void)
17261722 if (input_buffer .msg_hdr .m_size != len )
17271723 continue ;
17281724
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-
17391725 /*
17401726 * O.K. - we accept this message. Copy it to the circular
17411727 * msgbuffer.
0 commit comments