You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Move mbedlts print func to SSLMbedTLSContext.
This commit is contained in:
@@ -33,11 +33,6 @@
|
||||
#include "core/io/stream_peer_tcp.h"
|
||||
#include "core/os/file_access.h"
|
||||
|
||||
void _print_error(int ret) {
|
||||
printf("mbedtls error: returned -0x%x\n\n", -ret);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int StreamPeerMbedTLS::bio_send(void *ctx, const unsigned char *buf, size_t len) {
|
||||
|
||||
if (buf == NULL || len <= 0) return 0;
|
||||
@@ -89,7 +84,7 @@ Error StreamPeerMbedTLS::_do_handshake() {
|
||||
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
// An error occurred.
|
||||
ERR_PRINT("TLS handshake error: " + itos(ret));
|
||||
_print_error(ret);
|
||||
SSLContextMbedTLS::print_mbedtls_error(ret);
|
||||
disconnect_from_stream();
|
||||
status = STATUS_ERROR;
|
||||
return FAILED;
|
||||
@@ -188,7 +183,7 @@ Error StreamPeerMbedTLS::put_partial_data(const uint8_t *p_data, int p_bytes, in
|
||||
disconnect_from_stream();
|
||||
return ERR_FILE_EOF;
|
||||
} else if (ret <= 0) {
|
||||
_print_error(ret);
|
||||
SSLContextMbedTLS::print_mbedtls_error(ret);
|
||||
disconnect_from_stream();
|
||||
return ERR_CONNECTION_ERROR;
|
||||
}
|
||||
@@ -233,7 +228,7 @@ Error StreamPeerMbedTLS::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r
|
||||
disconnect_from_stream();
|
||||
return ERR_FILE_EOF;
|
||||
} else if (ret <= 0) {
|
||||
_print_error(ret);
|
||||
SSLContextMbedTLS::print_mbedtls_error(ret);
|
||||
disconnect_from_stream();
|
||||
return ERR_CONNECTION_ERROR;
|
||||
}
|
||||
@@ -264,7 +259,7 @@ void StreamPeerMbedTLS::poll() {
|
||||
disconnect_from_stream();
|
||||
return;
|
||||
} else if (ret < 0) {
|
||||
_print_error(ret);
|
||||
SSLContextMbedTLS::print_mbedtls_error(ret);
|
||||
disconnect_from_stream();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user