Open fadinglr opened 2 years ago
in openssl, ssl3_get_record will only get one record each time when called. while in tlse, ` unsigned char client_message[0xFFFF]; // accept int read_size; while ((!context->application_buffer_len) && ((read_size = _private_tls_safe_read(context, (char *)client_message, sizeof(client_message))) > 0)) { if (tls_consume_stream(context, client_message, read_size, ssl_data->certificate_verify) > 0) _tls_ssl_private_send_pending(ssl_data->fd, context);
if ((context->critical_error) && (!context->application_buffer_len))
return TLS_GENERIC_ERROR;
}`
_private_tls_safe_read get too much data each time. the openssl fiset call ssl3_read_n(5) to get the header, and then call ss3_read_n(length), the length is got from the header.
Dear author, I found a strange behavior in SSL_read function compared with openssl's SSL_read function. when i use openssl, the number of bytes ssl_read int the client side returned will never larger than the number of bytes ssl_write from the server side, the code is like below: server side:
SSL_write(ssl, text, 32); SSL_write(ssl, text, 32); SSL_write(ssl, text, 32); SSL_write(ssl, text, 32); SSL_write(ssl, text, 32); SSL_write(ssl, text, 32); SSL_write(ssl, text, 32);
client side: `while (1) {the result: i will only receive 32 byte one time i called ssl_read.
while, when i use your awsome project tlse, the client side result is like this:
I received 128 bytes one time, and this caught some stick package error in my project.
![image](https://user-images.githubusercontent.com/35442643/172560709-d28c9f37-a867-4eee-82f6-1e236c52830e.png)
Could you please help me with this problem?