Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
nullchinchilla committed Oct 26, 2022
1 parent 0c6a613 commit 005d0f1
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion geph4-aioutils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ pub async fn copy_with_stats_async<F: Future<Output = ()>>(
mut writer: impl AsyncWrite + Unpin,
mut on_write: impl FnMut(usize) -> F,
) -> std::io::Result<()> {
let mut buffer = [0u8; 32768];
let mut buffer = [0u8; 4096];
let mut timeout = smol::Timer::after(IDLE_TIMEOUT);
loop {
// first read into the small buffer
10 changes: 7 additions & 3 deletions tundevice/src/lib.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,12 @@ use std::os::unix::io::AsRawFd;
use std::os::{raw::c_char, unix::prelude::RawFd};
use std::{ffi::CStr, process::Command};
use std::{fs, io, os::raw::c_int};
extern "C" {
fn tun_setup(fd: c_int, name: *mut u8) -> c_int;
// extern "C" {
// fn tun_setup(fd: c_int, name: *mut u8) -> c_int;
// }

unsafe fn tun_setup(fd: c_int, name: *mut u8) -> c_int {
let ifr = libc::ifreq::default();
}

/// A virtual TUN interface.
@@ -40,7 +44,7 @@ impl TunDevice {
.to_string_lossy()
.into_owned()
};
log::warn!("TUN DEVICE INITIALIZED {:#?}", fd);
log::info!("TUN DEVICE INITIALIZED {:#?}", fd);
// return the device
Ok(TunDevice {
fd: async_dup::Mutex::new(smol::Async::new(fd)?),

0 comments on commit 005d0f1

Please sign in to comment.