Corinna Vinschen b14f53a8ec Reintegrate socket duplication via WSADuplicateSocket/WSASocket.
* autoload.cc (WSADuplicateSocketW): Define.
	(WSASocketW): Define.
	* dtable.cc (dtable::release): Call dec_need_fixup_before if necessary.
	(dtable::fixup_before_fork): New function.
	(dtable::fixup_before_exec): New function.
	* dtable.h (class dtable): Add member cnt_need_fixup_before.  Add
	declarations for above new functions.
	(dtable::dec_need_fixup_before): New inline method.
	(dtable::inc_need_fixup_before): New inline method.
	(dtable::need_fixup_before): New inline method.
	* fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual
	method.
	(fhandler_base::need_fixup_before): New virtual method.
	(class fhandler_socket): Add member prot_info_ptr.
	(fhandler_socket::init_fixup_before): Declare.
	(fhandler_socket::need_fixup_before): New inline method.
	(fhandler_socket::fixup_before_fork_exec): Declare.
	(fhandler_socket::fixup_after_exec): Declare.
	* fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
	prot_info_ptr to NULL.
	(fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally.
	(fhandler_socket::init_fixup_before): New method.
	(fhandler_socket::fixup_before_fork_exec): Ditto.
	(fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate
	socket if necessary.
	(fhandler_socket::fixup_after_exec): New method.
	(fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork
	to duplicate socket if necessary.
	* fork.cc (frok::parent): Start child suspended if some fhandler
	needs fixup before fork.  If so, call dtable::fixup_before_fork after
	CreateProcess and resume child.
	* net.cc (fdsock): Try to find out if socket needs fixup before and
	initialize socket accordingly.  Add HUGE comment to explain what happens
	and why.
	* spawn.cc (spawn_guts): Start child suspended if some fhandler needs
	fixup before exec.  If so, call dtable::fixup_before_exec after
	CreateProcess.
2009-11-17 10:43:01 +00:00
..
2009-10-14 04:17:05 +00:00
2009-01-21 17:14:39 +00:00
2009-09-22 02:49:15 +00:00
2007-01-03 11:14:53 +00:00
2009-09-22 02:49:15 +00:00
2009-01-21 17:14:39 +00:00
2009-01-21 17:14:39 +00:00
2009-01-21 17:14:39 +00:00
2009-08-01 19:52:46 +00:00
2009-10-31 13:24:06 +00:00
2009-07-07 20:12:44 +00:00
2009-08-21 21:32:06 +00:00
2009-09-26 21:01:10 +00:00
2009-10-31 13:24:06 +00:00
2009-10-31 13:24:06 +00:00
2009-01-21 17:14:39 +00:00
2008-11-26 17:21:04 +00:00
2008-05-20 15:11:23 +00:00
2009-10-07 15:47:38 +00:00
2009-10-14 04:17:05 +00:00
2009-10-31 13:24:06 +00:00
2009-01-21 17:14:39 +00:00
2009-01-21 17:14:39 +00:00
2009-10-31 13:24:06 +00:00
2009-10-07 15:47:38 +00:00
2009-10-14 04:17:05 +00:00
2008-05-22 01:25:37 +00:00
2009-07-03 18:05:51 +00:00
2009-07-03 18:05:51 +00:00
2009-10-31 13:24:06 +00:00
2009-08-01 19:52:46 +00:00
2009-08-01 19:52:46 +00:00
2009-02-19 16:12:02 +00:00