Skip to content

Commit 78ccf46

Browse files
committed
error reporting was improved
1 parent a515455 commit 78ccf46

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ extern "C" fn init() {
153153
let (connection_reader, connection_writer) = connection.split();
154154

155155
let stream = ProxyChains::connect(target, config()).await;
156-
157-
if let Ok(mut stream) = stream {
158-
let (mut reader, mut writer) = stream.split();
156+
match stream {
157+
Ok(mut stream) => {
158+
let (mut reader, mut writer) = stream.split();
159159
let _ = futures::join!(
160160
copy(connection_reader, &mut writer),
161161
copy(&mut reader, connection_writer)
162162
);
163-
} else {
164-
// LOG: failed to connect proxychains
163+
},
164+
Err(e) => eprintln!("Failed to create proxychains. {}", e.to_string()),
165165
}
166166
});
167167
}
@@ -188,7 +188,7 @@ fn connect(socket: c_int, address: *const sockaddr, len: socklen_t) -> c_int {
188188
if let Ok(_) = (*CONNECTION_SENDER).send((socket as u32, socket_addr)) {
189189
(*CONNECTION_LISTENER_WAKER).clone().wake();
190190
} else {
191-
// LOG: failed to send new connection info over the cahnnel
191+
eprintln!("Failed to send new connection info over the cahnnel.");
192192
}
193193
}
194194
}
@@ -214,7 +214,7 @@ fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t {
214214
if let Ok(_) = connection.get_reader_sender().send(content) {
215215
waker.wake();
216216
} else {
217-
// LOG: failed to redirect data to Connection
217+
eprintln!("Failed to get reader waker.");
218218
}
219219
}
220220

0 commit comments

Comments
 (0)