MCPcopy Create free account
hub / github.com/apache/thrift / buildErrors

Function buildErrors

lib/cpp/src/thrift/transport/TSSLSocket.cpp:1142–1177  ·  view source on GitHub ↗

extract error messages from error queue

Source from the content-addressed store, hash-verified

1140
1141// extract error messages from error queue
1142void buildErrors(string& errors, int errno_copy, int sslerrno) {
1143 unsigned long errorCode;
1144 char message[256];
1145
1146 errors.reserve(512);
1147 while ((errorCode = ERR_get_error()) != 0) {
1148 if (!errors.empty()) {
1149 errors += "; ";
1150 }
1151 const char* reason = ERR_reason_error_string(errorCode);
1152 if (reason == nullptr) {
1153 THRIFT_SNPRINTF(message, sizeof(message) - 1, "SSL error # %lu", errorCode);
1154 reason = message;
1155 }
1156 errors += reason;
1157 }
1158 if (errors.empty()) {
1159 if (errno_copy != 0) {
1160 errors += TOutput::strerror_s(errno_copy);
1161 }
1162 }
1163 if (errors.empty()) {
1164 errors = "error code: " + to_string(errno_copy);
1165 }
1166 if (sslerrno) {
1167 errors += " (SSL_error_code = " + to_string(sslerrno) + ")";
1168 if (sslerrno == SSL_ERROR_SYSCALL) {
1169 char buf[4096];
1170 int err;
1171 while ((err = ERR_get_error()) != 0) {
1172 errors += " ";
1173 errors += ERR_error_string(err, buf);
1174 }
1175 }
1176 }
1177}
1178
1179/**
1180 * Default implementation of AccessManager

Callers 15

SSLContextMethod · 0.85
createSSLMethod · 0.85
peekMethod · 0.85
closeMethod · 0.85
readMethod · 0.85
writeMethod · 0.85
write_partialMethod · 0.85
flushMethod · 0.85
initializeHandshakeMethod · 0.85
ciphersMethod · 0.85
loadCertificateMethod · 0.85

Calls 2

emptyMethod · 0.80
to_stringFunction · 0.50

Tested by

no test coverage detected