From: Bruce Momjian <pgman@candle.pha.pa.us>
To: jeff@jeffjohnson.net
Cc: pgsql-interfaces@postgresql.org
Cc: pgsql-docs@postgresql.org
Subject: Re: [INTERFACES] libpq sockets on win32
Date: Mon, 4 Jun 2001 14:22:45 -0400 (EDT)
Message-ID: <200106041822.f54IMjY29512@candle.pha.pa.us> (raw)
In-Reply-To: <B9C9130B5D27D4119D5D00A0C9D3A98710945E@SERVER>
Can you try this patch and let me know if it helps? It is a different
approach. This was the only place I saw errno checked for a
non-predefined value.
One other solution may be to use the #define only in the libpq C files
that need it. What really stinks is that the errno define is only
useful for socket errno settings.
I do see a use in fe-connect.c:
#ifndef WIN32
if (errno == EINPROGRESS || errno == 0)
#else
if (WSAGetLastError() == WSAEINPROGRESS)
#endif
I hate to litter this through the whole source. I wonder if we have to
bracket the errno checkes with #define/#undef. Can you try that with
the fix described on the web page. The above would convert to:
#ifdef WIN32
#define errno WSAGetLastError
#endif
if (errno == EINPROGRESS || errno == 0)
#ifdef WIN32
#undef errno
#endif
Maybe make these into their own macros somehow.
> > > This article describes the problem and work around.
> > > http://msdn.microsoft.com/library/psdk/winsock/ovrvw3_26ia.htm
> >
> > I can't read that web site under Netscape.
> >
> > If I could read it, I think I could fix it. Please send it in some
> > readable format.
> >
>
> I chopped the content out and stuck it into a basic HTML file and
> attached it.
>
> Thanks for taking a look,
> Jeff
[ Attachment, skipping... ]
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Attachments:/bjm/diff (text/plain, 584B) download
Index: src/interfaces/libpq/fe-misc.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v
retrieving revision 1.49
diff -c -r1.49 fe-misc.c
*** src/interfaces/libpq/fe-misc.c 2001/05/28 15:29:51 1.49
--- src/interfaces/libpq/fe-misc.c 2001/06/04 17:52:40
***************
*** 614,619 ****
--- 614,623 ----
int sent;
+ #ifdef WIN32
+ errno = 0; /* Win32 doesn't set this, needs reset */
+ #endif
+
#ifdef USE_SSL
if (conn->ssl)
sent = SSL_write(conn->ssl, ptr, len);
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: pgman@candle.pha.pa.us, jeff@jeffjohnson.net, pgsql-docs@postgresql.org
Subject: Re: [INTERFACES] libpq sockets on win32
In-Reply-To: <200106041822.f54IMjY29512@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox