Re: PQinitSSL broken in some use casesf - Mailing list pgsql-hackers

From Andrew Chernow
Subject Re: PQinitSSL broken in some use casesf
Date
Msg-id 4995E6DF.7090906@esilo.com
Whole thread Raw
In response to Re: PQinitSSL broken in some use casesf  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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/


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: The science of optimization in practical terms?
Next
From: Robert Haas
Date:
Subject: Re: PQinitSSL broken in some use casesf