openssl: change `read_into` to `read` (#12251)
							parent
							
								
									a84b1a53ec
								
							
						
					
					
						commit
						1ba839dc3b
					
				| 
						 | 
					@ -179,7 +179,13 @@ pub fn (mut s SSLConn) socket_read_into_ptr(buf_ptr &byte, len int) ?int {
 | 
				
			||||||
	return res
 | 
						return res
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[deprecated: 'call SSLConn.read instead']
 | 
				
			||||||
 | 
					[deprecated_after: '2021-11-04']
 | 
				
			||||||
pub fn (mut s SSLConn) read_into(mut buffer []byte) ?int {
 | 
					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) ?
 | 
						res := s.socket_read_into_ptr(&byte(buffer.data), buffer.len) ?
 | 
				
			||||||
	return res
 | 
						return res
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ fn (mut ws Client) socket_read(mut buffer []byte) ?int {
 | 
				
			||||||
			return error('socket_read: trying to read a closed socket')
 | 
								return error('socket_read: trying to read a closed socket')
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if ws.is_ssl {
 | 
							if ws.is_ssl {
 | 
				
			||||||
			r := ws.ssl_conn.read_into(mut buffer) ?
 | 
								r := ws.ssl_conn.read(mut buffer) ?
 | 
				
			||||||
			return r
 | 
								return r
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			for {
 | 
								for {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue