mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Change libpq's PQgetssl() to return a void*, rather than SSL *, so that
applications don't need the SSL headers. Martijn van Oosterhout
This commit is contained in:
		@@ -11,7 +11,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * IDENTIFICATION
 | 
				
			||||||
 *	  $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.76 2006/04/27 00:36:34 momjian Exp $
 | 
					 *	  $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.77 2006/04/27 00:53:58 momjian Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * NOTES
 | 
					 * NOTES
 | 
				
			||||||
 *	  [ Most of these notes are wrong/obsolete, but perhaps not all ]
 | 
					 *	  [ Most of these notes are wrong/obsolete, but perhaps not all ]
 | 
				
			||||||
@@ -1014,9 +1014,9 @@ SSLerrfree(char *buf)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *	Return pointer to SSL object.
 | 
					 *	Return pointer to OpenSSL object.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
SSL *
 | 
					void *
 | 
				
			||||||
PQgetssl(PGconn *conn)
 | 
					PQgetssl(PGconn *conn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!conn)
 | 
						if (!conn)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@
 | 
				
			|||||||
 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
 | 
					 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
 | 
				
			||||||
 * Portions Copyright (c) 1994, Regents of the University of California
 | 
					 * Portions Copyright (c) 1994, Regents of the University of California
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.126 2006/03/20 15:07:05 momjian Exp $
 | 
					 * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.127 2006/04/27 00:53:58 momjian Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *-------------------------------------------------------------------------
 | 
					 *-------------------------------------------------------------------------
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -28,11 +28,6 @@ extern		"C"
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
#include "postgres_ext.h"
 | 
					#include "postgres_ext.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SSL type is needed here only to declare PQgetssl() */
 | 
					 | 
				
			||||||
#ifdef USE_SSL
 | 
					 | 
				
			||||||
#include <openssl/ssl.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Application-visible enum types */
 | 
					/* Application-visible enum types */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum
 | 
					typedef enum
 | 
				
			||||||
@@ -271,12 +266,9 @@ extern int	PQbackendPID(const PGconn *conn);
 | 
				
			|||||||
extern int	PQclientEncoding(const PGconn *conn);
 | 
					extern int	PQclientEncoding(const PGconn *conn);
 | 
				
			||||||
extern int	PQsetClientEncoding(PGconn *conn, const char *encoding);
 | 
					extern int	PQsetClientEncoding(PGconn *conn, const char *encoding);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_SSL
 | 
					/* Get the OpenSSL structure associated with a connection. Returns NULL for
 | 
				
			||||||
/* Get the SSL structure associated with a connection */
 | 
					 * unencrypted connections or if any other TLS library is in use. */
 | 
				
			||||||
extern SSL *PQgetssl(PGconn *conn);
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
extern void *PQgetssl(PGconn *conn);
 | 
					extern void *PQgetssl(PGconn *conn);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Tell libpq whether it needs to initialize OpenSSL */
 | 
					/* Tell libpq whether it needs to initialize OpenSSL */
 | 
				
			||||||
extern void PQinitSSL(int do_init);
 | 
					extern void PQinitSSL(int do_init);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user