Thread: RE: [HACKERS] Libpq functions

RE: [HACKERS] Libpq functions

From
Magnus Hagander
Date:
On Saturday, January 09, 1999 11:13 PM, Tom Lane [SMTP:tgl@sss.pgh.pa.us]
wrote:
> Magnus Hagander <mha@sollentuna.net> writes:
> > Well, I see one reason to change it. Which is why I came up with the
> > question in the first place. I was looking at the possibility of putting
SSL
> > on top of libpq. I have a project I'm working on that needs to transmit
> > "lightly sensitive data" across the internet. Right now using SSH
> > forwardings, but that's not exactly the "ideal solution".
> > Anyway, SSLeay has functions that replace read() and write(), but
nothing to
> > work with FILE *:s.
> > So if there are no major objections, I might take a shot at changing it
to
> > working directly on the socket, and put SSLeay on it.
> 
> Ah.  Now that you mention it, I recall someone bringing up that exact
> issue last summer on the hackers list.  Was that you?  If not, you might
> want to go digging in the list archives (I forget what was said...)

Could've been me. I'll go check to be sure.
I remember fighting this same obstacle in the frontend library before you
fixed it - because Win32 does not handle fdopen() on sockets.


Also, I noticed that in backend/util/error/elog.c, it checks for "Pfout !=
NULL" to see if it's running under the postmaster. If Pfout == NULL, it
sends its data out to stderr instead of the client.
Shouldn't it be safe to just if on the global "IsUnderPostmaster" boolean
here? Or am I missing something? (I'm starting my work by trying to get rid
of anything other than pqcomm.c using Pfout and Pfin).

//Magnus


Re: [HACKERS] Libpq functions

From
Bruce Momjian
Date:
> Also, I noticed that in backend/util/error/elog.c, it checks for "Pfout !=
> NULL" to see if it's running under the postmaster. If Pfout == NULL, it
> sends its data out to stderr instead of the client.
> Shouldn't it be safe to just if on the global "IsUnderPostmaster" boolean
> here? Or am I missing something? (I'm starting my work by trying to get rid
> of anything other than pqcomm.c using Pfout and Pfin).

Not sure, but it is possible the coder didn't know about the variable.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026