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

Function httpInitialize

cups/http.c:1524–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1522 */
1523
1524void
1525httpInitialize(void)
1526{
1527 static int initialized = 0; /* Have we been called before? */
1528#ifdef _WIN32
1529 WSADATA winsockdata; /* WinSock data */
1530#endif /* _WIN32 */
1531
1532
1533 _cupsGlobalLock();
1534 if (initialized)
1535 {
1536 _cupsGlobalUnlock();
1537 return;
1538 }
1539
1540#ifdef _WIN32
1541 WSAStartup(MAKEWORD(2,2), &winsockdata);
1542
1543#elif !defined(SO_NOSIGPIPE)
1544 /*
1545 * Ignore SIGPIPE signals...
1546 */
1547
1548# ifdef HAVE_SIGSET
1549 sigset(SIGPIPE, SIG_IGN);
1550
1551# elif defined(HAVE_SIGACTION)
1552 struct sigaction action; /* POSIX sigaction data */
1553
1554
1555 memset(&action, 0, sizeof(action));
1556 action.sa_handler = SIG_IGN;
1557 sigaction(SIGPIPE, &action, NULL);
1558
1559# else
1560 signal(SIGPIPE, SIG_IGN);
1561# endif /* !SO_NOSIGPIPE */
1562#endif /* _WIN32 */
1563
1564# ifdef HAVE_TLS
1565 _httpTLSInitialize();
1566# endif /* HAVE_TLS */
1567
1568 initialized = 1;
1569 _cupsGlobalUnlock();
1570}
1571
1572
1573/*

Callers 5

mainFunction · 0.85
http-addrlist.cFile · 0.85
httpAddrGetListFunction · 0.85
httpAddrListenFunction · 0.85
http_createFunction · 0.85

Calls 4

_cupsGlobalLockFunction · 0.85
_cupsGlobalUnlockFunction · 0.85
sigactionClass · 0.70
_httpTLSInitializeFunction · 0.70

Tested by

no test coverage detected