Skip to content

Commit a260ec6

Browse files
authored
mbedtls: better ux around client timeout by mentioning the mbedtls_client_read_timeout_ms flag (#26574)
1 parent 87340bc commit a260ec6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

vlib/net/mbedtls/ssl_connection.c.v

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,13 @@ pub fn (mut s SSLConn) socket_read_into_ptr(buf_ptr &u8, len int) !int {
584584
}
585585
return 0
586586
}
587+
C.MBEDTLS_ERR_SSL_TIMEOUT {
588+
$if trace_ssl ? {
589+
eprintln('${@METHOD} ---> res: ${err} C.MBEDTLS_ERR_SSL_TIMEOUT')
590+
}
591+
return error_with_code('net.mbedtls SSLConn.socket_read_into_ptr, did not receive any data within ${mbedtls_client_read_timeout_ms}ms. compile with `-d mbedtls_client_read_timeout_ms=100000` to set a higher timeout',
592+
res)
593+
}
587594
else {
588595
$if trace_ssl ? {
589596
eprintln('${@METHOD} ---> res: could not read using SSL')

0 commit comments

Comments
 (0)