On 1/22/12 7:13 PM, Leif Hedstrom wrote:
Still watching the game at In The Zone, but, with your patch, does it still
support both accept threads (1 or more) and non-blocking accept on each
net-thread ?
So, looking at some older code, v2.1.6 for example, where we passed around
frequent_accept as a parameter, it was always true. And the code still said
if (frequent_accept) { // true
What's semi confusing is that the declaration of accept_internal() has the
frequent_accept parameter defaulted to "false", yet, as far as I can tell,
in this older version of the code, we always called it with "true". Hence, I
think the initial commit made the "opt" structure default the value to
false, and when we noticed it was breaking shit, it was changed to 'true'.
Fwiw, I also checked v2.0.1, and it also had frequent_accept (as passed
around) default to true in every case. See code below, for how it was
invoked back then (notice how the frequent_accept parameter is always 'true').
So, unless I'm totally missing something, just changing the default back to
'false' again will break accept_internal() as it was intended to work, no ?
-- leif
Action *
NetProcessor::main_accept(Continuation * cont, SOCKET fd, int port,
sockaddr * bound_sockaddr, int *bound_sockaddr_size,
bool accept_only,
int recv_bufsize, int send_bufsize, unsigned long
sockopt_flags,
EventType etype, bool callback_on_open)
{
(void) accept_only; // NT only
Debug("net_processor", "NetProcessor::main_accept - port %d,recv_bufsize %d,
send_bufsize %d, sockopt 0x%0lX",
port, recv_bufsize, send_bufsize, sockopt_flags);
return ((UnixNetProcessor *) this)->accept_internal(cont, fd, port,
bound_sockaddr,
bound_sockaddr_size,
true,
net_accept,
recv_bufsize,
send_bufsize,
sockopt_flags,
((UnixNetProcessor *)
this)->incoming_ip_to_bind_saddr,
callback_on_open, etype);