MCPcopy Index your code
hub / github.com/RustPython/RustPython / read

Method read

crates/stdlib/src/openssl.rs:2357–2376  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

2355
2356 impl Read for BioStream {
2357 fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
2358 // Read from incoming MemoryBIO
2359 unsafe {
2360 let nbytes = sys::BIO_read(
2361 self.inbio.bio,
2362 buf.as_mut_ptr() as *mut _,
2363 buf.len().min(i32::MAX as usize) as i32,
2364 );
2365 if nbytes < 0 {
2366 // BIO_read returns -1 on error or when no data is available
2367 // Check if it's a retry condition (WANT_READ)
2368 Err(std::io::Error::new(
2369 std::io::ErrorKind::WouldBlock,
2370 "BIO has no data available",
2371 ))
2372 } else {
2373 Ok(nbytes as usize)
2374 }
2375 }
2376 }
2377 }
2378
2379 impl Write for BioStream {

Callers 15

_msg_callbackFunction · 0.45
ctxMethod · 0.45
optionsMethod · 0.45
_wrap_socketMethod · 0.45
_wrap_bioMethod · 0.45
ownerMethod · 0.45
contextMethod · 0.45
getpeercertMethod · 0.45
get_unverified_chainMethod · 0.45
get_verified_chainMethod · 0.45
pendingMethod · 0.45

Calls 15

newFunction · 0.85
create_ssl_eof_errorFunction · 0.85
convert_ssl_errorFunction · 0.85
timeout_error_msgFunction · 0.85
socket_closed_errorFunction · 0.85
BIO_ctrl_pendingFunction · 0.85
convert_openssl_errorFunction · 0.85
getFunction · 0.85
as_mut_ptrMethod · 0.80
get_mutMethod · 0.80
is_bioMethod · 0.80
ssl_readMethod · 0.80

Tested by

no test coverage detected