mirror of
https://github.com/0intro/libtask
synced 2024-11-24 22:59:43 +03:00
tcpproxy: reduce verbosity
This commit is contained in:
parent
eed781b1a9
commit
e82890a2aa
@ -11,6 +11,8 @@ enum
|
||||
STACK = 32768
|
||||
};
|
||||
|
||||
static int verbose;
|
||||
|
||||
char *server;
|
||||
int port;
|
||||
void proxytask(void*);
|
||||
@ -51,7 +53,8 @@ taskmain(int argc, char **argv)
|
||||
}
|
||||
fdnoblock(fd);
|
||||
while((cfd = netaccept(fd, remote, &rport)) >= 0){
|
||||
fprintf(stderr, "connection from %s:%d\n", remote, rport);
|
||||
if(verbose)
|
||||
fprintf(stderr, "connection from %s:%d\n", remote, rport);
|
||||
taskcreate(proxytask, (void*)(uintptr_t)cfd, STACK);
|
||||
}
|
||||
}
|
||||
@ -67,7 +70,8 @@ proxytask(void *v)
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stderr, "connected to %s:%d\n", server, port);
|
||||
if(verbose)
|
||||
fprintf(stderr, "connected to %s:%d\n", server, port);
|
||||
|
||||
taskcreate(rwtask, mkfd2(fd, remotefd), STACK);
|
||||
taskcreate(rwtask, mkfd2(remotefd, fd), STACK);
|
||||
|
Loading…
Reference in New Issue
Block a user