Skip to content

Commit

Permalink
chore: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Dec 19, 2024
1 parent e36b593 commit 283ccab
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/atclient/src/socket_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ int atclient_tls_socket_read_until_char(struct atclient_tls_socket *socket, unsi

// Read into current block
size_t pos = 0; // position in current block
int timeout_count = 0;
do {
// When reading to a character we must read byte by byte to prevent
// over reading and risk corrupting the next message
Expand Down Expand Up @@ -334,15 +333,8 @@ int atclient_tls_socket_read_until_char(struct atclient_tls_socket *socket, unsi
case MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS: // crypto operation in progress
// async error, we need to try again
break;
case MBEDTLS_ERR_SSL_TIMEOUT: // timeout before reading the expected character
// timeout usually indicates nothing to read
timeout_count++;
if (timeout_count == MAX_READ_TIMEOUTS) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_DEBUG, "Failed to read the full message after %d attempts\n",
MAX_READ_TIMEOUTS);
return ATCLIENT_SSL_TIMEOUT_EXITCODE;
}
usleep(1000);
case MBEDTLS_ERR_SSL_TIMEOUT:
return ATCLIENT_SSL_TIMEOUT_EXITCODE;
break;
// unexpected errors while reading
default:
Expand Down

0 comments on commit 283ccab

Please sign in to comment.