Ping?
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
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
>>
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,
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
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