Re: increase netcat's buffer...

2014-10-29 Thread Arne Becker
Ping?

Re: increase netcat's buffer...

2014-10-13 Thread Arne Becker
Hi again. >> +/* make all fds non-blocking */ >> +for (n = 0; n < 4; n++) { >> +if (pfd[n].fd == -1) >> +continue; >> +flags = fcntl(pfd[n].fd, F_GETFL, 0); >> +/* >> + * For sockets and pipes, we want non-block, but setti

Re: increase netcat's buffer...

2014-07-09 Thread Arne Becker
Hi. >> -err(1, "bind failed"); >> +errx(1, "bind failed: %s", strerror(errno)); >> freeaddrinfo(ares); > > This doesn't seem necessary, or correct. Indeed. New patch below. >> @@ -640,7 +648,7 @@ timeout_connect(int s, const struct sock >>

Re: increase netcat's buffer...

2014-06-26 Thread Arne Becker
Hi. > If the buffer is fixed, dont bother memmove it, just remember the > begining and the end: > http://en.wikipedia.org/wiki/Circular_buffer There's a tradeoff - lots of memmove vs. lots of very small reads/writes if you get near the end of the buffer. My gut feeling told me that local things,

Re: increase netcat's buffer...

2014-06-26 Thread Arne Becker
Hi. >> + /* listen and net in gone, queues empty, done */ >> + if (lflag && pfd[POLL_NETIN].fd == -1 > > lflag ??? > warning only one ref in the diff > lflag is a global, the "listen" flag, as in: nc -l 127.0.0.1 80 I believe this is correct. Only when we listen do

Re: increase netcat's buffer...

2014-06-26 Thread Arne Becker
Hi. > Now soliciting diffs to change readwrite to a loop with two buffers > that poll()s in all four directions. :) Good thing you made me remember I wrote just this a while ago. This is my first OpenBSD diff, so tell me if I missed anything obvious. Tested quite extensively originally; for this