From 1ba839dc3bb527ec73eddac6b7c191f0861b8b3f Mon Sep 17 00:00:00 2001 From: a-iga Date: Thu, 21 Oct 2021 20:13:04 +0900 Subject: [PATCH] openssl: change `read_into` to `read` (#12251) --- vlib/net/openssl/ssl_connection.v | 6 ++++++ vlib/net/websocket/io.v | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vlib/net/openssl/ssl_connection.v b/vlib/net/openssl/ssl_connection.v index fa43271d8c..c3e9c3cac9 100644 --- a/vlib/net/openssl/ssl_connection.v +++ b/vlib/net/openssl/ssl_connection.v @@ -179,7 +179,13 @@ pub fn (mut s SSLConn) socket_read_into_ptr(buf_ptr &byte, len int) ?int { return res } +[deprecated: 'call SSLConn.read instead'] +[deprecated_after: '2021-11-04'] pub fn (mut s SSLConn) read_into(mut buffer []byte) ?int { + return s.read(mut buffer) +} + +pub fn (mut s SSLConn) read(mut buffer []byte) ?int { res := s.socket_read_into_ptr(&byte(buffer.data), buffer.len) ? return res } diff --git a/vlib/net/websocket/io.v b/vlib/net/websocket/io.v index 5408a4ed55..2ef7870a80 100644 --- a/vlib/net/websocket/io.v +++ b/vlib/net/websocket/io.v @@ -10,7 +10,7 @@ fn (mut ws Client) socket_read(mut buffer []byte) ?int { return error('socket_read: trying to read a closed socket') } if ws.is_ssl { - r := ws.ssl_conn.read_into(mut buffer) ? + r := ws.ssl_conn.read(mut buffer) ? return r } else { for {