MCPcopy Create free account
hub / github.com/OpenPrinting/cups / http_set_timeout

Function http_set_timeout

cups/http.c:4600–4620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4598 */
4599
4600static void
4601http_set_timeout(int fd, /* I - File descriptor */
4602 double timeout) /* I - Timeout in seconds */
4603{
4604#ifdef _WIN32
4605 DWORD tv = (DWORD)(timeout * 1000);
4606 /* Timeout in milliseconds */
4607
4608 setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, CUPS_SOCAST &tv, sizeof(tv));
4609 setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, CUPS_SOCAST &tv, sizeof(tv));
4610
4611#else
4612 struct timeval tv; /* Timeout in secs and usecs */
4613
4614 tv.tv_sec = (int)timeout;
4615 tv.tv_usec = (int)(1000000 * fmod(timeout, 1.0));
4616
4617 setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, CUPS_SOCAST &tv, sizeof(tv));
4618 setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, CUPS_SOCAST &tv, sizeof(tv));
4619#endif /* _WIN32 */
4620}
4621
4622
4623/*

Callers 2

httpReconnect2Function · 0.85
httpSetTimeoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected