Re: PQinitSSL broken in some use casesf

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PQinitSSL broken in some use casesf
Date: 2009-02-13 21:32:15
Message-ID: 4995E6DF.7090906@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> is, how does the client know whether the function recognized all the
> bits it passed?

How about returning the bits it could set?

int mask = PG_INITSSL | PG_INITCRYPTO;
if (!(PQinitSecure(mask) & PG_INITCRYPTO))
; // no support for crypto

...OR...

consider a generic PQinit call per system/object/etc..

int PQinit(int which, void *data);

int mask = PG_SECURE_SSL | PG_SECURE_CRYPTO;
PQinit(PG_INIT_SECURE, &mask); // or PG_INIT_OPENSSL

xxx_t xxx = {0, "blah", 12};
PQinit(PG_INIT_xxx, &xxx);

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-02-13 21:53:31 Re: PQinitSSL broken in some use casesf
Previous Message Robert Haas 2009-02-13 21:20:11 Re: The science of optimization in practical terms?