Read a single TLS record for post-handshake I/O while preserving the SSL-vs-socket error precedence from the old sock_recv() path.
(
conn: &mut TlsConnection,
socket: &PySSLSocket,
vm: &VirtualMachine,
)
| 1243 | /// Read a single TLS record for post-handshake I/O while preserving the |
| 1244 | /// SSL-vs-socket error precedence from the old sock_recv() path. |
| 1245 | fn recv_one_tls_record_for_data( |
| 1246 | conn: &mut TlsConnection, |
| 1247 | socket: &PySSLSocket, |
| 1248 | vm: &VirtualMachine, |
| 1249 | ) -> SslResult<PyObjectRef> { |
| 1250 | match recv_one_tls_record(socket, vm) { |
| 1251 | Ok(data) => Ok(data), |
| 1252 | Err(SslError::Eof) => { |
| 1253 | if let Err(rustls_err) = conn.process_new_packets() { |
| 1254 | return Err(SslError::from_rustls(rustls_err)); |
| 1255 | } |
| 1256 | Ok(vm.ctx.new_bytes(vec![]).into()) |
| 1257 | } |
| 1258 | Err(SslError::Py(e)) => { |
| 1259 | if let Err(rustls_err) = conn.process_new_packets() { |
| 1260 | return Err(SslError::from_rustls(rustls_err)); |
| 1261 | } |
| 1262 | if is_connection_closed_error(&e, vm) { |
| 1263 | return Err(SslError::Eof); |
| 1264 | } |
| 1265 | Err(SslError::Py(e)) |
| 1266 | } |
| 1267 | Err(e) => Err(e), |
| 1268 | } |
| 1269 | } |
| 1270 | |
| 1271 | fn handshake_read_data( |
| 1272 | conn: &mut TlsConnection, |
no test coverage detected