command line improvement (#115)

make -l easy to use:
-l wg wss
-l wg:12345
-l 12345

make -r use random port
This commit is contained in:
Sijie.Sun
2024-05-16 20:16:09 +08:00
committed by GitHub
parent f665de9b18
commit 7532a7c1b2
3 changed files with 116 additions and 39 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ impl Stream for TunStream {
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<StreamItem>> {
let mut self_mut = self.project();
let mut g = ready!(self_mut.l.poll_lock(cx));
reserve_buf(&mut self_mut.cur_buf, 2500, 128 * 1024);
reserve_buf(&mut self_mut.cur_buf, 2500, 32 * 1024);
if self_mut.cur_buf.len() == 0 {
unsafe {
self_mut.cur_buf.set_len(*self_mut.payload_offset);