We already use the SOCK_CLOEXEC extesion to socket/accept4/open/socketpair on Linux so that we can create a socket/fd and make it close-on-exec in a single syscall. In 0.2.4.x, we might want to do the same for opening a nonblocking socket.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Okay, looks better. Three things I want to do before merging this:
The eventdns changes should be wrapped in an #if 1 or something -- eventdns.c is imported code (snarfed from Libevent 1.x and then patched sporadically with fixes from later Libevent versions), and we should minimize our changes to it. In fact, unless the old code is wrong , we should really just leave it alone.
In several places, the patch uses an #ifdef _WIN32 to decide whether to call close() or closesocket(). Ideally, we should have a function or macro for that. This would be tor_close_socket, but without the socket accounting.
This needs a changes/ file.
I'll see if I can do these in the next day or two, unless you want to.
I can make the changes if you want. Not sure when I'll have the time, but it will be some time this week.
I'm not sure whether I understand your first point correctly, though. You want to wrap the changed code in the #if branch, and leave the old code in the #else branch, so it won't be compiled but is still around for future patches? Is that correct?
Thanks, and sorry about the delay! (I hope the next version of trac sends notification mails when somebody uploads an attachment.)
I merged your patch as ebd4ab1506517b32ee3bd5bd1597b4373aa56ee7 ; fixed a bug as e25eb35f11b0419fe50791b3760f1d4016bf8a8b; and added tests in b8d9c8403718b2dca577947d2f5d9248ab87961e, d6adf055828283dda2ca9c0c77a80348778c45df, and bcc39c466688e41ac8f58e5589e854a916769a14. Thanks!
Trac: Resolution: N/Ato implemented Status: needs_review to closed