aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2013-04-16 21:42:10 -0400
committerPeter Eisentraut <peter_e@gmx.net>2013-04-16 21:42:10 -0400
commitb9bdaf3964a1fbd32e6140eb180dfa82ff1d8f23 (patch)
tree5fbfcd5e5f1e8150466adfa432b610ea2ddfd9c3
parentd61dddba37c27b1b5157b493bd04913c23ade7c2 (diff)
downloadpostgresql-b9bdaf3964a1fbd32e6140eb180dfa82ff1d8f23.tar.gz
postgresql-b9bdaf3964a1fbd32e6140eb180dfa82ff1d8f23.zip
doc: Update PQgetssl() documentation
The return type of PQgetssl() was changed from SSL* to void* a long time ago, but the documentation was not updated.
-rw-r--r--doc/src/sgml/libpq.sgml29
1 files changed, 24 insertions, 5 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 3b6ada08f7c..deef3be9659 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1864,7 +1864,7 @@ int PQconnectionUsedPassword(const PGconn *conn);
if SSL is not in use.
<synopsis>
-SSL *PQgetssl(const PGconn *conn);
+void *PQgetssl(const PGconn *conn);
</synopsis>
</para>
@@ -1875,10 +1875,29 @@ SSL *PQgetssl(const PGconn *conn);
</para>
<para>
- You must define <symbol>USE_SSL</symbol> in order to get the
- correct prototype for this function. Doing so will also
- automatically include <filename>ssl.h</filename> from
- <productname>OpenSSL</productname>.
+ The actual return value is of type <type>SSL *</type>,
+ where <type>SSL</type> is a type defined by
+ the <productname>OpenSSL</productname> library, but it is not declared
+ this way to avoid requiring the <productname>OpenSSL</productname>
+ header files. To use this function, code along the following lines
+ could be used:
+<programlisting><![CDATA[
+#include <libpq-fe.h>
+#include <openssl/ssl.h>
+
+...
+
+ SSL *ssl;
+
+ dbconn = PQconnectdb(...);
+ ...
+
+ ssl = PQgetssl(dbconn);
+ if (ssl)
+ {
+ /* use OpenSSL functions to access ssl */
+ }
+]]></programlisting>
</para>
</listitem>
</varlistentry>