MCPcopy Create free account
hub / github.com/dillo-browser/dillo / init_ids_srs_socket

Function init_ids_srs_socket

dpid/dpid.c:638–655  ·  view source on GitHub ↗

! Initialise the service request socket (IDS) * \Return: * \li Number of sockets (1 == success) * \li -1 on failure */

Source from the content-addressed store, hash-verified

636 * \li -1 on failure
637 */
638int init_ids_srs_socket(void)
639{
640 int srs_port, ret = -1;
641
642 FD_ZERO(&sock_set);
643
644 if ((srs_fd = bind_socket_fd(DPID_BASE_PORT, &srs_port)) != -1) {
645 /* create the shared secret */
646 SharedKey = a_Misc_mksecret(8);
647 /* save port number and SharedKey */
648 if (save_comm_keys(srs_port) != -1) {
649 FD_SET(srs_fd, &sock_set);
650 ret = 1;
651 }
652 }
653
654 return ret;
655}
656
657/*! Initialize a single dpi socket
658 * \Return

Callers 1

mainFunction · 0.85

Calls 3

bind_socket_fdFunction · 0.85
a_Misc_mksecretFunction · 0.85
save_comm_keysFunction · 0.85

Tested by

no test coverage detected