MCPcopy Create free account
hub / github.com/apache/cloudberry / SSLerrmessage

Function SSLerrmessage

src/interfaces/libpq/fe-secure-openssl.c:1551–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1549#define SSL_ERR_LEN 128
1550
1551static char *
1552SSLerrmessage(unsigned long ecode)
1553{
1554 const char *errreason;
1555 char *errbuf;
1556
1557 errbuf = malloc(SSL_ERR_LEN);
1558 if (!errbuf)
1559 return ssl_nomem;
1560 if (ecode == 0)
1561 {
1562 snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("no SSL error reported"));
1563 return errbuf;
1564 }
1565 errreason = ERR_reason_error_string(ecode);
1566 if (errreason != NULL)
1567 {
1568 strlcpy(errbuf, errreason, SSL_ERR_LEN);
1569 return errbuf;
1570 }
1571 snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("SSL error code %lu"), ecode);
1572 return errbuf;
1573}
1574
1575static void
1576SSLerrfree(char *buf)

Callers 4

pgtls_readFunction · 0.70
pgtls_writeFunction · 0.70
initialize_SSLFunction · 0.70
open_client_SSLFunction · 0.70

Calls 2

libpq_gettextFunction · 0.85
strlcpyFunction · 0.85

Tested by

no test coverage detected