Begin debugging OpenSSL.

This commit is contained in:
Jordan Bancino 2023-04-24 17:05:59 +00:00
parent a525830b64
commit 05cf076ebc
4 changed files with 6 additions and 4 deletions

View file

@ -82,7 +82,7 @@ Milestone: v0.3.0
[ ] Refactor dev pages so function description and [ ] Refactor dev pages so function description and
return value are in the same location. return value are in the same location.
[ ] Debug memory leaks with caching [x] Debug memory leaks with caching
[ ] Debug OpenSSL [ ] Debug OpenSSL
[~] Client-Server API [~] Client-Server API

View file

@ -805,7 +805,7 @@ DbUnlock(Db * db, DbRef * ref)
{ {
pthread_mutex_unlock(&db->lock); pthread_mutex_unlock(&db->lock);
Log(LOG_ERR, "Failed to truncate file on disk."); Log(LOG_ERR, "Failed to truncate file on disk.");
Log(LOG_ERR, "Error: %s", strerror(errno)); Log(LOG_ERR, "Error on fd %d: %s", ref->fd, strerror(errno));
return 0; return 0;
} }

View file

@ -39,6 +39,7 @@ ROUTE_IMPL(RouteUiaFallback, path, argp)
if (!authType) if (!authType)
{ {
/* This should never happen */ /* This should never happen */
Log(LOG_ERR, "Programmer error in RouteUiaFallback()!");
HttpResponseStatus(args->context, HTTP_INTERNAL_SERVER_ERROR); HttpResponseStatus(args->context, HTTP_INTERNAL_SERVER_ERROR);
return MatrixErrorCreate(M_UNKNOWN); return MatrixErrorCreate(M_UNKNOWN);
} }
@ -55,6 +56,7 @@ ROUTE_IMPL(RouteUiaFallback, path, argp)
config = ConfigLock(args->matrixArgs->db); config = ConfigLock(args->matrixArgs->db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "UIA fallback failed to lock configuration.");
HttpResponseStatus(args->context, HTTP_INTERNAL_SERVER_ERROR); HttpResponseStatus(args->context, HTTP_INTERNAL_SERVER_ERROR);
return MatrixErrorCreate(M_UNKNOWN); return MatrixErrorCreate(M_UNKNOWN);
} }

View file

@ -226,7 +226,6 @@ TlsRead(void *cookie, void *buf, size_t nBytes)
if (ret <= 0) if (ret <= 0)
{ {
ret = -1;
switch (SSL_get_error(ssl->ssl, ret)) switch (SSL_get_error(ssl->ssl, ret))
{ {
case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_READ:
@ -243,6 +242,7 @@ TlsRead(void *cookie, void *buf, size_t nBytes)
errno = EIO; errno = EIO;
break; break;
} }
ret = -1;
} }
return ret; return ret;
@ -256,7 +256,6 @@ TlsWrite(void *cookie, void *buf, size_t nBytes)
if (ret <= 0) if (ret <= 0)
{ {
ret = -1;
switch (SSL_get_error(ssl->ssl, ret)) switch (SSL_get_error(ssl->ssl, ret))
{ {
case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_READ:
@ -273,6 +272,7 @@ TlsWrite(void *cookie, void *buf, size_t nBytes)
errno = EIO; errno = EIO;
break; break;
} }
ret = -1;
} }
return ret; return ret;