fix reading buffer

This commit is contained in:
yggverse 2024-09-25 18:06:52 +03:00
parent a044fe82dd
commit c708cc20d6

View File

@ -71,22 +71,21 @@ impl Page {
Priority::DEFAULT, Priority::DEFAULT,
Some(&Cancellable::new()), Some(&Cancellable::new()),
move |result| match result { move |result| match result {
Ok(request) => { Ok(_) => {
println!(
"Request sent successfully: {:?}",
request
); // @TODO remove
connection.input_stream().read_all_async( connection.input_stream().read_all_async(
Vec::new(), vec![0; 0xfffff], // 1Mb @TODO
Priority::DEFAULT, Priority::DEFAULT,
Some(&Cancellable::new()), Some(&Cancellable::new()),
{ {
|result| match result { move |result| match result {
Ok(response) => { Ok(response) => {
println!("Result: {:?}", response); println!(
"Result: {:?}",
// @TODO connection.close(cancellable); GString::from_utf8_until_nul(
response.0
)
); // @TODO
// @TODO connection.close(cancellable);
} }
Err(e) => { Err(e) => {
eprintln!( eprintln!(
@ -97,7 +96,6 @@ impl Page {
} }
}, },
); );
// @TODO
} }
Err(e) => { Err(e) => {
eprintln!("Failed to write request: {:?}", e); eprintln!("Failed to write request: {:?}", e);