sergot / openssl

OpenSSL bindings for Perl 6
MIT License
14 stars 31 forks source link

Only allocate buffer to max size of an SSL record #55

Closed MasterDuke17 closed 6 years ago

MasterDuke17 commented 6 years ago

According to my interpretation of https://wiki.openssl.org/index.php/Manual:SSL_read(3), if num ($n here) is larger than the max size of an SSL/TLS record (16k according to https://tools.ietf.org/html/rfc5246#section-6.2.1) it will just return up to a single record.

MasterDuke17 commented 6 years ago

For me, the last output of https://gist.github.com/AlexDaniel/0cdb3211cfcae90c29da9330649171c2 before this patch is 1948.398438MiB maxrss, after the patch it's 1687.542969MiB maxrss