Minor code beautification in contrib/sslinfo.

Static-ify some functions that didn't need to be exported, and improve
a couple of comments.

Gurjeet Singh
This commit is contained in:
Tom Lane 2014-01-17 20:58:31 -05:00
parent e6170126fc
commit af9e3d6523
1 changed files with 9 additions and 8 deletions

View File

@ -31,9 +31,10 @@ Datum ssl_client_dn_field(PG_FUNCTION_ARGS);
Datum ssl_issuer_field(PG_FUNCTION_ARGS);
Datum ssl_client_dn(PG_FUNCTION_ARGS);
Datum ssl_issuer_dn(PG_FUNCTION_ARGS);
Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName);
Datum X509_NAME_to_text(X509_NAME *name);
Datum ASN1_STRING_to_text(ASN1_STRING *str);
static Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName);
static Datum X509_NAME_to_text(X509_NAME *name);
static Datum ASN1_STRING_to_text(ASN1_STRING *str);
/*
@ -51,7 +52,7 @@ ssl_is_used(PG_FUNCTION_ARGS)
/*
* Returns SSL cipher currently in use.
* Returns SSL version currently in use.
*/
PG_FUNCTION_INFO_V1(ssl_version);
Datum
@ -77,7 +78,7 @@ ssl_cipher(PG_FUNCTION_ARGS)
/*
* Indicates whether current client have provided a certificate
* Indicates whether current client provided a certificate
*
* Function has no arguments. Returns bool. True if current session
* is SSL session and client certificate is verified, otherwise false.
@ -138,7 +139,7 @@ ssl_client_serial(PG_FUNCTION_ARGS)
* Returns Datum, which can be directly returned from a C language SQL
* function.
*/
Datum
static Datum
ASN1_STRING_to_text(ASN1_STRING *str)
{
BIO *membuf;
@ -182,7 +183,7 @@ ASN1_STRING_to_text(ASN1_STRING *str)
* Returns result of ASN1_STRING_to_text applied to appropriate
* part of name
*/
Datum
static Datum
X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
{
char *string_fieldname;
@ -287,7 +288,7 @@ ssl_issuer_field(PG_FUNCTION_ARGS)
* Returns: text datum which contains string representation of
* X509_NAME
*/
Datum
static Datum
X509_NAME_to_text(X509_NAME *name)
{
BIO *membuf = BIO_new(BIO_s_mem());