Our Read functions were taking a timeout of UINT32_MAX to mean wait forever, but then
we didn't implement that in setting the socket option. <rdar://problem/10711649> llvm-svn: 148616
This commit is contained in:
parent
5928f64e2c
commit
c668f81107
|
@ -983,8 +983,16 @@ ConnectionFileDescriptor::SetSocketReceiveTimeout (uint32_t timeout_usec)
|
||||||
//printf ("ConnectionFileDescriptor::SetSocketReceiveTimeout (timeout_usec = %u)\n", timeout_usec);
|
//printf ("ConnectionFileDescriptor::SetSocketReceiveTimeout (timeout_usec = %u)\n", timeout_usec);
|
||||||
|
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
timeout.tv_sec = timeout_usec / TimeValue::MicroSecPerSec;
|
if (timeout_usec == UINT32_MAX)
|
||||||
timeout.tv_usec = timeout_usec % TimeValue::MicroSecPerSec;
|
{
|
||||||
|
timeout.tv_sec = 0;
|
||||||
|
timeout.tv_usec = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timeout.tv_sec = timeout_usec / TimeValue::MicroSecPerSec;
|
||||||
|
timeout.tv_usec = timeout_usec % TimeValue::MicroSecPerSec;
|
||||||
|
}
|
||||||
if (::setsockopt (m_fd_recv, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == 0)
|
if (::setsockopt (m_fd_recv, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == 0)
|
||||||
{
|
{
|
||||||
m_socket_timeout_usec = timeout_usec;
|
m_socket_timeout_usec = timeout_usec;
|
||||||
|
|
Loading…
Reference in New Issue