Properly set the timeout in a query_state. The global query_timeout

configuration value is an integer count of seconds, it is not a timeval.
Using memcpy() to copy a timeval from it put garbage into the tv_usec
field.

PR:		194025
Submitted by:	David Shane Holden <dpejesh@yahoo.com>
MFC after:	1 week
This commit is contained in:
jhb 2014-10-06 18:16:45 +00:00
parent ec52dc2e32
commit b7d50610ce

View File

@ -1253,8 +1253,8 @@ init_query_state(int sockfd, size_t kevent_watermark, uid_t euid, gid_t egid)
retval->read_func = query_socket_read;
get_time_func(&retval->creation_time);
memcpy(&retval->timeout, &s_configuration->query_timeout,
sizeof(struct timeval));
retval->timeout.tv_sec = s_configuration->query_timeout;
retval->timeout.tv_usec = 0;
TRACE_OUT(init_query_state);
return (retval);